diff --git a/HISTORY.rst b/HISTORY.rst index a10dc066fc..6632a726ba 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -108,6 +108,7 @@ - The multiple document action dropdown is now sorted alphabetically. - Improve statistics subclassing. Split class module into classes and renderers. +- Sort facet link, object, secondady and sidebar actions. 3.0.3 (2018-08-17) ================== diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index 6007292e54..86f99de521 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' as links %} - {% get_menu_links 'object facet' as form_navigation_links %} + {% 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 %}
{% if links or form_navigation_links %} diff --git a/mayan/apps/navigation/templatetags/navigation_tags.py b/mayan/apps/navigation/templatetags/navigation_tags.py index d77aada828..85d4503635 100644 --- a/mayan/apps/navigation/templatetags/navigation_tags.py +++ b/mayan/apps/navigation/templatetags/navigation_tags.py @@ -9,16 +9,16 @@ register = Library() @register.simple_tag(takes_context=True) -def get_menu_links(context, name, source=None): - return Menu.get(name).resolve(context=context, source=source) +def get_menu_links(context, name, source=None, sort_results=None): + return Menu.get(name).resolve(context=context, source=source, sort_results=sort_results) @register.simple_tag(takes_context=True) -def get_menus_links(context, names, source=None): +def get_menus_links(context, names, source=None, sort_results=None): result = [] for name in names.split(','): - for links in Menu.get(name=name).resolve(context=context): + for links in Menu.get(name=name).resolve(context=context, sort_results=sort_results): if links: result.append(links)