From b9c037f91462365c73f9e3b49a015920918bf460 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 25 Jul 2018 21:07:47 +0200 Subject: [PATCH] Display the instance admin on the welcome page --- calsocial/__init__.py | 5 ++++- calsocial/templates/_macros.html | 2 +- calsocial/templates/welcome.html | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/calsocial/__init__.py b/calsocial/__init__.py index e56a9cc..f2085bd 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -201,13 +201,16 @@ class CalendarSocialApp(Flask, RoutedMixin): user_count = User.query.count() event_count = Event.query.count() + admin_user = current_app.instance_admin + admin_profile = None if admin_user is None else admin_user.profile return render_template('welcome.html', calendar=calendar, user_only=False, login_form=login_form, user_count=user_count, - event_count=event_count) + event_count=event_count, + admin_profile=admin_profile) @RoutedMixin.route('/') def hello(self): diff --git a/calsocial/templates/_macros.html b/calsocial/templates/_macros.html index b086a06..4c042cb 100644 --- a/calsocial/templates/_macros.html +++ b/calsocial/templates/_macros.html @@ -25,6 +25,6 @@ {% endif %}
{{ profile.display_name }}
-
{{ profile }}
+
{{ profile or '' }}
{% endmacro %} diff --git a/calsocial/templates/welcome.html b/calsocial/templates/welcome.html index 8f3c363..930e3e9 100644 --- a/calsocial/templates/welcome.html +++ b/calsocial/templates/welcome.html @@ -73,8 +73,10 @@
+ {% if admin_profile %}

{% trans %}Administered by{% endtrans %}

- {{ profile_link(none) }} + {{ profile_link(admin_profile) }} + {% endif %}