Changeset - c8d79d2d0e3e
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 6 years ago 2017-12-22 10:41:15
branko@majic.rs
CONNT-25: Updated change_list.html admin template:

- Enclose the object-tools-items block content with a permission
check, same as in current version of Django Admin (1.11.x).
- URL generation has _not_ been brought up to date.
1 file changed with 8 insertions and 6 deletions:
0 comments (0 inline, 0 general)
conntrackt/templates/admin/conntrackt/communication/change_list.html
Show inline comments
 
{% extends "admin/change_list.html" %}
 
{% load i18n admin_static admin_list %}
 
{% load admin_urls %}
 

	
 
{% block object-tools-items %}
 
            <li>
 
              {# Add the GET parameters from the admin's filter to 'Add entity' button #}
 
              {# so we can perform some filtering on source/destination interfaces. #}
 
              <a href="{% url cl.opts|admin_urlname:'add' %}?{% if is_popup %}_popup=1{% endif %}{% if 'location' in cl.params %}&amp;location={{ cl.params.location }}{% endif %}{% if 'project' in cl.params %}&amp;project={{ cl.params.project }}{% endif %}" class="addlink">
 
    {% if has_add_permission %}
 
        <li>
 
            {# Add the GET parameters from the admin's filter to 'Add entity' button #}
 
            {# so we can perform some filtering on source/destination interfaces. #}
 
            <a href="{% url cl.opts|admin_urlname:'add' %}?{% if is_popup %}_popup=1{% endif %}{% if 'location' in cl.params %}&amp;location={{ cl.params.location }}{% endif %}{% if 'project' in cl.params %}&amp;project={{ cl.params.project }}{% endif %}" class="addlink">
 
                {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
 
              </a>
 
            </li>
 
            </a>
 
        </li>
 
    {% endif %}
 
{% endblock %}
 

	
0 comments (0 inline, 0 general)