Commit 10bd9017 authored by Simon Daron's avatar Simon Daron
Browse files

BuNews & Program on Home

parent e472d6bd
......@@ -240,8 +240,16 @@ class Home(TemplateView):
def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs)
context['newsImaged'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[:10])
context['newsImaged'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[:3])
context['newsImaged2'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[:10])
context['news'] = list(NewsItem.objects.all().order_by('-datetime')[:36])
context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title'))
schedules = Schedule.objects.select_related().order_by('datetime')
days = []
for day in range(7):
days.append({'schedules': [x for x in schedules if x.is_on_weekday(day+1)],
'datetime': datetime(2007, 1, day+1)})
context['days'] = days
return context
home = Home.as_view()
......
......@@ -105,7 +105,6 @@ body{
color:white;
}
#Main{
min-height:30em;
color:#333;
background-color: white;
}
......@@ -494,24 +493,24 @@ body{
/****************************************************/
/**** Home ****/
@media screen and (max-width:800px){
#Home .news .logo{
#Home .newsRoll .logo{
max-width:100px;
}
}
@media screen and (max-width:600px){
#Home .news .logo{
#Home .newsRoll .logo{
max-width:50px;
}
}
/****************************************************/
/**** PROGRAM ****/
#Program .tabs nav ul li{
.program.tabs nav ul li{
display:table-cell;
width:14%;
text-align:center;
}
#Program .dateBloc {
.program .dateBloc {
float:left;
padding-top:1em;
}
......
{% extends "base.html" %}
{% load thumbnails %}
{% load paniktags %}
{% block bodyID %}Home{% endblock %}
{% block nav %}{% endblock %}
{% block title %}{% endblock %}
{% block main %}
<div class="news">
<div class="wrapper padded news">
{% if program %}dfsdfsdf
{{ program }}
{% endif %}
<div class="news padded">
<div class="wrapper">
<h2 class="">News</h2>
</div>
<div class="wrapper">
<ul class="custom list news cf">
{% for NewsItem in newsImaged %}
<li class="item num-{{forloop.counter}}">
{% if NewsItem.slug == newsImaged.0.slug %}
{% news_inline content=NewsItem klass="special" logo="large" %}
{% elif NewsItem.slug == newsImaged.1.slug or NewsItem.slug == newsImaged.2.slug%}
{% news_inline content=NewsItem klass="special" logo="medium"%}
{% else %}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<hr />
<div class="wrapper padded news newsRoll">
<ul class="custom inline ellipsis">
{% for content in newsImaged %}
{% for content in newsImaged2 %}
<li class="item">
<a class="inBlock news" href="{% url 'news-view' slug=content.slug %}">
{% if content.image %}
<img class="logo" src="{{ content.image|thumbnail:'150x150' }}"/>
<img class="logo" src="{{ content.image|thumbnail:'100x100' }}"/>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<hr />
<div class="wrapper">
<ul class="news columns padded">
{% for NewsItem in news %}
<li class="item ellipsis small ">
<a href="{% url 'news-view' slug=NewsItem.slug %}">
<span class="title"><strong>{{ NewsItem.datetime|date:"D m/M" }}</strong>&nbsp;-&nbsp;{{ NewsItem.title }}</span>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="program padded">
<div class="wrapper">
<h2>Cette semaine sur Panik</h2>
<div class="program tabs" data-tab-about="#ProgramContent">
<nav class="">
<ul class="days custom distributed">
{% for day in days %}
<li class=""><button data-tab="#Program-tabs-{{ day.datetime|date:"w" }}">{{ day.datetime|date:"D d" }}</button></li>
{% endfor %}
</ul>
</nav>
</div>
<div id="ProgramContent">
{% for day in days %}
<div data-tabbed="true" class="content padded" id="Program-tabs-{{ day.datetime|date:"w" }}">
<ul class="custom emission-list list">
{% if day.schedules %}
{% for schedule in day.schedules %}
<li>
<div class="date dateBloc">
<div class="time">{{ schedule.datetime|date:"H:i" }}</div>
</div>
<div style="margin-left:7em;">{% include "emissions/inline.html" with emission=schedule.emission %}</div>
</li>
{% endfor %}
{% else %}
<li>Non stop</li>
{% endif %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}
{% block links %}
<div class="wrapper padded">
......
......@@ -41,8 +41,8 @@
<li class="item ellipsis small ">
<a href="{% url 'news-view' slug=NewsItem.slug %}">
<span class="title"><strong>{{ NewsItem.datetime|date:"D m/M" }}</strong>&nbsp;-&nbsp;{{ NewsItem.title }}</span>
</a>
</li>
</a>
</li>
{% endfor %}
</ul>
</div>
......
......@@ -55,10 +55,11 @@
{% block main %}
<div class="wrapper padded">
<div class="wrapper">
{% if not query %}
{% else %}
<div class="padded">
{% if not page.object_list %}
<div class="big error padded center">Sorry, no result with your query!</div>
{% endif %}
......@@ -84,6 +85,7 @@
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
</div>
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment