Skip to content
Snippets Groups Projects
Verified Commit 8040b573 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/10-button-create-live-document-does-nothing' into 9-poster-group-not-showing-up-in-menu
parents c7062ff2 82582c6c
Branches 9-poster-group-not-showing-up-in-menu
No related tags found
1 merge request!37Resolve "Poster group not showing up in menu"
Pipeline #65985 failed
......@@ -19,6 +19,7 @@ Fixed
* Live documents table showed two "Actions" columns.
* Menu was not correctly re-generated after creating or editing poster groups
* 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 document_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 document_types %}
<li>
<a href="{% url 'create_live_document' ct.app_label ct.model %}">
{% verbose_name_object model as document_name %}
{% blocktrans with name=document_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 %}
......@@ -160,7 +160,7 @@ class LiveDocumentListView(PermissionRequiredMixin, SingleTableView):
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context = super().get_context_data(**kwargs)
context["widget_types"] = [
context["document_types"] = [
(ContentType.objects.get_for_model(m, False), m) for m in LiveDocument.__subclasses__()
]
return context
......
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