Commit 5f785182 authored by fred's avatar fred

move week navigation arrows next to the days

parent 2a344dd7
......@@ -124,12 +124,23 @@ def weekview(context, year=None, week=None, weekday=None, fragment=None):
for day in range(7):
days.append({'cells': [x for x in program if x.is_on_weekday(day+1)],
'datetime': date+timedelta(days=day)})
previous_week = date - timedelta(days=7)
previous_week_year, previous_week_no = previous_week.isocalendar()[:2]
next_week = date + timedelta(days=7)
next_week_year, next_week_no = next_week.isocalendar()[:2]
return {
'fragment': fragment,
'days': days,
'weekday': weekday,
'week': week,
'year': year,
'previous_week_year': previous_week_year,
'previous_week_no': previous_week_no,
'next_week_year': next_week_year,
'next_week_no': next_week_no,
}
@register.inclusion_tag('news/inline.html', takes_context=True)
......
......@@ -129,14 +129,6 @@ class ProgramView(TemplateView):
context['week_first_day'] = utils.tofirstdayinisoweek(year, week)
context['week_last_day'] = context['week_first_day'] + timedelta(days=6)
previous_week = context['week_first_day'] - timedelta(days=7)
context['previous_week_no'] = previous_week.isocalendar()[1]
context['previous_week_year'] = previous_week.isocalendar()[0]
next_week = context['week_first_day'] + timedelta(days=7)
context['next_week_no'] = next_week.isocalendar()[1]
context['next_week_year'] = next_week.isocalendar()[0]
return context
program = ProgramView.as_view()
......
......@@ -794,6 +794,12 @@ ul.newsSpecial{
width:14%;
text-align:center;
}
.program.tabs nav ul li.week-arrow {
width: 1%;
padding-bottom: 5px;
}
.program ul .dateBloc {
float:left;
padding-top:1em;
......
......@@ -3,9 +3,13 @@
<div class="program tabs" data-tab-about="#weekProgramContent-{{ week|slugify }}">
<nav class="">
<ul class="days custom distributed">
<li class="week-arrow"><a href="{% url 'program_week' year=previous_week_year week=previous_week_no %}"
class="icon-chevron-sign-left" ></a></li>
{% for day in days %}
<li class=""><button class="{% if day.datetime.weekday = weekday %}active{% endif %}" data-tab="#Program-week-{{ day.datetime|slugify }}">{{ day.datetime|date:"D d" }}</button></li>
{% endfor %}
<li class="week-arrow"><a href="{% url 'program_week' year=next_week_year week=next_week_no %}"
class="icon-chevron-sign-right" ></a></li>
</ul>
</nav>
</div>
......
......@@ -7,23 +7,7 @@
<div class="wrapper">
<div class="program marged">
<nav class="center">
<ul class="custom distributed">
{% if previous_week_no %}
<li>
<a
href="{% url 'program_week' year=previous_week_year week=previous_week_no %}"
class="icon-chevron-sign-left"
></a>
</li>
{% endif %}
<li>Du {{week_first_day|date:"l j N"}} au {{week_last_day|date:"l j N"}}</li>
<li>
<a
href="{% url 'program_week' year=next_week_year week=next_week_no %}"
class="icon-chevron-sign-right"
></a>
</li>
</ul>
Du {{week_first_day|date:"l j N"}} au {{week_last_day|date:"l j N"}}
</nav>
</div>
{% weekview year=year week=week fragment="nav" %}
......
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