templates: fix OU link in role pages breadcrumb (#54201)
This commit is contained in:
parent
0f848ec694
commit
332f3c9575
|
@ -144,6 +144,11 @@ export = RolesExportView.as_view()
|
||||||
class RoleViewMixin(RolesMixin):
|
class RoleViewMixin(RolesMixin):
|
||||||
model = get_role_model()
|
model = get_role_model()
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
ctx = super().get_context_data(**kwargs)
|
||||||
|
ctx['ou'] = self.get_object().ou
|
||||||
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
class RoleEditView(RoleViewMixin, views.BaseEditView):
|
class RoleEditView(RoleViewMixin, views.BaseEditView):
|
||||||
template_name = 'authentic2/manager/role_edit.html'
|
template_name = 'authentic2/manager/role_edit.html'
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
{% block breadcrumb %}
|
{% block breadcrumb %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
<a href="{% url 'a2-manager-roles' %}">{% trans 'Roles' %}</a>
|
<a href="{% url 'a2-manager-roles' %}">{% trans 'Roles' %}</a>
|
||||||
{% firstof ou object.ou as current_ou %}
|
{% if multiple_ou and ou %}
|
||||||
{% if multiple_ou and current_ou %}
|
<a href="{% url 'a2-manager-roles' %}?search-ou={{ ou.pk }}">{{ ou }}</a>
|
||||||
<a href="{% url 'a2-manager-roles' %}?search-ou={{ current_ou.id }}">{{ current_ou }}</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue