Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
5f785182
Commit
5f785182
authored
Sep 16, 2013
by
fred
Browse files
move week navigation arrows next to the days
parent
2a344dd7
Changes
5
Hide whitespace changes
Inline
Side-by-side
panikweb/paniktags/templatetags/paniktags.py
View file @
5f785182
...
...
@@ -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
)
...
...
panikweb/views.py
View file @
5f785182
...
...
@@ -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
()
...
...
panikweb_templates/static/css/specifics.css
View file @
5f785182
...
...
@@ -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
;
...
...
panikweb_templates/templates/includes/week.html
View file @
5f785182
...
...
@@ -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>
...
...
panikweb_templates/templates/program.html
View file @
5f785182
...
...
@@ -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" %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment