diff --git a/apps/main/api.py b/apps/main/api.py index 3e29269d47..ed27b8a49d 100644 --- a/apps/main/api.py +++ b/apps/main/api.py @@ -1,8 +1,11 @@ +from django.core.urlresolvers import reverse + diagnostics = {} def register_diagnostic(namespace, title, link): namespace_dict = diagnostics.get(namespace, {'title': None, 'links': []}) namespace_dict['title'] = title + link['url'] = link.get('url', reverse(link['view'])) namespace_dict['links'].append(link) diagnostics[namespace] = namespace_dict diff --git a/apps/navigation/templates/generic_navigation.html b/apps/navigation/templates/generic_navigation.html index 49043d9e7d..0ddd529491 100644 --- a/apps/navigation/templates/generic_navigation.html +++ b/apps/navigation/templates/generic_navigation.html @@ -2,17 +2,17 @@ {% for link in object_navigation_links %} -{% if link.permissions %} - {% check_permissions request.user link.permissions.namespace link.permissions.permissions %} - {% if permission %} + {% if link.permissions %} + {% check_permissions request.user link.permissions.namespace link.permissions.permissions %} + {% if permission %} + {% if as_li %}
  • {% endif %} + {% if link.famfam %}{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active %}{% endif %}{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %} + {% if as_li %}
  • {% endif %} + {% endif %} + {% else %} {% if as_li %}
  • {% endif %} {% if link.famfam %}{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active %}{% endif %}{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %} {% if as_li %}
  • {% endif %} {% endif %} -{% else %} - {% if as_li %}
  • {% endif %} - {% if link.famfam %}{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active %}{% endif %}{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %} - {% if as_li %}
  • {% endif %} -{% endif %} {% endfor %}