From abfc8b0c090d7f627128040a7f6068ba38188767 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 29 Nov 2018 04:17:53 -0400 Subject: [PATCH] Navigation: Add list facet menu Add the new list facet navigation menu. Used to provide facets to the list subtemplate. The list facet allows separating the object action links from the object navigation links. The list facet links are displayed before the list object links on the list subtemplate. In the object views, the list facet menu behaves exactly the same as the form facet menu. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ .../appearance/templates/appearance/base.html | 2 +- .../appearance/generic_list_subtemplate.html | 8 +++++ .../navigation/generic_link_instance.html | 4 +-- .../navigation/generic_navigation.html | 2 ++ mayan/apps/common/menus.py | 8 +++-- mayan/apps/document_indexing/apps.py | 14 +++++--- mayan/apps/document_indexing/icons.py | 1 + mayan/apps/document_indexing/links.py | 8 +++-- mayan/apps/document_states/apps.py | 29 ++++++++++++---- mayan/apps/document_states/icons.py | 17 +++------- mayan/apps/document_states/links.py | 11 ++++--- mayan/apps/documents/apps.py | 17 ++++++---- mayan/apps/documents/icons.py | 1 + mayan/apps/documents/links.py | 13 ++++---- mayan/apps/events/apps.py | 10 +++--- mayan/apps/events/icons.py | 2 +- mayan/apps/events/links.py | 6 ++-- mayan/apps/linking/apps.py | 14 +++++--- mayan/apps/linking/links.py | 16 +++++---- mayan/apps/mailer/apps.py | 19 +++++++---- mayan/apps/mailer/views.py | 2 +- mayan/apps/metadata/apps.py | 25 ++++++++------ mayan/apps/metadata/icons.py | 1 + mayan/apps/metadata/links.py | 14 +++++--- mayan/apps/motd/apps.py | 13 ++++++-- mayan/apps/permissions/apps.py | 15 ++++++--- mayan/apps/permissions/icons.py | 1 + mayan/apps/permissions/links.py | 11 ++++--- mayan/apps/smart_settings/apps.py | 7 ++-- mayan/apps/sources/apps.py | 14 ++++++-- mayan/apps/sources/links.py | 5 +-- mayan/apps/tags/apps.py | 33 +++++++++++-------- mayan/apps/tags/links.py | 14 ++++---- mayan/apps/user_management/apps.py | 22 ++++++++++--- mayan/apps/user_management/icons.py | 2 ++ mayan/apps/user_management/links.py | 9 +++-- mayan/apps/user_management/views.py | 1 + 38 files changed, 256 insertions(+), 137 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 36362730b2..8b064b48dd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -103,6 +103,8 @@ The settings WORKFLOWS_IMAGE_CACHE_TIME, WORKFLOWS_IMAGE_CACHE_STORAGE_BACKEND, WORKFLOWS_IMAGE_CACHE_STORAGE_BACKEND_ARGUMENTS we added. +- Added new list facet navigation menu. Used to provide facets + to the setup menu items. 3.1.9 (2018-11-01) diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index ed08e66723..e3eede276d 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -38,7 +38,7 @@ {% get_menus_links names='object menu,sidebar menu,secondary menu' sort_results=True as links %} - {% get_menu_links 'object facet' sort_results=True as form_navigation_links %} + {% get_menus_links names='object facet,object list facet' sort_results=True as form_navigation_links %}
{% if links or form_navigation_links %} diff --git a/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html index 8b05503c3a..8e84743df2 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html @@ -96,6 +96,14 @@ {% endfor %} {% if not hide_links %} + {% get_menu_links 'object list facet' sort_results=True source=object as resolved_links %} + {% for object_navigation_links in resolved_links %} + {% with 'true' as horizontal %} + {% with 'true' as hide_icon %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endfor %} {% get_menu_links 'object menu' source=object as resolved_links %} {% for object_navigation_links in resolved_links %} {% with 'true' as horizontal %} diff --git a/mayan/apps/appearance/templates/navigation/generic_link_instance.html b/mayan/apps/appearance/templates/navigation/generic_link_instance.html index ae37c959ee..8c82ae6bf3 100644 --- a/mayan/apps/appearance/templates/navigation/generic_link_instance.html +++ b/mayan/apps/appearance/templates/navigation/generic_link_instance.html @@ -4,10 +4,10 @@ {% else %} {% if link.disabled %} - {% if link.icon %}{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} + {% if link.icon %}{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} {% else %}