From 2c3e2e2befc0623fa43ce5ab12efc629d19ad766 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 24 Dec 2018 19:15:20 -0400 Subject: [PATCH] Shorten and reorganize menu names Change the left hand side menu designation to be the 'main' menu from 'sidebar', the menu at the top goes from 'main' to 'topside'. All menus are referenced by their name only and the fragment 'menu' is dropped from all as it is obvious that they are menus and the Menu class doesn't supply any other kind of object. Signed-off-by: Roberto Rosario --- .../appearance/templates/appearance/base.html | 4 +- .../generic_list_items_subtemplate.html | 2 +- .../appearance/generic_list_subtemplate.html | 4 +- .../templates/appearance/menu_main.html | 100 ++++++++++++------ .../templates/appearance/menu_sidebar.html | 70 ------------ .../templates/appearance/menu_topbar.html | 40 +++++++ .../appearance/templates/appearance/root.html | 18 ++-- mayan/apps/common/apps.py | 2 +- mayan/apps/common/menus.py | 24 ++--- .../templatetags/navigation_tags.py | 2 +- 10 files changed, 135 insertions(+), 131 deletions(-) delete mode 100644 mayan/apps/appearance/templates/appearance/menu_sidebar.html create mode 100644 mayan/apps/appearance/templates/appearance/menu_topbar.html diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index 3e17106687..e983c5cc1b 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -37,8 +37,8 @@ - {% get_menus_links names='object menu,sidebar menu,secondary menu' sort_results=True as links %} - {% get_menus_links names='object facet,object list facet' sort_results=True as form_navigation_links %} + {% get_menus_links names='object,sidebar,secondary' sort_results=True as links %} + {% get_menus_links names='facet,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_items_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html index 5544d43f1b..d9f8926fb7 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html @@ -99,7 +99,7 @@ {% endfor %} {% if not hide_links %} - {% get_menus_links 'object list facet,object menu' source=object as links %} + {% get_menus_links names='list facet,object' source=object as links %} - -
- +{% load common_tags %} +{% load navigation_tags %} + +{% spaceless %} +
+ {% get_menu_links name='main' as menu_links %} + {% for link_set in menu_links %} + {% for link in link_set %} + {% with 'true' as as_li %} + {% with 'true' as hide_active_anchor %} + {% with 'active' as li_class_active %} + {% with 'first' as li_class_first %} + {% with ' ' as link_classes %} + + {% if link|get_type == "" %} +
+ +
+
+
    + {% get_menu_links name=link.name as menu_links %} + {% for linkset in menu_links %} + {% with '' as li_class_active %} + {% with linkset as object_navigation_links %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endfor %} +
+
+
+
+ {% else %} + +
+ +
+ + {% endif %} + + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} + {% endfor %} +
+{% endspaceless %} diff --git a/mayan/apps/appearance/templates/appearance/menu_sidebar.html b/mayan/apps/appearance/templates/appearance/menu_sidebar.html deleted file mode 100644 index 3cefb9353c..0000000000 --- a/mayan/apps/appearance/templates/appearance/menu_sidebar.html +++ /dev/null @@ -1,70 +0,0 @@ -{% load i18n %} - -{% load navigation_tags %} -{% load smart_settings_tags %} - -{% load common_tags %} -{% load navigation_tags %} - -
- {% get_menu_links 'main menu' as menu_links %} - {% for link_set in menu_links %} - {% for link in link_set %} - {% with 'true' as as_li %} - {% with 'true' as hide_active_anchor %} - {% with 'active' as li_class_active %} - {% with 'first' as li_class_first %} - {% with ' ' as link_classes %} - - {% if link|get_type == "" %} -
- -
-
-
    - {% get_menu_links link.name as menu_links %} - {% for linkset in menu_links %} - {% with '' as li_class_active %} - {% with linkset as object_navigation_links %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endfor %} -
-
-
-
- {% else %} - -
- -
- - {% endif %} - - {% endwith %} - {% endwith %} - {% endwith %} - {% endwith %} - {% endwith %} - {% endfor %} - {% endfor %} -
diff --git a/mayan/apps/appearance/templates/appearance/menu_topbar.html b/mayan/apps/appearance/templates/appearance/menu_topbar.html new file mode 100644 index 0000000000..f4ed933c7d --- /dev/null +++ b/mayan/apps/appearance/templates/appearance/menu_topbar.html @@ -0,0 +1,40 @@ +{% load i18n %} + +{% load navigation_tags %} +{% load smart_settings_tags %} + +{% spaceless %} + +{% endspaceless %} diff --git a/mayan/apps/appearance/templates/appearance/root.html b/mayan/apps/appearance/templates/appearance/root.html index 78a5fa39aa..d16a88a257 100644 --- a/mayan/apps/appearance/templates/appearance/root.html +++ b/mayan/apps/appearance/templates/appearance/root.html @@ -33,12 +33,12 @@ {% if appearance_type == 'plain' %} {% block content_plain %}{% endblock %} {% else %} -