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

Fix variable naming in live document list view

parent 86d52443
No related branches found
No related tags found
1 merge request!36Resolve "Button "Create live document" does nothing"
......@@ -9,18 +9,18 @@
{% block page_title %}{% blocktrans %}Live documents{% endblocktrans %}{% endblock %}
{% block content %}
{% if widget_types %}
{% 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 %}
{% for ct, model in document_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 %}
{% verbose_name_object model as document_name %}
{% blocktrans with name=document_name %}Create {{ name }}{% endblocktrans %}
</a>
</li>
{% endfor %}
......
......@@ -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