From 56290335785c6614886ac0756aad24cdb43df374 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 4 Jul 2017 02:06:32 -0400 Subject: [PATCH] Menu reorganization. The "About" menu has been renamed to "System". The "Tools" and "Setup" sub menus, were moved from the "Profile" menu to the "System" menu. The "Profile" menu has been renamed to "User". Signed-off-by: Roberto Rosario --- docs/releases/2.5.rst | 5 ++- .../appearance/static/appearance/css/base.css | 5 +++ .../appearance/templates/appearance/base.html | 35 +------------------ .../navigation/generic_link_instance.html | 6 ++-- .../navigation/generic_subnavigation.html | 2 +- mayan/apps/common/apps.py | 20 +++++++---- mayan/apps/common/menus.py | 6 ++-- mayan/apps/navigation/classes.py | 31 ++++++++++++++-- .../templatetags/navigation_tags.py | 2 +- 9 files changed, 62 insertions(+), 50 deletions(-) diff --git a/docs/releases/2.5.rst b/docs/releases/2.5.rst index e30aa4e11b..3001746eb4 100644 --- a/docs/releases/2.5.rst +++ b/docs/releases/2.5.rst @@ -30,7 +30,10 @@ Other Changes of documents. - Make sure lookup selection widgets also trigger the metadata update checkbox on change. - +- Menu reorganization. The "About" menu has been renamed to "System". The + "Tools" and "Setup" sub menus, were moved from the "Profile" menu to the + "System" menu. The "Profile" menu has been renamed to "User". +- Usability improvements on small displays. Removals diff --git a/mayan/apps/appearance/static/appearance/css/base.css b/mayan/apps/appearance/static/appearance/css/base.css index 245656396d..cf531c2f35 100644 --- a/mayan/apps/appearance/static/appearance/css/base.css +++ b/mayan/apps/appearance/static/appearance/css/base.css @@ -175,3 +175,8 @@ a i { #toast-container > div { opacity: 1; } + +.link-text-span { + padding-left: 10px; + padding-right: 20px; +} diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index d14b29e253..2c20976365 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -59,7 +59,7 @@ {# TODO: don't use hardcoded main:home use settings.LOGIN_REDIRECT_URL #} - {% project_name %}{% if debug %} {% endif %} + {% project_name %} diff --git a/mayan/apps/appearance/templates/navigation/generic_link_instance.html b/mayan/apps/appearance/templates/navigation/generic_link_instance.html index c0ee430a86..bff488dac0 100644 --- a/mayan/apps/appearance/templates/navigation/generic_link_instance.html +++ b/mayan/apps/appearance/templates/navigation/generic_link_instance.html @@ -1,9 +1,11 @@ {% if link.separator %} +{% elif link.text_span %} + {% else %} {% if link.disabled %} - {% if link.icon %} {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} + {% if link.icon %} {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} {% else %} - {% if link.icon %} {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} + {% if link.icon %} {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} {% endif %} {% endif %} diff --git a/mayan/apps/appearance/templates/navigation/generic_subnavigation.html b/mayan/apps/appearance/templates/navigation/generic_subnavigation.html index 321d0a2956..dfbfb97740 100644 --- a/mayan/apps/appearance/templates/navigation/generic_subnavigation.html +++ b/mayan/apps/appearance/templates/navigation/generic_subnavigation.html @@ -5,7 +5,7 @@
  • tag + """ + def __init__(self, *args, **kwargs): + self.icon = None + self.text = kwargs.get('text') + self.view = None + + def resolve(self, *args, **kwargs): + result = ResolvedLink(current_view=None, link=self) + result.context = kwargs.get('context') + result.text_span = True + return result diff --git a/mayan/apps/navigation/templatetags/navigation_tags.py b/mayan/apps/navigation/templatetags/navigation_tags.py index 6d0a2a60f7..97a48ca462 100644 --- a/mayan/apps/navigation/templatetags/navigation_tags.py +++ b/mayan/apps/navigation/templatetags/navigation_tags.py @@ -18,7 +18,7 @@ def get_menus_links(context, names, source=None): result = [] for name in names.split(','): - for links in Menu.get(name=name).resolve(context): + for links in Menu.get(name=name).resolve(context=context): if links: result.append(links)