Rename link 'class' attribute with 'klass' to avoid any conflicts. Fix django_gpg links. Remove 'dont_mark_active', 'conditional_highlight', and 'extra_navigation_links' features. Inject 'resolved_objects' into context before resolving links. Add check for ACLs when there is a resolved object present. Re-add remove_from_query and keep_query support. Use URLNode to resolve link this way the resolver work exactly as Django's {% url %} tag and saves some code duplicity.

This commit is contained in:
Roberto Rosario
2015-04-05 03:24:36 -04:00
parent db340513d0
commit e648975aff
7 changed files with 86 additions and 330 deletions
@@ -1,5 +1,5 @@
{% if link.disabled %}
<a class="{% if link_classes or link.class %}{{ link_classes }} {{ link.class }}{% else %}btn btn-primary btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="{{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %}
<a class="{% if link_classes or link.klass %}{{ link_classes }} {{ link.klass }}{% else %}btn btn-primary btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="{{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %}
{% else %}
<a class="{% if link_classes or link.class %}{{ link_classes }} {{ link.class }}{% else %}btn btn-primary btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" href="{{ link.url }}">{% if link.icon %}<i class="{{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %}
<a class="{% if link_classes or link.klass %}{{ link_classes }} {{ link.klass }}{% else %}btn btn-primary btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" href="{{ link.url }}">{% if link.icon %}<i class="{{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %}
{% endif %}