Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CelcatSanitizer Teacher
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léo Grange
CelcatSanitizer Teacher
Commits
d4dd17cc
Commit
d4dd17cc
authored
7 years ago
by
Alban Gruin
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable/0.10.z' into prod/pa1ch/0.10.z
parents
604fab9f
5939a5dc
Branches
Branches containing commit
Tags
v0.10.5-pa1ch
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
templates/timetable.html
+1
-1
1 addition, 1 deletion
templates/timetable.html
templates/timetable_common.html
+2
-1
2 additions, 1 deletion
templates/timetable_common.html
views.py
+6
-5
6 additions, 5 deletions
views.py
with
9 additions
and
7 deletions
templates/timetable.html
+
1
−
1
View file @
d4dd17cc
...
...
@@ -15,7 +15,7 @@ <h2>{{ group.timetable }} – {{ group }} – Semaine {{ week }}</h2>
{% if is_old_timetable %}
<b><a
href=
"{% url "
timetable
"
group.timetable.year.slug
group.timetable.slug
group.slug
%}"
>
Accéder à l’emploi du temps de cette semaine.
</b></a><br
/>
{% endif %}
Dernière mise à jour le {{ last_update|date:"l j F o" }} à {{ last_update|date:"H:i" }}
{% if last_update %}
Dernière mise à jour le {{ last_update|date:"l j F o" }} à {{ last_update|date:"H:i" }}
{% endif %}
</p>
{% include "timetable_common.html" %}
<p
class=
"subscribe"
><a
href=
"{% url "
ics
"
group.timetable.year.slug
group.timetable.slug
group.slug
%}"
>
ICS
</a>
–
<a
href=
"{% url "
rss
"
group.timetable.year.slug
group.timetable.slug
group.slug
%}"
>
RSS
</a>
–
<a
href=
"{% url "
atom
"
group.timetable.year.slug
group.timetable.slug
group.slug
%}"
>
Atom
</a></p>
{% endblock %}
This diff is collapsed.
Click to expand it.
templates/timetable_common.html
+
2
−
1
View file @
d4dd17cc
...
...
@@ -9,4 +9,5 @@ <h3>{% filter title %}{{ day.0.begin|date:"l j F o" }}{% endfilter %} – de
<small>
Remarques : {{ course.notes }}
</small>
{% endif %}
</li>
{% endfor %}
</ul>
</section>
{% endfor %}
</section>
{% empty %}
<p>
Aucun cours cette semaine.
</p>
{% endfor %}
This diff is collapsed.
Click to expand it.
views.py
+
6
−
5
View file @
d4dd17cc
...
...
@@ -65,10 +65,11 @@ def group_list(request, year_slug, timetable_slug):
def
timetable
(
request
,
year_slug
,
timetable_slug
,
group_slug
,
year
=
None
,
week
=
None
):
current_year
,
current_week
=
get_current_or_next_week
()
is_old_timetable
=
False
is_old_timetable
,
provided_week
=
False
,
True
if
year
is
None
or
week
is
None
:
year
,
week
=
current_year
,
current_week
provided_week
=
False
elif
(
int
(
year
),
int
(
week
))
<
(
current_year
,
current_week
):
is_old_timetable
=
True
...
...
@@ -80,15 +81,15 @@ def timetable(request, year_slug, timetable_slug, group_slug, year=None, week=No
if
group
.
children
.
count
():
return
group_list_common
(
request
,
timetable
,
Group
.
objects
.
get_relevant_children
(
group
))
courses
=
Course
.
objects
.
get_courses_for_group
(
group
,
begin__gte
=
start
,
begin__lt
=
end
)
\
.
annotate
(
Max
(
"
last_update
"
))
if
courses
.
count
()
==
0
:
courses
=
Course
.
objects
.
get_courses_for_group
(
group
,
begin__gte
=
start
,
begin__lt
=
end
)
if
courses
.
count
()
==
0
and
provided_week
:
raise
Http404
last_update
=
courses
.
aggregate
(
Max
(
"
last_update
"
))[
"
last_update__max
"
]
grouped_courses
=
group_courses
(
courses
)
return
render
(
request
,
"
timetable.html
"
,
{
"
group
"
:
group
,
"
courses
"
:
grouped_courses
,
"
last_update
"
:
courses
.
first
().
last_update
__max
,
"
last_update
"
:
last_update
,
"
year
"
:
year
,
"
week
"
:
int
(
week
),
"
is_old_timetable
"
:
is_old_timetable
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment