Skip to content

Commit d4c8e36

Browse files
committed
a4-polls: create info box for unregistered users
1 parent 8c8061b commit d4c8e36

File tree

8 files changed

+481
-460
lines changed

8 files changed

+481
-460
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.info-box {
2+
background-color: $brand-primary-tint;
3+
padding: $spacer;
4+
margin: $spacer 0;
5+
display: flex;
6+
flex-direction: column;
7+
8+
&__content {
9+
display: flex;
10+
align-items: first baseline;
11+
gap: $spacer; // Space between icon and text
12+
13+
p {
14+
margin-bottom: 0;
15+
}
16+
}
17+
18+
&__text {
19+
flex-grow: 1;
20+
}
21+
}

adhocracy-plus/assets/scss/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
@import "components/homepage";
9696
@import "components/homepage_hero";
9797
@import "components/idea_remark";
98+
@import "components/info_box";
9899
@import "components/infographic";
99100
@import "components/item_detail";
100101
@import "components/language_choice";

adhocracy-plus/config/settings/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@
553553

554554
A4_USE_ORGANISATION_TERMS_OF_USE = True
555555

556+
A4_POLL_ENABLE_UNREGISTERED_USERS = True
557+
556558
# Disable CSP by default
557559
CSP_REPORT_ONLY = True
558560
CSP_DEFAULT_SRC = ["'self'", "'unsafe-inline'", "'unsafe-eval'", "data:", "blob:", "*"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% block module_description %}
2+
{% if module.phases.first.type != 'a4_candy_interactive_events:issue' %}
3+
<section class="row">
4+
<div class="col-md-8 offset-md-2 mb-3">
5+
<header>
6+
<h2>{{ module.name }}</h2>
7+
</header>
8+
{% include "a4polls/includes/unregistered-users-info-box.html" %}
9+
<p>{{ module.description }}</p>
10+
</div>
11+
</section>
12+
{% endif %}
13+
{% endblock module_description %}

adhocracy-plus/templates/a4modules/module_detail.html

Lines changed: 171 additions & 179 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% load i18n static settings %}
2+
{% settings_value "APLUS_MANUAL_URL" as manual_url %}
3+
4+
{% if poll.allow_unregistered_users %}
5+
<aside class="info-box" aria-labelledby="info-box-title">
6+
<h3 class="visually-hidden" id="info-box-title">{% translate "Poll Participation Info" %}</h3>
7+
<div class="info-box__content">
8+
<i class="far fa-lightbulb" aria-hidden="true"></i>
9+
<div class="info-box__text">
10+
{% blocktrans %}
11+
<p>You can now participate in this poll even if you're not logged in.</p>
12+
<p><strong>Unregistered users can't edit their votes once submitted.</strong></p>
13+
{% endblocktrans %}
14+
{% if manual_url %}
15+
<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>
16+
{% endif %}
17+
</div>
18+
</div>
19+
</aside>
20+
{% endif %}

apps/projects/templates/a4_candy_projects/project_detail.html

Lines changed: 250 additions & 281 deletions
Large diffs are not rendered by default.

changelog/8499.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Added
2+
- info-box on poll for unregistered users
3+
- module_description snippet with fixed semantics

0 commit comments

Comments
 (0)