From f23d4f4dd17b880bbcd1756b6f787bad43fc060d Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Wed, 2 Aug 2023 23:17:28 +0200 Subject: [PATCH 1/6] [FIX] `base.html` prepared for public views Certain things need to be behind `{% if user.is_authenticated %}` in order for the base template to play nice with public views. --- allianceauth/templates/allianceauth/base.html | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/allianceauth/templates/allianceauth/base.html b/allianceauth/templates/allianceauth/base.html index 2becf3c2..f1142c08 100644 --- a/allianceauth/templates/allianceauth/base.html +++ b/allianceauth/templates/allianceauth/base.html @@ -21,33 +21,39 @@ - {% if user.is_authenticated %} -
- - {% include 'allianceauth/top-menu.html' %} -
+
+ + {% include 'allianceauth/top-menu.html' %} + +
+ {% if user.is_authenticated %} {% include 'allianceauth/side-menu.html' %} -
+ {% endif %} + +
+ {% if user.is_authenticated %} {% include 'allianceauth/messages.html' %} - {% block content %} - {% endblock content %} -
-
+ {% endif %} + + {% block content %} + {% endblock content %}
- {% endif %} +
{% include 'bundles/bootstrap-js.html' %} {% include 'bundles/jquery-visibility-js.html' %} - - {% include 'bundles/refresh-notifications-js.html' %} + {% if user.is_authenticated %} + + {% include 'bundles/refresh-notifications-js.html' %} + {% endif %} {% include 'bundles/evetime-js.html' %} {% block extra_javascript %} From 7290eaad7e2567bc8fc1d8ec91243dc20346aa5b Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Wed, 2 Aug 2023 23:22:14 +0200 Subject: [PATCH 2/6] [FIX] Notifications menu item removed in public views --- allianceauth/templates/allianceauth/top-menu.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/allianceauth/templates/allianceauth/top-menu.html b/allianceauth/templates/allianceauth/top-menu.html index 2b501336..b09a1091 100644 --- a/allianceauth/templates/allianceauth/top-menu.html +++ b/allianceauth/templates/allianceauth/top-menu.html @@ -22,9 +22,12 @@ - + + {% if user.is_authenticated %} + + {% endif %} {% include 'allianceauth/top-menu-user-dropdown.html' %} From 32128ace1cca3d88c958e0977aac353406c10eff Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Wed, 2 Aug 2023 23:35:25 +0200 Subject: [PATCH 3/6] [FIX] Better explanation in `local.py` project template --- .../project_name/settings/local.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/allianceauth/project_template/project_name/settings/local.py b/allianceauth/project_template/project_name/settings/local.py index 1405fbd4..3c978885 100644 --- a/allianceauth/project_template/project_name/settings/local.py +++ b/allianceauth/project_template/project_name/settings/local.py @@ -32,10 +32,16 @@ INSTALLED_APPS += [ # To change the logging level for extensions, uncomment the following line. # LOGGING['handlers']['extension_file']['level'] = 'DEBUG' -# By default apps are prevented from having public views for security reasons. -# If you want to allow specific apps to have public views -# you can put there names here (same name as in INSTALLED_APPS): -APPS_WITH_PUBLIC_VIEWS = [] +# By default, apps are prevented from having public views for security reasons. +# If you want to allow specific apps to have public views, +# you can put their names here (same name as in INSTALLED_APPS). +# +# Note: +# » The format is the same as in INSTALLED_APPS +# » The app developer must explicitly allow public views for his app +APPS_WITH_PUBLIC_VIEWS = [ + +] # Enter credentials to use MySQL/MariaDB. Comment out to use sqlite3 DATABASES['default'] = { From 1563805ddbfeaaebbb697b0c99081c54df345161 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 5 Aug 2023 18:51:12 +0200 Subject: [PATCH 4/6] [ADD] CCP's "No Character" character image as user menu image for public --- allianceauth/static/allianceauth/css/auth-base.css | 2 +- .../templates/allianceauth/top-menu-user-dropdown.html | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/allianceauth/static/allianceauth/css/auth-base.css b/allianceauth/static/allianceauth/css/auth-base.css index 6eb51d8e..b2b18aa5 100644 --- a/allianceauth/static/allianceauth/css/auth-base.css +++ b/allianceauth/static/allianceauth/css/auth-base.css @@ -122,7 +122,7 @@ ul.list-group.list-group-horizontal > li.list-group-item { padding-top: 0.5rem; } - .navbar-nav > li.top-user-menu.with-main-character a { + .navbar-nav > li.top-user-menu a { padding: 14px; } diff --git a/allianceauth/templates/allianceauth/top-menu-user-dropdown.html b/allianceauth/templates/allianceauth/top-menu-user-dropdown.html index 2c9760be..99d29e5d 100644 --- a/allianceauth/templates/allianceauth/top-menu-user-dropdown.html +++ b/allianceauth/templates/allianceauth/top-menu-user-dropdown.html @@ -11,7 +11,10 @@ {% endwith %} {% else %} - {% translate "User Menu" %} + {{ main.character_name }} + {% endif %} From 8fbe0ba45d31af566d0555bfb797b8ede692e991 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 7 Aug 2023 07:23:21 +0200 Subject: [PATCH 5/6] [CHANGE] Comment --- .../project_template/project_name/settings/local.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/allianceauth/project_template/project_name/settings/local.py b/allianceauth/project_template/project_name/settings/local.py index 3c978885..d83fd718 100644 --- a/allianceauth/project_template/project_name/settings/local.py +++ b/allianceauth/project_template/project_name/settings/local.py @@ -33,12 +33,9 @@ INSTALLED_APPS += [ # LOGGING['handlers']['extension_file']['level'] = 'DEBUG' # By default, apps are prevented from having public views for security reasons. -# If you want to allow specific apps to have public views, -# you can put their names here (same name as in INSTALLED_APPS). -# -# Note: +# To allow specific apps to have public views, add them to APPS_WITH_PUBLIC_VIEWS # » The format is the same as in INSTALLED_APPS -# » The app developer must explicitly allow public views for his app +# » The app developer must also explicitly allow public views for their app APPS_WITH_PUBLIC_VIEWS = [ ] From 55927c6f15b39ad20013b1ec5042b926405db786 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 8 Aug 2023 23:20:43 +0200 Subject: [PATCH 6/6] [FIX] Allow messages also for non-logged-in user to be displayed --- allianceauth/templates/allianceauth/base.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/allianceauth/templates/allianceauth/base.html b/allianceauth/templates/allianceauth/base.html index f1142c08..f82e7124 100644 --- a/allianceauth/templates/allianceauth/base.html +++ b/allianceauth/templates/allianceauth/base.html @@ -31,9 +31,7 @@ {% endif %}
- {% if user.is_authenticated %} - {% include 'allianceauth/messages.html' %} - {% endif %} + {% include 'allianceauth/messages.html' %} {% block content %} {% endblock content %}