diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_nav.html | 32 | ||||
-rw-r--r-- | ishtar_common/templatetags/window_header.py | 7 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 |
3 files changed, 33 insertions, 8 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index 90d58d605..62caff142 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -57,15 +57,33 @@ </a> {% endfor %} </div> + <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Export' %}"> - <a class="btn btn-secondary" href='{% url show_url item.pk "odt" %}' - title='{% trans "Export as OpenOffice.org file"%}'> - ODT <i class="fa fa-file-word-o" aria-hidden="true"></i> - <a class="btn btn-secondary" href='{% url show_url item.pk "pdf" %}' - title='{% trans "Export as PDF file"%}'> - PDF <i class="fa fa-file-pdf-o" aria-hidden="true"></i> - </a> + <div class="dropdown btn-secondary"> + <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" + id="dropdown-sheet-export-{{window_id}}" + data-toggle="dropdown"aria-haspopup="true" + aria-expanded="false"> + <i class="fa fa-file-word-o"></i> {% trans "Export" %} + </button> + <div class="dropdown-menu" + aria-labelledby="dropdown-sheet-export-{{window_id}}"> + <a class="dropdown-item" href='{% url show_url item.pk "odt" %}' + title='{% trans "Export as OpenOffice.org file"%}'> + ODT <i class="fa fa-file-word-o" aria-hidden="true"></i> + </a> + <a class="dropdown-item" href='{% url show_url item.pk "pdf" %}' + title='{% trans "Export as PDF file"%}'> + PDF <i class="fa fa-file-pdf-o" aria-hidden="true"></i> + </a>{% for template_name, template_url in extra_templates %} + <a class="dropdown-item" href='{{template_url}}'> + {{template_name}} <i class="fa fa-file-word-o" aria-hidden="true"></i> + </a>{% endfor %} + </div> + </div> + + </div> </div> </div> diff --git a/ishtar_common/templatetags/window_header.py b/ishtar_common/templatetags/window_header.py index e6325d3fb..bbd923d41 100644 --- a/ishtar_common/templatetags/window_header.py +++ b/ishtar_common/templatetags/window_header.py @@ -10,6 +10,9 @@ def window_nav(context, item, window_id, show_url, modify_url='', histo_url='', extra_actions = [] if hasattr(item, 'get_extra_actions'): extra_actions = item.get_extra_actions(context['request']) + extra_templates = [] + if hasattr(item, 'get_extra_templates'): + extra_templates = item.get_extra_templates(context['request']) slug = None if hasattr(item, "LONG_SLUG"): @@ -29,7 +32,9 @@ def window_nav(context, item, window_id, show_url, modify_url='', histo_url='', 'previous': previous, 'next': nxt, 'extra_actions': extra_actions, - 'pin_action': pin_action} + 'pin_action': pin_action, + 'extra_templates': extra_templates, + } @register.inclusion_tag('ishtar/blocks/window_find_nav.html', diff --git a/ishtar_common/views.py b/ishtar_common/views.py index bc9c9432a..f23116d21 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -2001,3 +2001,5 @@ class QAItemEditForm(QAItemForm): def form_save(self, form): form.save(self.items, self.request.user) return HttpResponseRedirect(reverse("success")) + + |