diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html b/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html index 798797354f17a2729f6e5eb14378a2fafe985eed..c18a7947105341935642a734673d9dad34ad01e8 100644 --- a/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html +++ b/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html @@ -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>