Added a MENU_INDEX property to the app settings py file for apps to specify where they should appear in the top nav.
@@ -16,3 +16,4 @@
DJANGO_APPS = [ "about" ]
NICE_NAME = "About"
REQUIRES_HADOOP = False
+MENU_INDEX = 80
@@ -17,3 +17,4 @@ DJANGO_APPS = [ "beeswax" ]
NICE_NAME = "Beeswax (Hive UI)"
REQUIRES_HADOOP = True
ICON = "/beeswax/static/art/beeswax-logo.png"
+MENU_INDEX = 10
@@ -19,3 +19,4 @@ DJANGO_APPS = ['filebrowser']
NICE_NAME = "File Browser"
ICON = "/filebrowser/static/art/icon.png"
+MENU_INDEX = 20
@@ -17,3 +17,4 @@ DJANGO_APPS = ['help']
NICE_NAME = "Help"
ICON = "/help/static/art/help.png"
+MENU_INDEX = 90
@@ -22,3 +22,4 @@ DJANGO_APPS = ['jobbrowser']
NICE_NAME = "Job Browser"
ICON = "/jobbrowser/static/art/icon_large.png"
+MENU_INDEX = 30
@@ -22,3 +22,4 @@ MIDDLEWARE_CLASSES=[
]
ICON = "/jobsub/static/art/icon.png"
+MENU_INDEX = 40
@@ -24,3 +24,4 @@ PERMISSION_ACTIONS = (
)
ICON = "/shell/static/art/shell.png"
+MENU_INDEX = 50
DJANGO_APPS = [ "useradmin" ]
NICE_NAME = "User Admin"
+MENU_INDEX = 60
@@ -15,3 +15,4 @@
# limitations under the License.
DJANGO_APPS = [ "${app_name}" ]
+MENU_INDEX = 100
@@ -119,6 +119,11 @@ class DesktopModuleInfo(object):
else:
self.icon_path = ""
+ if hasattr(self.settings, "MENU_INDEX"):
+ self.menu_index = self.settings.MENU_INDEX
+ else:
+ self.menu_index = 999
+
if self.config_key is not None:
self.display_name = self.config_key
@@ -264,8 +264,10 @@ def commonheader(title, section, padding="60px"):
"""
Returns the rendered common header
+ apps_list = sorted(appmanager.DESKTOP_APPS[:], key=lambda app: app.menu_index)
return render_to_string("common_header.html", dict(
- apps=appmanager.DESKTOP_APPS,
+ apps=apps_list,
title=title,
section=section,
padding=padding