Display action dropdown only if there are links

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-26 05:58:26 -04:00
parent 49c9fbbce1
commit fe2cf70d93
@@ -86,28 +86,30 @@
{% if not hide_links %} {% if not hide_links %}
{% get_menus_links names='list facet,object' source=object as links %} {% get_menus_links names='list facet,object' source=object as links %}
<div class="dropdown text-center"> {% if links %}
<button aria-expanded="false" aria-haspopup="true" class="btn btn-default btn-danger btn-sm dropdown-toggle" data-toggle="dropdown"> <div class="dropdown text-center">
{% trans 'Actions' %} <button aria-expanded="false" aria-haspopup="true" class="btn btn-default btn-danger btn-sm dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> {% trans 'Actions' %}
<span class="sr-only">{% trans 'Toggle Dropdown' %}</span> <span class="caret"></span>
</button> <span class="sr-only">{% trans 'Toggle Dropdown' %}</span>
<ul class="dropdown-menu" role="menu"> </button>
{% for object_navigation_links in links %} <ul class="dropdown-menu" role="menu">
{% with 'true' as as_li %} {% for object_navigation_links in links %}
{% with 'true' as hide_active_anchor %} {% with 'true' as as_li %}
{% with 'btn-sm' as link_classes %} {% with 'true' as hide_active_anchor %}
{% include 'navigation/generic_navigation.html' %} {% with 'btn-sm' as link_classes %}
{% endwith %} {% include 'navigation/generic_navigation.html' %}
{% endwith %} {% endwith %}
{% endwith %} {% endwith %}
{% endwith %}
{% if not forloop.last and object_navigation_links %} {% if not forloop.last and object_navigation_links %}
<li class="divider"></li> <li class="divider"></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>