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
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | 13 | ||
14 | {% block breadcrumbs %} | 14 | {% block breadcrumbs %} |
15 | {{ block.super }} | 15 | {{ block.super }} |
16 | - {% breadcrumb topic.name 'course:view_topic' %} | 16 | + {% breadcrumb topic.name 'course:view_topic' topic.slug %} |
17 | {% endblock %} | 17 | {% endblock %} |
18 | 18 | ||
19 | {% block content %} | 19 | {% block content %} |
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 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
5 | 5 | ||
6 | {% block javascript %} | 6 | {% block javascript %} |
@@ -8,17 +8,8 @@ | @@ -8,17 +8,8 @@ | ||
8 | {% endblock %} | 8 | {% endblock %} |
9 | 9 | ||
10 | {% block breadcrumbs %} | 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 | {% endblock %} | 13 | {% endblock %} |
23 | 14 | ||
24 | 15 |
forum/views.py
@@ -245,6 +245,9 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView): | @@ -245,6 +245,9 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView): | ||
245 | context['form'] = PostForm() | 245 | context['form'] = PostForm() |
246 | context['forum'] = forum | 246 | context['forum'] = forum |
247 | context['title'] = forum.name | 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 | return context | 252 | return context |
250 | 253 |