Commit e2dcefc6b4ed4ac4452458ec1a1ec0178a2321ec
1 parent
1c8a523a
Exists in
master
and in
5 other branches
Forum breadcrumbs #356
Showing
3 changed files
with
8 additions
and
14 deletions
Show diff stats
courses/templates/topic/index.html
forum/templates/forum/forum_view.html
1 | -{% extends 'home.html' %} | |
1 | +{% extends 'topic/index.html' %} | |
2 | 2 | |
3 | -{% load static i18n permission_tags list_post %} | |
3 | +{% load static i18n permission_tags list_post django_bootstrap_breadcrumbs %} | |
4 | 4 | {% load widget_tweaks %} |
5 | 5 | |
6 | 6 | {% block javascript %} |
... | ... | @@ -8,17 +8,8 @@ |
8 | 8 | {% endblock %} |
9 | 9 | |
10 | 10 | {% block breadcrumbs %} |
11 | - | |
12 | - <ol class="breadcrumb"> | |
13 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | |
14 | - <li><a href="{% url 'course:view' forum.topic.subject.course.slug %}">{{ forum.topic.subject.course }}</a></li> | |
15 | - {% if user|has_role:'professor' or user|has_role:'system_admin' %} | |
16 | - <li class="active">{% trans 'Forum' %}</li> | |
17 | - {% else %} | |
18 | - <li class="active">{{ forum.name }}</li> | |
19 | - {% endif %} | |
20 | - | |
21 | - </ol> | |
11 | + {{ block.super }} | |
12 | + {% breadcrumb forum 'course:forum:view' forum.slug %} | |
22 | 13 | {% endblock %} |
23 | 14 | |
24 | 15 | ... | ... |
forum/views.py
... | ... | @@ -245,6 +245,9 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView): |
245 | 245 | context['form'] = PostForm() |
246 | 246 | context['forum'] = forum |
247 | 247 | context['title'] = forum.name |
248 | + context['course'] = forum.topic.subject.course | |
249 | + context['subject'] = forum.topic.subject | |
250 | + context['topic'] = forum.topic | |
248 | 251 | |
249 | 252 | return context |
250 | 253 | ... | ... |