diff --git a/qgis-app/models/templatetags/resources_utils.py b/qgis-app/models/templatetags/resources_utils.py index 68a88e0..b7cca01 100755 --- a/qgis-app/models/templatetags/resources_utils.py +++ b/qgis-app/models/templatetags/resources_utils.py @@ -97,6 +97,13 @@ def get_sustaining_members_section(): except requests.RequestException as e: return f"Error: {e}" +@register.simple_tag +def get_navigation_menu(): + """ + Get the navigation menu from the settings + """ + return settings.NAVIGATION_MENU + @register.filter def get_string_tags(tags): """ diff --git a/qgis-app/settings_docker.py b/qgis-app/settings_docker.py index c24126b..f664d24 100644 --- a/qgis-app/settings_docker.py +++ b/qgis-app/settings_docker.py @@ -169,4 +169,63 @@ 'BUNDLE_DIR_NAME': 'bundles', 'STATS_FILE': os.path.join(SITE_ROOT, 'webpack-stats.json'), } -} \ No newline at end of file +} +# Set the navigation menu +NAVIGATION_MENU = [ + { + 'name': 'QGIS Hub Home', + 'url': '/', + 'icon': 'fa-house', + 'order': 0, + }, + { + 'name': 'Hub', + 'url': '#', + 'icon': 'fa-cubes', + 'order': 1, + 'submenu': [ + { + 'name': 'Styles', + 'url': '/styles', + 'icon': 'fa-paint-brush', + 'order': 1, + }, + { + 'name': 'Projects', + 'url': '/geopackages', + 'icon': 'fa-folder-open', + 'order': 2, + }, + { + 'name': 'Models', + 'url': '/models', + 'icon': 'fa-cogs', + 'order': 3, + }, + { + 'name': '3D Models', + 'url': '/wavefronts', + 'icon': 'fa-cube', + 'order': 4, + }, + { + 'name': 'QLR', + 'url': '/layerdefinitions', + 'icon': 'fa-layer-group', + 'order': 5, + } + ] + }, + { + 'name': 'API', + 'url': '/api/v1/resources/', + 'icon': 'fa-code', + 'order': 2, + }, + { + 'name': 'Metrics', + 'url': METABASE_DOWNLOAD_STATS_URL, + 'icon': 'fa-chart-bar', # Changed to a more accurate icon + 'order': 4, + } +] \ No newline at end of file diff --git a/qgis-app/static/style/scss/bulma/components/sidebar.sass b/qgis-app/static/style/scss/bulma/components/sidebar.sass index 474daa9..7602ee6 100644 --- a/qgis-app/static/style/scss/bulma/components/sidebar.sass +++ b/qgis-app/static/style/scss/bulma/components/sidebar.sass @@ -6,7 +6,7 @@ .sidebar position: sticky overflow-y: scroll // TODO: unnecessary scroll on mobile and FF windows - top: 100px + top: 125px max-height: calc(100vh - 175px) padding-bottom: 30px &::-webkit-scrollbar diff --git a/qgis-app/templates/layouts/header.html b/qgis-app/templates/layouts/header.html index dd4722d..df4f2ba 100644 --- a/qgis-app/templates/layouts/header.html +++ b/qgis-app/templates/layouts/header.html @@ -1,4 +1,4 @@ -{% load i18n simplemenu_tags static %} +{% load i18n simplemenu_tags resources_utils static %}