Skip to content
Snippets Groups Projects
Commit 17833f21 authored by Julian's avatar Julian
Browse files

Check permissions correctly

parent 4efd42d7
No related branches found
No related tags found
1 merge request!88Resolve "Check (responsive) design"
......@@ -115,30 +115,33 @@
<div class="collapsible-body">
<div class="collection">
{% for period in periods %}
<a class="collection-item avatar"
href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}">
{% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="circle" color_suffix=" " %}
<table class="hide-on-med-and-down">
<tr>
<th>{% trans "Subject" %}</th>
<td>{{ period.period.period }}. {{ period.get_subject.name }}</td>
</tr>
{% if not group %}
{% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %}
{% if can_view_lesson_documentation %}
<a class="collection-item avatar"
href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}">
{% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="circle" color_suffix=" " %}
<table class="hide-on-med-and-down">
<tr>
<th>{% trans "Group" %}</th>
<td>{{ period.lesson.group_names }}</td>
<th>{% trans "Subject" %}</th>
<td>{{ period.period.period }}. {{ period.get_subject.name }}</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Teachers" %}</th>
<td>{{ period.lesson.teacher_names }}</td>
</tr>
<tr>
<th>{% trans "Lesson Topic" %}</th>
<td>{{ period.get_lesson_documentation.topic }}</td>
</tr>
</table>
</a>
{% if not group %}
<tr>
<th>{% trans "Group" %}</th>
<td>{{ period.lesson.group_names }}</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Teachers" %}</th>
<td>{{ period.lesson.teacher_names }}</td>
</tr>
<tr>
<th>{% trans "Lesson Topic" %}</th>
<td>{{ period.get_lesson_documentation.topic }}</td>
</tr>
</table>
</a>
{% endif %}
{% endfor %}
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment