From 5adc3b68058ffe068085bd584b276e89474bb4a9 Mon Sep 17 00:00:00 2001 From: hom3mad3 <8156337+hom3mad3@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:29:19 +0100 Subject: [PATCH] a4-polls: create info box for unregistered users --- .../assets/scss/components/_info_box.scss | 21 +++++++++++++++++++ adhocracy-plus/assets/scss/style.scss | 1 + .../includes/module_description.html | 13 ++++++++++++ .../templates/a4modules/module_detail.html | 7 +------ .../includes/unregistered-users-info-box.html | 20 ++++++++++++++++++ .../a4_candy_projects/project_detail.html | 11 +--------- changelog/8499.md | 3 +++ 7 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 adhocracy-plus/assets/scss/components/_info_box.scss create mode 100644 adhocracy-plus/templates/a4modules/includes/module_description.html create mode 100644 adhocracy-plus/templates/a4polls/includes/unregistered-users-info-box.html create mode 100644 changelog/8499.md diff --git a/adhocracy-plus/assets/scss/components/_info_box.scss b/adhocracy-plus/assets/scss/components/_info_box.scss new file mode 100644 index 000000000..682f3b9f8 --- /dev/null +++ b/adhocracy-plus/assets/scss/components/_info_box.scss @@ -0,0 +1,21 @@ +.info-box { + background-color: $brand-primary-tint; + padding: $spacer; + margin: $spacer 0; + display: flex; + flex-direction: column; + + &__content { + display: flex; + align-items: first baseline; + gap: $spacer; // Space between icon and text + + p { + margin-bottom: 0; + } + } + + &__text { + flex-grow: 1; + } +} \ No newline at end of file diff --git a/adhocracy-plus/assets/scss/style.scss b/adhocracy-plus/assets/scss/style.scss index d069cecd2..b4a78d501 100644 --- a/adhocracy-plus/assets/scss/style.scss +++ b/adhocracy-plus/assets/scss/style.scss @@ -95,6 +95,7 @@ @import "components/homepage"; @import "components/homepage_hero"; @import "components/idea_remark"; +@import "components/info_box"; @import "components/infographic"; @import "components/item_detail"; @import "components/language_choice"; diff --git a/adhocracy-plus/templates/a4modules/includes/module_description.html b/adhocracy-plus/templates/a4modules/includes/module_description.html new file mode 100644 index 000000000..90d200c28 --- /dev/null +++ b/adhocracy-plus/templates/a4modules/includes/module_description.html @@ -0,0 +1,13 @@ +{% block module_description %} + {% if module.phases.first.type != 'a4_candy_interactive_events:issue' %} +
+
+
+

{{ module.name }}

+
+ {% include "a4polls/includes/unregistered-users-info-box.html" %} +

{{ module.description }}

+
+
+ {% endif %} +{% endblock module_description %} diff --git a/adhocracy-plus/templates/a4modules/module_detail.html b/adhocracy-plus/templates/a4modules/module_detail.html index cfba41edb..172e567e2 100644 --- a/adhocracy-plus/templates/a4modules/module_detail.html +++ b/adhocracy-plus/templates/a4modules/module_detail.html @@ -107,14 +107,9 @@

{{ project.name }}

- {% block module_description %} - {% if module.phases.first.type != 'a4_candy_interactive_events:issue' %} -

{{ module.name }}

-

{{ module.description }}

- {% endif %} - {% endblock %} + {% include "a4modules/includes/module_description.html" %} {% block phase_info %} {% if module.phases.first.type != 'a4_candy_interactive_events:issue' %} {% if not module.active_phase %} diff --git a/adhocracy-plus/templates/a4polls/includes/unregistered-users-info-box.html b/adhocracy-plus/templates/a4polls/includes/unregistered-users-info-box.html new file mode 100644 index 000000000..acd9601ae --- /dev/null +++ b/adhocracy-plus/templates/a4polls/includes/unregistered-users-info-box.html @@ -0,0 +1,20 @@ +{% load i18n static settings %} +{% settings_value "APLUS_MANUAL_URL" as manual_url %} + +{% if poll.allow_unregistered_users %} + +{% endif %} diff --git a/apps/projects/templates/a4_candy_projects/project_detail.html b/apps/projects/templates/a4_candy_projects/project_detail.html index 49a5f4df5..f9a246265 100644 --- a/apps/projects/templates/a4_candy_projects/project_detail.html +++ b/apps/projects/templates/a4_candy_projects/project_detail.html @@ -196,16 +196,7 @@

{{ event.name }}

{% else %} -
-
- {% block module_description %} - {% if module.phases.first.type != 'a4_candy_interactive_events:issue' %} -

{{ module.name }}

-

{{ module.description }}

- {% endif %} - {% endblock %} -
-
+ {% include "a4modules/includes/module_description.html" %} {% if module.phases.first.type != 'a4_candy_interactive_events:issue' %} {% if not module.active_phase %}
diff --git a/changelog/8499.md b/changelog/8499.md new file mode 100644 index 000000000..82724e84d --- /dev/null +++ b/changelog/8499.md @@ -0,0 +1,3 @@ +### Added +- info-box on poll for unregistered users +- module_description snippet with fixed semantics \ No newline at end of file