decidim-initiatives 0.16.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/initiatives/scoped_type.js +13 -10
- data/app/assets/stylesheet/decidim/initiatives/initiatives-votes.css.scss +97 -0
- data/app/cells/decidim/initiatives/initiative_m_cell.rb +1 -1
- data/app/cells/decidim/initiatives_votes/vote/show.erb +29 -0
- data/app/cells/decidim/initiatives_votes/vote_cell.rb +51 -0
- data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +8 -1
- data/app/commands/decidim/initiatives/admin/update_initiative.rb +7 -6
- data/app/commands/decidim/initiatives/admin/update_initiative_answer.rb +76 -0
- data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +17 -1
- data/app/commands/decidim/initiatives/create_initiative.rb +12 -0
- data/app/commands/decidim/initiatives/spawn_committee_request.rb +8 -7
- data/app/commands/decidim/initiatives/validate_mobile_phone.rb +61 -0
- data/app/commands/decidim/initiatives/validate_sms_code.rb +40 -0
- data/app/commands/decidim/initiatives/vote_initiative.rb +23 -7
- data/app/controllers/concerns/decidim/initiatives/needs_initiative.rb +12 -1
- data/app/controllers/decidim/initiatives/admin/answers_controller.rb +46 -0
- data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +31 -5
- data/app/controllers/decidim/initiatives/admin/initiatives_types_controller.rb +1 -0
- data/app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb +20 -0
- data/app/controllers/decidim/initiatives/admin/moderations_controller.rb +16 -0
- data/app/controllers/decidim/initiatives/application_controller.rb +0 -2
- data/app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb +26 -0
- data/app/controllers/decidim/initiatives/committee_requests_controller.rb +4 -1
- data/app/controllers/decidim/initiatives/create_initiative_controller.rb +16 -5
- data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +207 -0
- data/app/controllers/decidim/initiatives/initiative_votes_controller.rb +3 -1
- data/app/controllers/decidim/initiatives/initiatives_type_signature_types_controller.rb +21 -0
- data/app/forms/decidim/initiatives/admin/initiative_answer_form.rb +29 -0
- data/app/forms/decidim/initiatives/admin/initiative_form.rb +25 -7
- data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +14 -0
- data/app/forms/decidim/initiatives/committee_member_form.rb +30 -0
- data/app/forms/decidim/initiatives/initiative_form.rb +5 -0
- data/app/forms/decidim/initiatives/vote_form.rb +151 -0
- data/app/helpers/decidim/initiatives/create_initiative_helper.rb +25 -12
- data/app/helpers/decidim/initiatives/initiative_helper.rb +18 -0
- data/app/models/decidim/initiative.rb +54 -3
- data/app/models/decidim/initiatives_committee_member.rb +1 -0
- data/app/models/decidim/initiatives_type.rb +30 -0
- data/app/permissions/decidim/initiatives/admin/permissions.rb +12 -3
- data/app/permissions/decidim/initiatives/permissions.rb +37 -8
- data/app/queries/decidim/initiatives/admin/admin_users.rb +39 -0
- data/app/services/decidim/initiatives/data_encryptor.rb +26 -0
- data/app/services/decidim/initiatives/dummy_timestamp.rb +22 -0
- data/app/services/decidim/initiatives/pdf_signature_example.rb +121 -0
- data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +23 -0
- data/app/views/decidim/initiatives/admin/answers/edit.html.erb +35 -0
- data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +17 -16
- data/app/views/decidim/initiatives/admin/initiatives/edit.html.erb +10 -3
- data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb +35 -0
- data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +6 -0
- data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +36 -0
- data/app/views/decidim/initiatives/admin/initiatives_types/index.html.erb +2 -0
- data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +3 -3
- data/app/views/decidim/initiatives/create_initiative/finish.html.erb +2 -2
- data/app/views/decidim/initiatives/create_initiative/previous_form.html.erb +2 -2
- data/app/views/decidim/initiatives/create_initiative/promotal_committee.html.erb +3 -3
- data/app/views/decidim/initiatives/create_initiative/select_initiative_type.html.erb +37 -22
- data/app/views/decidim/initiatives/initiative_signatures/_wizard_steps.html.erb +19 -0
- data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +43 -0
- data/app/views/decidim/initiatives/initiative_signatures/finish.html.erb +17 -0
- data/app/views/decidim/initiatives/initiative_signatures/sms_code.html.erb +22 -0
- data/app/views/decidim/initiatives/initiative_signatures/sms_phone_number.html.erb +22 -0
- data/app/views/decidim/initiatives/initiative_signatures/update_buttons_and_counters.js.erb +21 -0
- data/app/views/decidim/initiatives/initiative_votes/update_buttons_and_counters.js.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_author.html.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_interactions.html.erb +11 -0
- data/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +9 -0
- data/app/views/decidim/initiatives/initiatives/_result.html.erb +3 -3
- data/app/views/decidim/initiatives/initiatives/_vote_button.html.erb +39 -18
- data/app/views/decidim/initiatives/initiatives/_vote_cabin.html.erb +9 -9
- data/app/views/decidim/initiatives/initiatives/show.html.erb +12 -12
- data/app/views/decidim/initiatives/initiatives/signature_identities.html.erb +19 -9
- data/app/views/decidim/initiatives/initiatives_type_signature_types/search.html.erb +1 -0
- data/app/views/layouts/decidim/_initiative_creation_header.html.erb +24 -34
- data/app/views/layouts/decidim/_initiative_signature_creation_header.html.erb +27 -0
- data/app/views/layouts/decidim/admin/initiative.html.erb +22 -15
- data/app/views/layouts/decidim/admin/initiatives_votes.pdf.erb +11 -0
- data/app/views/layouts/decidim/initiative_creation.html.erb +15 -3
- data/app/views/layouts/decidim/initiative_signature_creation.html.erb +12 -0
- data/config/initializers/wicked_pdf.rb +23 -0
- data/config/locales/ar-SA.yml +138 -7
- data/config/locales/ca.yml +120 -28
- data/config/locales/cs-CZ.yml +103 -9
- data/config/locales/cs.yml +494 -0
- data/config/locales/de.yml +101 -9
- data/config/locales/en.yml +133 -40
- data/config/locales/es-MX.yml +101 -9
- data/config/locales/es-PY.yml +101 -9
- data/config/locales/es.yml +124 -32
- data/config/locales/eu.yml +101 -9
- data/config/locales/fi-pl.yml +101 -9
- data/config/locales/fi-plain.yml +478 -0
- data/config/locales/fi.yml +117 -25
- data/config/locales/fr.yml +102 -10
- data/config/locales/gl.yml +101 -9
- data/config/locales/hu.yml +102 -10
- data/config/locales/id-ID.yml +100 -9
- data/config/locales/it.yml +101 -9
- data/config/locales/nl.yml +101 -9
- data/config/locales/pl.yml +104 -10
- data/config/locales/pt-BR.yml +101 -9
- data/config/locales/pt.yml +101 -9
- data/config/locales/ru.yml +4 -9
- data/config/locales/sv.yml +101 -9
- data/config/locales/tr-TR.yml +101 -9
- data/config/locales/uk.yml +4 -9
- data/db/migrate/20181212154456_add_collect_extra_user_fields_to_initiatives_types.rb +7 -0
- data/db/migrate/20181212155125_add_online_signature_enabled_to_initiative_type.rb +7 -0
- data/db/migrate/20181212155740_add_extra_fields_legal_information_to_initiatives_types.rb +7 -0
- data/db/migrate/20181213184712_add_min_committee_members_to_initiative_type.rb +7 -0
- data/db/migrate/20181220134322_add_encrypted_metadata_to_decidim_initiatives_votes.rb +7 -0
- data/db/migrate/20181224100803_add_timestamp_to_decidim_initiatives_votes.rb +7 -0
- data/db/migrate/20181224101041_add_hash_id_to_decidim_initiatives_votes.rb +7 -0
- data/db/migrate/20190124170442_add_validate_sms_code_on_votes_to_initiatives_types.rb +7 -0
- data/db/migrate/20190125131847_add_document_number_authorization_handler_to_initiatives_types.rb +7 -0
- data/db/migrate/20190213184301_add_undo_online_signatures_enabled_to_initiatives_types.rb +7 -0
- data/lib/decidim/initiatives.rb +12 -0
- data/lib/decidim/initiatives/admin_engine.rb +12 -0
- data/lib/decidim/initiatives/engine.rb +3 -0
- data/lib/decidim/initiatives/participatory_space.rb +6 -1
- data/lib/decidim/initiatives/test/factories.rb +39 -0
- data/lib/decidim/initiatives/version.rb +1 -1
- metadata +115 -14
- data/app/views/decidim/initiatives/initiatives/_statistics.html.erb +0 -21
- data/app/views/decidim/initiatives/initiatives/_votes_count.html.erb +0 -12
@@ -1,3 +1,4 @@
|
|
1
|
+
<% default_type = available_initiative_types.first %>
|
1
2
|
<% content_for :back_link do %>
|
2
3
|
<%= link_to initiatives_path do %>
|
3
4
|
<%= icon "chevron-left", class: "icon--small" %>
|
@@ -12,28 +13,42 @@
|
|
12
13
|
</div>
|
13
14
|
</div>
|
14
15
|
<br />
|
15
|
-
<
|
16
|
-
<div class="
|
17
|
-
|
18
|
-
<div class="
|
19
|
-
<
|
20
|
-
<
|
21
|
-
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
16
|
+
<div class="row column">
|
17
|
+
<div class="main-container">
|
18
|
+
<div class="row collapse main-container--side-panel">
|
19
|
+
<div class="columns medium-4 large-3">
|
20
|
+
<div class="side-panel">
|
21
|
+
<ul class="tabs vertical side-panel__tabs" id="initiatives-tabs" data-tabs>
|
22
|
+
<% initiative_types_each do |type| %>
|
23
|
+
<li class="tabs-title <%= "is-active" if type == default_type %>">
|
24
|
+
<%= link_to "#initiativeType#{type.id}" do %>
|
25
|
+
<%# Quiero crear un <strong><%= translated_attribute type.title %1></strong> %>
|
26
|
+
<%= t(".choose_html", title: translated_attribute(type.title)) %>
|
27
|
+
<% end %>
|
28
|
+
</li>
|
29
|
+
<% end %>
|
30
|
+
</ul>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="columns medium-8 large-9">
|
34
|
+
<div class="main-container__content">
|
35
|
+
<div class="tabs-content vertical" data-tabs-content="initiatives-tabs">
|
36
|
+
<% initiative_types_each do |type| %>
|
37
|
+
<div class="tabs-panel <%= "is-active" if type == default_type %>" id="<%= "initiativeType#{type.id}" %>">
|
38
|
+
<h2 class="section-heading"><%= translated_attribute(type.title) %></h2>
|
39
|
+
<div>
|
40
|
+
<%= raw translated_attribute type.description %>
|
41
|
+
</div>
|
42
|
+
<br />
|
43
|
+
<%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { id: "new_initiative_#{type.id}", class: "form select-initiative_type-form" }) do |f| %>
|
44
|
+
<%= f.hidden_field :type_id, value: type.id, id: "initiative_type_id_#{ type.id }" %>
|
45
|
+
<%= f.submit t(".select"), class: "button" %>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
<% end %>
|
34
49
|
</div>
|
35
|
-
</
|
50
|
+
</div>
|
36
51
|
</div>
|
37
|
-
|
52
|
+
</div>
|
38
53
|
</div>
|
39
|
-
</
|
54
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="hide-for-large m-bottom">
|
2
|
+
<span class="text-small">
|
3
|
+
<%= t("step", scope: "layouts.decidim.initiative_signature_creation_header", current: (wizard_steps.index(step) + 1), total: wizard_steps.length) %>
|
4
|
+
(<a data-toggle="steps"><%= t("see_steps", scope: "layouts.decidim.initiative_signature_creation_header") %></a>)
|
5
|
+
</span>
|
6
|
+
<ol id="steps" class="wizard__steps steps-toggle is-hidden" data-toggler=".is-hidden">
|
7
|
+
<% wizard_steps.each do |wizard_step| %>
|
8
|
+
<% if step == wizard_step %>
|
9
|
+
<li class="step--active">
|
10
|
+
<%= t(wizard_step, scope: "layouts.decidim.initiative_signature_creation_header") %>
|
11
|
+
</li>
|
12
|
+
<% else %>
|
13
|
+
<li>
|
14
|
+
<%= t(wizard_step, scope: "layouts.decidim.initiative_signature_creation_header") %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</ol>
|
19
|
+
</div>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="callout secondary mb-sm">
|
2
|
+
<p>
|
3
|
+
<%= t ".help" %>
|
4
|
+
</p>
|
5
|
+
</div>
|
6
|
+
<h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
|
7
|
+
|
8
|
+
<%= render partial: "wizard_steps" %>
|
9
|
+
|
10
|
+
<div class="card">
|
11
|
+
<div class="card__content">
|
12
|
+
<%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form user_personal_data_signature_form" }) do |f| %>
|
13
|
+
<%= f.hidden_field :group_id %>
|
14
|
+
<div>
|
15
|
+
<div class="field">
|
16
|
+
<%= f.text_field :name_and_surname, autofocus: true, required: true %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="field">
|
20
|
+
<%= f.text_field :document_number, required: true %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="field date">
|
24
|
+
<%= f.date_select :date_of_birth, start_year: 1900, end_year: 16.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="field">
|
28
|
+
<%= f.text_field :postal_code, required: true %>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="pb-s">
|
32
|
+
<small class="text-small">
|
33
|
+
<%= strip_tags(translated_attribute(extra_data_legal_information)) %>
|
34
|
+
</small>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div class="actions">
|
39
|
+
<%= f.submit t(".continue"), class: "button expanded" %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="callout secondary mb-sm">
|
2
|
+
<p>
|
3
|
+
<%= t("create.success_html",
|
4
|
+
scope: "decidim.initiatives.initiative_votes",
|
5
|
+
title: translated_attribute(current_initiative.title)) %>
|
6
|
+
</p>
|
7
|
+
</div>
|
8
|
+
<h2 class="section-heading"><%= t("finished", scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
|
9
|
+
|
10
|
+
<%= render partial: "wizard_steps" %>
|
11
|
+
|
12
|
+
<div class="card">
|
13
|
+
<br />
|
14
|
+
<div class="column actions">
|
15
|
+
<%= link_to t(".back_to_initiative"), initiative_path(current_initiative), class: "button white-button expanded" %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="callout secondary mb-sm">
|
2
|
+
<p>
|
3
|
+
<%= t ".help" %>
|
4
|
+
</p>
|
5
|
+
</div>
|
6
|
+
<h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
|
7
|
+
|
8
|
+
<%= render partial: "wizard_steps" %>
|
9
|
+
|
10
|
+
<div class="card">
|
11
|
+
<div class="card__content">
|
12
|
+
<%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form sms_code" }) do |f| %>
|
13
|
+
<div class="field">
|
14
|
+
<%= f.text_field :verification_code %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="actions">
|
18
|
+
<%= f.submit t(".continue"), class: "button expanded" %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="callout secondary mb-sm">
|
2
|
+
<p>
|
3
|
+
<%= t ".help" %>
|
4
|
+
</p>
|
5
|
+
</div>
|
6
|
+
<h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
|
7
|
+
|
8
|
+
<%= render partial: "wizard_steps" %>
|
9
|
+
|
10
|
+
<div class="card">
|
11
|
+
<div class="card__content">
|
12
|
+
<%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form mobile_phone_number" }) do |f| %>
|
13
|
+
<div class="field">
|
14
|
+
<%= f.text_field :mobile_phone_number %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="actions">
|
18
|
+
<%= f.submit t(".continue"), class: "button expanded" %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(function () {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
var $initiativeVotesCount = $('#initiative-<%= current_initiative.id %>-votes-count'),
|
5
|
+
userIdentitiesDialog = $('#user-identities'),
|
6
|
+
refreshUrl;
|
7
|
+
|
8
|
+
$initiativeVotesCount.html('<%= j(render partial: "decidim/initiatives/initiatives/progress_bar", locals: { initiative: current_initiative }) %>');
|
9
|
+
|
10
|
+
// Update the identities dialog, if exists.
|
11
|
+
if (userIdentitiesDialog.length) {
|
12
|
+
refreshUrl = userIdentitiesDialog.data('refresh-url');
|
13
|
+
|
14
|
+
$.ajax(refreshUrl).done(function(response){
|
15
|
+
userIdentitiesDialog.html(response);
|
16
|
+
});
|
17
|
+
} else {
|
18
|
+
var $initiativeVoteButton = $('#initiative-<%= current_initiative.id %>-vote-cabin');
|
19
|
+
$initiativeVoteButton.html('<%= j(render partial: "decidim/initiatives/initiatives/vote_cabin", locals: { initiative: current_initiative }) %>');
|
20
|
+
}
|
21
|
+
}());
|
@@ -5,7 +5,7 @@
|
|
5
5
|
userIdentitiesDialog = $('#user-identities'),
|
6
6
|
refreshUrl;
|
7
7
|
|
8
|
-
$initiativeVotesCount.html('<%= j(render partial: "decidim/initiatives/initiatives/
|
8
|
+
$initiativeVotesCount.html('<%= j(render partial: "decidim/initiatives/initiatives/progress_bar", locals: { initiative: current_initiative }) %>');
|
9
9
|
|
10
10
|
// Update the identities dialog, if exists.
|
11
11
|
if (userIdentitiesDialog.length) {
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</span>
|
16
16
|
</div>
|
17
17
|
|
18
|
-
<% initiative.committee_members.approved.each do |m| %>
|
18
|
+
<% initiative.committee_members.excluding_author.approved.each do |m| %>
|
19
19
|
<% unless m.user.deleted? %>
|
20
20
|
<div class="author author--inline">
|
21
21
|
<span class="author__avatar author__avatar--small">
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="row collapse buttons__row">
|
2
|
+
<div class="column collapse">
|
3
|
+
<button type="button" name="button" class="button small compact hollow secondary button--nomargin expanded">
|
4
|
+
<%= link_to "#comments" do %>
|
5
|
+
<%= icon "comment-square", class: "icon--small", aria_label: t(".comments_count.count.other"), role: "img" %>
|
6
|
+
<%= stats.comments_count %>
|
7
|
+
<%= t(".comments_count.count", count: stats.comments_count) %>
|
8
|
+
<% end %>
|
9
|
+
</button>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= cell(
|
2
|
+
"decidim/progress_bar",
|
3
|
+
current_initiative.supports_count,
|
4
|
+
total: current_initiative.supports_required,
|
5
|
+
units_name: "decidim.initiatives.initiatives.votes_count.count",
|
6
|
+
element_id: "initiative-#{current_initiative.id}-votes-count",
|
7
|
+
subtitle_text: current_initiative.supports_goal_reached? ? t("decidim.initiatives.initiatives.votes_count.most_popular_initiative") : t("decidim.initiatives.initiatives.votes_count.need_more_votes"),
|
8
|
+
small: false
|
9
|
+
) %>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<% if initiative.
|
1
|
+
<% if initiative.answered? && translated_attribute(initiative.answer).present? %>
|
2
2
|
<br />
|
3
3
|
<div class="row column">
|
4
4
|
<div class="callout success">
|
5
|
-
<h5><%= t(".
|
5
|
+
<h5><%= t(initiative.state, scope: "decidim.initiatives.initiatives.result.answer_title") %>:</h5>
|
6
6
|
<p>
|
7
|
-
<% if initiative.answer_url %>
|
7
|
+
<% if initiative.answer_url.present? %>
|
8
8
|
<a href="<%= initiative.answer_url %>" target="_blank">
|
9
9
|
<%= decidim_sanitize translated_attribute initiative.answer %>
|
10
10
|
</a>
|
@@ -1,20 +1,41 @@
|
|
1
1
|
<% if allowed_to? :vote, :initiative, initiative: initiative %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
2
|
+
<% if steps %>
|
3
|
+
<%= link_to(
|
4
|
+
vote_label,
|
5
|
+
initiative_initiative_signatures_path(initiative_slug: current_initiative.slug),
|
6
|
+
class: "button expanded light button--sc"
|
7
|
+
) %>
|
8
|
+
<% else %>
|
9
|
+
<%= button_to(
|
10
|
+
vote_label,
|
11
|
+
initiative_initiative_signatures_path(initiative_slug: current_initiative.slug),
|
12
|
+
remote: true,
|
13
|
+
data: { disable: true },
|
14
|
+
class: "button expanded light button--sc"
|
15
|
+
) %>
|
16
|
+
<% end %>
|
17
|
+
<% else %>
|
18
|
+
<% if initiative.voted_by?(current_user) %>
|
19
|
+
<% if allowed_to? :unvote, :initiative, initiative: initiative %>
|
20
|
+
<%= button_to(
|
21
|
+
initiative_initiative_vote_path(initiative_slug: current_initiative.slug),
|
22
|
+
method: :delete,
|
23
|
+
remote: true,
|
24
|
+
data: { disable: true },
|
25
|
+
class: "button expanded light button--sc success"
|
26
|
+
) do %>
|
27
|
+
<%= icon("check", class: "icon--small") %>
|
28
|
+
<%= unvote_label %>
|
29
|
+
<% end %>
|
30
|
+
<% else %>
|
31
|
+
<button class='button expanded button--sc success light disabled' disabled>
|
32
|
+
<%= icon("check", class: "icon--small") %>
|
33
|
+
<%= unvote_label %>
|
34
|
+
</button>
|
35
|
+
<% end %>
|
36
|
+
<% else %>
|
37
|
+
<%= authorized_vote_modal_button(initiative, remote: true, class: "button expanded light button--sc") do %>
|
38
|
+
<%= verification_label %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
20
41
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if current_user && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
|
1
|
+
<% if current_user && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? && allowed_to?(:vote, :initiative, initiative: initiative) %>
|
2
2
|
<button id="select-identity-button"
|
3
|
-
class="
|
3
|
+
class="button expanded light button--sc">
|
4
4
|
<%= t(".vote") %>
|
5
5
|
</button>
|
6
6
|
|
@@ -8,17 +8,17 @@
|
|
8
8
|
id="user-identities"
|
9
9
|
data-reveal data-refresh-url="<%= signature_identities_initiative_url(slug: initiative.slug) %>">
|
10
10
|
</div>
|
11
|
-
<%
|
11
|
+
<% elsif initiative.accepts_online_votes? %>
|
12
12
|
<%= render partial: "decidim/initiatives/initiatives/vote_button",
|
13
13
|
locals: {
|
14
14
|
initiative: initiative,
|
15
15
|
vote_label: t(".vote"),
|
16
|
-
unvote_label: t(".already_voted")
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<%
|
21
|
-
<button class='
|
16
|
+
unvote_label: t(".already_voted"),
|
17
|
+
verification_label: t(".verification_required"),
|
18
|
+
steps: signature_has_steps?
|
19
|
+
} %>
|
20
|
+
<% else %>
|
21
|
+
<button class='button expanded light button--sc disabled' disabled>
|
22
22
|
<%= t(".votes_blocked") %>
|
23
23
|
</button>
|
24
24
|
<% end %>
|
@@ -32,27 +32,27 @@ edit_link(
|
|
32
32
|
<% end %>
|
33
33
|
|
34
34
|
<div class="columns section view-side mediumlarge-4 mediumlarge-push-8 large-3 large-push-9">
|
35
|
-
<div class="card
|
36
|
-
<div class="
|
37
|
-
|
38
|
-
<%= render partial: "votes_count", locals: { initiative: current_initiative } %>
|
39
|
-
</div>
|
35
|
+
<div class="card">
|
36
|
+
<div class="card__content">
|
37
|
+
<%= render partial: "progress_bar" %>
|
40
38
|
<% if current_initiative.votes_enabled? %>
|
41
39
|
<div id="initiative-<%= current_initiative.id %>-vote-cabin">
|
42
40
|
<%= render partial: "vote_cabin", locals: { initiative: current_initiative } %>
|
43
41
|
</div>
|
44
42
|
<% end %>
|
45
|
-
|
46
|
-
<% if current_user %>
|
47
|
-
<%= render partial: "decidim/shared/follow_button", locals: { followable: current_initiative, large: false } %>
|
48
|
-
<% end %>
|
43
|
+
<%= render partial: "interactions" %>
|
49
44
|
</div>
|
50
45
|
</div>
|
51
|
-
|
46
|
+
<% if current_user %>
|
47
|
+
<div class="card text-center">
|
48
|
+
<div class="card__content">
|
49
|
+
<%= cell "decidim/follow_button", current_participatory_space, inline: false, large: true %>
|
50
|
+
<small><%= t(".follow_description") %></small>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<% end %>
|
52
54
|
<%= render partial: "decidim/shared/share_modal" %>
|
53
55
|
<%= embed_modal_for initiative_initiative_widget_url(current_initiative, format: :js) %>
|
54
|
-
|
55
|
-
<%= render partial: "statistics" %>
|
56
56
|
<%= resource_reference(current_initiative) %>
|
57
57
|
</div>
|
58
58
|
|
@@ -6,7 +6,9 @@
|
|
6
6
|
locals: {
|
7
7
|
initiative: current_initiative,
|
8
8
|
vote_label: current_user.name,
|
9
|
-
unvote_label: current_user.name
|
9
|
+
unvote_label: current_user.name,
|
10
|
+
verification_label: current_user.name,
|
11
|
+
steps: signature_has_steps?
|
10
12
|
} unless current_initiative.offline? %>
|
11
13
|
|
12
14
|
<% Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.each do |g| %>
|
@@ -18,15 +20,23 @@
|
|
18
20
|
method: :delete,
|
19
21
|
remote: true,
|
20
22
|
data: { disable: true },
|
21
|
-
class: "
|
23
|
+
class: "button expanded light button--sc success"
|
22
24
|
) %>
|
23
25
|
<% else %>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
<% if signature_has_steps? %>
|
27
|
+
<%= link_to(
|
28
|
+
g.name,
|
29
|
+
initiative_initiative_signatures_path(initiative_slug: current_initiative.slug, group_id: g.id),
|
30
|
+
class: "button expanded light button--sc"
|
31
|
+
) %>
|
32
|
+
<% else %>
|
33
|
+
<%= button_to(
|
34
|
+
g.name,
|
35
|
+
initiative_initiative_signatures_path(initiative_slug: current_initiative.slug, group_id: g.id),
|
36
|
+
remote: true,
|
37
|
+
data: { disable: true },
|
38
|
+
class: "button expanded light button--sc"
|
39
|
+
) %>
|
40
|
+
<% end %>
|
31
41
|
<% end %>
|
32
42
|
<% end %>
|