Skip to content
Snippets Groups Projects
Verified Commit 86d52443 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Show live document creation button only if usable

parent 6a15c1b7
No related branches found
No related tags found
1 merge request!36Resolve "Button "Create live document" does nothing"
Pipeline #49587 passed
......@@ -14,6 +14,11 @@ Added
* Open poster group menu entries in new tab.
Fixed
~~~~~
* Button for creation of live documents was there even if there weren't any live document types registered.
`2.0`_ - 2021-12-27
-------------------
......
......@@ -9,21 +9,28 @@
{% block page_title %}{% blocktrans %}Live documents{% endblocktrans %}{% endblock %}
{% block content %}
<a class="btn green waves-effect waves-light dropdown-trigger" href="#" data-target="widget-dropdown">
<i class="material-icons left">add</i>
{% trans "Create live document" %}
</a>
{% if widget_types %}
<a class="btn green waves-effect waves-light dropdown-trigger" href="#" data-target="widget-dropdown">
<i class="material-icons left">add</i>
{% trans "Create live document" %}
</a>
<ul id="widget-dropdown" class="dropdown-content">
{% for ct, model in widget_types %}
<li>
<a href="{% url 'create_live_document' ct.app_label ct.model %}">
{% verbose_name_object model as widget_name %}
{% blocktrans with name=widget_name %}Create {{ name }}{% endblocktrans %}
</a>
</li>
{% endfor %}
</ul>
<ul id="widget-dropdown" class="dropdown-content">
{% for ct, model in widget_types %}
<li>
<a href="{% url 'create_live_document' ct.app_label ct.model %}">
{% verbose_name_object model as widget_name %}
{% blocktrans with name=widget_name %}Create {{ name }}{% endblocktrans %}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<figure class="alert primary">
<i class="material-icons left">info</i>
{% trans "There is no app installed which registers any live document types." %}
</figure>
{% endif %}
{% render_table table %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment