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 @@ ...@@ -115,30 +115,33 @@
<div class="collapsible-body"> <div class="collapsible-body">
<div class="collection"> <div class="collection">
{% for period in periods %} {% for period in periods %}
<a class="collection-item avatar" {% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %}
href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> {% if can_view_lesson_documentation %}
{% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="circle" color_suffix=" " %} <a class="collection-item avatar"
<table class="hide-on-med-and-down"> href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}">
<tr> {% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="circle" color_suffix=" " %}
<th>{% trans "Subject" %}</th> <table class="hide-on-med-and-down">
<td>{{ period.period.period }}. {{ period.get_subject.name }}</td>
</tr>
{% if not group %}
<tr> <tr>
<th>{% trans "Group" %}</th> <th>{% trans "Subject" %}</th>
<td>{{ period.lesson.group_names }}</td> <td>{{ period.period.period }}. {{ period.get_subject.name }}</td>
</tr> </tr>
{% endif %} {% if not group %}
<tr> <tr>
<th>{% trans "Teachers" %}</th> <th>{% trans "Group" %}</th>
<td>{{ period.lesson.teacher_names }}</td> <td>{{ period.lesson.group_names }}</td>
</tr> </tr>
<tr> {% endif %}
<th>{% trans "Lesson Topic" %}</th> <tr>
<td>{{ period.get_lesson_documentation.topic }}</td> <th>{% trans "Teachers" %}</th>
</tr> <td>{{ period.lesson.teacher_names }}</td>
</table> </tr>
</a> <tr>
<th>{% trans "Lesson Topic" %}</th>
<td>{{ period.get_lesson_documentation.topic }}</td>
</tr>
</table>
</a>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
</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