Skip to content

Commit

Permalink
a4-polls: create info box for unregistered users
Browse files Browse the repository at this point in the history
  • Loading branch information
hom3mad3 committed Dec 11, 2024
1 parent 8c8061b commit 5adc3b6
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 16 deletions.
21 changes: 21 additions & 0 deletions adhocracy-plus/assets/scss/components/_info_box.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions adhocracy-plus/assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% block module_description %}
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
<section class="row">
<div class="col-md-8 offset-md-2 mb-3">
<header>
<h2>{{ module.name }}</h2>
</header>
{% include "a4polls/includes/unregistered-users-info-box.html" %}
<p>{{ module.description }}</p>
</div>
</section>
{% endif %}
{% endblock module_description %}
7 changes: 1 addition & 6 deletions adhocracy-plus/templates/a4modules/module_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,9 @@ <h1 class="project-header__title">{{ project.name }}</h1>
</li>
</ul>
</nav>
{% block module_description %}
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
<h1 class="project-header__title">{{ module.name }}</h1>
<p class="project-header__description">{{ module.description }}</p>
{% endif %}
{% endblock %}
</div>
</div>
{% include "a4modules/includes/module_description.html" %}
{% block phase_info %}
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
{% if not module.active_phase %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% load i18n static settings %}
{% settings_value "APLUS_MANUAL_URL" as manual_url %}

{% if poll.allow_unregistered_users %}
<aside class="info-box" aria-labelledby="info-box-title">
<h3 class="visually-hidden" id="info-box-title">{% translate "Poll Participation Info" %}</h3>
<div class="info-box__content">
<i class="far fa-lightbulb" aria-hidden="true"></i>
<div class="info-box__text">
{% blocktrans %}
<p>You can now participate in this poll even if you're not logged in.</p>
<p><strong>Unregistered users can't edit their votes once submitted.</strong></p>
{% endblocktrans %}
{% if manual_url %}
<a href="{{ manual_url }}/{{ LANGUAGE_CODE }}:quickstart:faq:registration:poll" rel="nofollow noopener noreferrer external" target="_blank" class="info-box__link" aria-label="Learn more about the voting options and rules">{% translate "Learn more about voting options." %}</a>
{% endif %}
</div>
</div>
</aside>
{% endif %}
11 changes: 1 addition & 10 deletions apps/projects/templates/a4_candy_projects/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,7 @@ <h2>{{ event.name }}</h2>
</div>

{% else %} <!-- if just one module and no phase view to dispatch to -->
<div class="row">
<div class="col-md-8 offset-md-2 mb-3">
{% block module_description %}
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
<h1 class="project-header__title">{{ module.name }}</h1>
<p class="project-header__description">{{ module.description }}</p>
{% endif %}
{% endblock %}
</div>
</div>
{% include "a4modules/includes/module_description.html" %}
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
{% if not module.active_phase %}
<div class="row">
Expand Down
3 changes: 3 additions & 0 deletions changelog/8499.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added
- info-box on poll for unregistered users
- module_description snippet with fixed semantics

0 comments on commit 5adc3b6

Please sign in to comment.