From 6dbc82edc6274744dd9559a8b6575c2256fead5f Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Wed, 9 Feb 2022 16:28:05 +0100 Subject: [PATCH] frontend: header size for shared organisation * Closes #641. Co-Authored-by: Bertrand Zuchuat --- sonar/ext.py | 6 ++++-- sonar/theme/templates/sonar/frontpage.html | 6 ++++-- sonar/theme/templates/sonar/partial/navbar.html | 10 +++++----- sonar/theme/templates/sonar/partial/organisation.html | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sonar/ext.py b/sonar/ext.py index 7435bcb7..1f49d230 100644 --- a/sonar/ext.py +++ b/sonar/ext.py @@ -114,10 +114,12 @@ def init_views(self, app): """Initialize the main flask views.""" app.url_map.converters['org_code'] = OrganisationCodeConverter - @app.route('/') + @app.route('/', defaults={ + 'view': app.config.get('SONAR_APP_DEFAULT_ORGANISATION')}) + @app.route('//') def index(view): """Homepage.""" - return render_template('sonar/frontpage.html') + return render_template('sonar/frontpage.html', view=view) @app.template_filter() def nl2br(string): diff --git a/sonar/theme/templates/sonar/frontpage.html b/sonar/theme/templates/sonar/frontpage.html index c9985880..166a17de 100755 --- a/sonar/theme/templates/sonar/frontpage.html +++ b/sonar/theme/templates/sonar/frontpage.html @@ -16,19 +16,20 @@ . #} -{% set page = 'home' %} +{% set page = 'organisation' if g.get('organisation') and g.get('organisation')['isShared'] and not g.get('organisation')['isDedicated'] else 'home' %} {%- extends config.BASE_TEMPLATE %} {%- set body_css_classes=['homepage'] %} {% block header %} +{%- if not g.get('organisation') or (g.get('organisation') and g.organisation['isShared'] and g.organisation['isDedicated']) %}
+{%- endif %}