decidim-initiatives 0.22.0 → 0.23.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/admin/initiatives_types.js.es6 +18 -0
- data/app/assets/stylesheet/decidim/initiatives/initiatives.scss +6 -0
- data/app/cells/decidim/initiatives/initiative_m_cell.rb +14 -0
- data/app/cells/decidim/initiatives_votes/vote/show.erb +12 -9
- data/app/cells/decidim/initiatives_votes/vote_cell.rb +7 -0
- data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +3 -1
- data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +3 -1
- data/app/commands/decidim/initiatives/attachment_methods.rb +9 -5
- data/app/commands/decidim/initiatives/create_initiative.rb +2 -2
- data/app/commands/decidim/initiatives/unvote_initiative.rb +4 -10
- data/app/commands/decidim/initiatives/vote_initiative.rb +36 -36
- data/app/controllers/decidim/initiatives/admin/answers_controller.rb +2 -3
- data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +2 -2
- data/app/controllers/decidim/initiatives/create_initiative_controller.rb +1 -1
- data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +19 -23
- data/app/controllers/decidim/initiatives/initiative_votes_controller.rb +11 -5
- data/app/controllers/decidim/initiatives/initiatives_controller.rb +11 -10
- data/app/controllers/decidim/initiatives/initiatives_type_scopes_controller.rb +9 -1
- data/app/controllers/decidim/initiatives/{initiative_widgets_controller.rb → widgets_controller.rb} +2 -2
- data/app/forms/decidim/initiatives/admin/initiative_form.rb +19 -8
- data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +3 -0
- data/app/forms/decidim/initiatives/initiative_form.rb +23 -2
- data/app/forms/decidim/initiatives/vote_form.rb +133 -78
- data/app/models/decidim/initiative.rb +123 -52
- data/app/models/decidim/initiatives_type.rb +5 -2
- data/app/models/decidim/initiatives_type_scope.rb +5 -1
- data/app/models/decidim/initiatives_vote.rb +19 -23
- data/app/permissions/decidim/initiatives/admin/permissions.rb +2 -2
- data/app/permissions/decidim/initiatives/permissions.rb +2 -4
- data/app/presenters/decidim/initiatives/initiative_stats_presenter.rb +1 -5
- data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +1 -1
- data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +39 -17
- data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb +12 -9
- data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +35 -10
- data/app/views/decidim/initiatives/admin/initiatives_types/_initiative_type_scopes.html.erb +28 -25
- data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +18 -16
- data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +0 -1
- data/app/views/decidim/initiatives/initiative_signatures/update_buttons_and_counters.js.erb +1 -1
- data/app/views/decidim/initiatives/initiative_votes/update_buttons_and_counters.js.erb +1 -1
- data/app/views/decidim/initiatives/initiatives/_index_header.html.erb +36 -2
- data/app/views/decidim/initiatives/initiatives/_initiatives.html.erb +10 -0
- data/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +24 -9
- data/app/views/decidim/initiatives/initiatives/_vote_cabin.html.erb +1 -13
- data/app/views/decidim/initiatives/initiatives/show.html.erb +1 -3
- data/app/views/layouts/decidim/initiative.html.erb +1 -0
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +0 -4
- data/config/locales/bg.yml +13 -0
- data/config/locales/ca.yml +22 -8
- data/config/locales/cs.yml +18 -4
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +7 -4
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +18 -4
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +18 -4
- data/config/locales/es-PY.yml +18 -4
- data/config/locales/es.yml +31 -17
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +0 -14
- data/config/locales/fi-plain.yml +18 -4
- data/config/locales/fi.yml +18 -4
- data/config/locales/fr-CA.yml +32 -4
- data/config/locales/fr.yml +36 -8
- data/config/locales/gl.yml +0 -14
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +5 -4
- data/config/locales/id-ID.yml +0 -14
- data/config/locales/is-IS.yml +0 -10
- data/config/locales/is.yml +251 -0
- data/config/locales/it.yml +9 -4
- data/config/locales/ja-JP.yml +43 -49
- data/config/locales/ja.yml +549 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/{lv-LV.yml → lv.yml} +0 -4
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +9 -4
- data/config/locales/no.yml +48 -4
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +28 -22
- data/config/locales/pt-BR.yml +0 -14
- data/config/locales/pt.yml +5 -4
- data/config/locales/ro-RO.yml +5 -4
- data/config/locales/ru.yml +0 -14
- data/config/locales/sk.yml +0 -4
- data/config/locales/sl.yml +6 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sv.yml +25 -5
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +0 -14
- data/config/locales/uk.yml +0 -14
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +549 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20191106144259_add_settings_to_initiatives_types.rb +8 -0
- data/db/migrate/20191107134847_add_scopes_to_initiatives_votes.rb +28 -0
- data/db/migrate/20191116170841_allow_multiple_initiative_votes_counter_caches.rb +32 -0
- data/db/migrate/20191118105634_allow_multiple_offline_votes.rb +34 -0
- data/db/migrate/20200528151456_remove_user_groups_from_initiative_votes.rb +7 -0
- data/db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb +9 -0
- data/db/seeds/city.jpeg +0 -0
- data/lib/decidim/initiatives/admin_engine.rb +1 -0
- data/lib/decidim/initiatives/engine.rb +2 -2
- data/lib/decidim/initiatives/participatory_space.rb +7 -0
- data/lib/decidim/initiatives/test/factories.rb +21 -3
- data/lib/decidim/initiatives/version.rb +1 -1
- data/lib/tasks/decidim_initiatives.rake +1 -3
- metadata +42 -18
- data/app/views/decidim/initiatives/initiatives/_supports.html.erb +0 -22
- data/app/views/decidim/initiatives/initiatives/signature_identities.html.erb +0 -42
@@ -3,6 +3,28 @@
|
|
3
3
|
<h2 class="card-title"><%= t ".title" %></h2>
|
4
4
|
</div>
|
5
5
|
|
6
|
+
<div class="card-section">
|
7
|
+
<div class="row column">
|
8
|
+
<%= form.translated :text_field, :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="row column">
|
12
|
+
<%= form.translated :editor, :description, toolbar: :full, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="row column">
|
16
|
+
<div class="columns xlarge-6">
|
17
|
+
<%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="card">
|
24
|
+
<div class="card-divider">
|
25
|
+
<h2 class="card-title"><%= t ".settings" %></h2>
|
26
|
+
</div>
|
27
|
+
|
6
28
|
<div class="card-section">
|
7
29
|
<div class="row">
|
8
30
|
<div class="columns xlarge-6">
|
@@ -13,14 +35,6 @@
|
|
13
35
|
</div>
|
14
36
|
</div>
|
15
37
|
|
16
|
-
<div class="row column">
|
17
|
-
<%= form.translated :text_field, :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<div class="row column">
|
21
|
-
<%= form.translated :editor, :description, toolbar: :full, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
22
|
-
</div>
|
23
|
-
|
24
38
|
<div class="row">
|
25
39
|
<% unless single_initiative_type? %>
|
26
40
|
<div class="columns xlarge-6">
|
@@ -30,7 +44,7 @@
|
|
30
44
|
{
|
31
45
|
disabled: !@form.signature_type_updatable?,
|
32
46
|
"data-scope-selector": "initiative_decidim_scope_id",
|
33
|
-
"data-scope-id": form.object.decidim_scope_id,
|
47
|
+
"data-scope-id": form.object.decidim_scope_id.to_s,
|
34
48
|
"data-scope-search-url": decidim_initiatives.initiative_type_scopes_search_url,
|
35
49
|
"data-signature-types-selector": "initiative_signature_type",
|
36
50
|
"data-signature-type": current_initiative.signature_type,
|
@@ -74,10 +88,6 @@
|
|
74
88
|
<% end %>
|
75
89
|
|
76
90
|
<div class="row">
|
77
|
-
<div class="columns xlarge-6">
|
78
|
-
<%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
|
79
|
-
</div>
|
80
|
-
|
81
91
|
<div class="columns xlarge-6">
|
82
92
|
<%= form.select :signature_type, [], {}, { disabled: !@form.signature_type_updatable? } %>
|
83
93
|
</div>
|
@@ -86,14 +96,26 @@
|
|
86
96
|
<% if current_initiative.accepts_offline_votes? && current_user.admin? %>
|
87
97
|
<div class="row">
|
88
98
|
<div class="columns xlarge-6">
|
89
|
-
|
99
|
+
<% @form.offline_votes.each do |scope_id, (votes, scope_name)| %>
|
100
|
+
<%= label_tag "initiative_offline_votes_#{scope_id}", t("activemodel.attributes.initiative.offline_votes_for_scope", scope_name: translated_attribute(scope_name)) %>
|
101
|
+
<%= number_field_tag "initiative[offline_votes][#{scope_id}]", votes, min: 0, id: "initiative_offline_votes_#{scope_id}" %>
|
102
|
+
<% end %>
|
90
103
|
</div>
|
91
104
|
</div>
|
92
105
|
<% end %>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<div class="card">
|
109
|
+
<div class="card-divider">
|
110
|
+
<h2 class="card-title"><%= t ".attachments" %></h2>
|
111
|
+
</div>
|
93
112
|
|
94
|
-
|
95
|
-
|
96
|
-
|
113
|
+
<div class="card-section">
|
114
|
+
<div class="row">
|
115
|
+
<% if allowed_to?(:read, :attachment, initiative: current_participatory_space) %>
|
116
|
+
<%= render partial: "initiative_attachments", locals: { current_initiative: current_initiative, current_participatory_space: current_participatory_space } %>
|
117
|
+
<% end %>
|
118
|
+
</div>
|
97
119
|
</div>
|
98
120
|
</div>
|
99
121
|
|
@@ -41,33 +41,36 @@
|
|
41
41
|
<br>
|
42
42
|
<div class="initiatives-votes-table" style="width: 100%; display: block; border: 1pt solid black;">
|
43
43
|
<div class="initiatives-votes-table-header" style="background-color: lightgray; display: inline-block; width: 100%; font-size: 12pt; font-weight: bold; border-bottom: 1pt solid black;">
|
44
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
44
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
45
45
|
<%= t("models.initiatives_votes.fields.initiative_id", scope: "decidim.admin") %>
|
46
46
|
</div>
|
47
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
47
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
48
48
|
<%= t("models.initiatives_votes.fields.initiative_title", scope: "decidim.admin") %>
|
49
49
|
</div>
|
50
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
50
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
51
51
|
<%= t("models.initiatives_votes.fields.name_and_surname", scope: "decidim.admin") %>
|
52
52
|
</div>
|
53
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
53
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
54
54
|
<%= t("models.initiatives_votes.fields.document_number", scope: "decidim.admin") %>
|
55
55
|
</div>
|
56
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
56
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
57
57
|
<%= t("models.initiatives_votes.fields.date_of_birth", scope: "decidim.admin") %>
|
58
58
|
</div>
|
59
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
59
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
60
60
|
<%= t("models.initiatives_votes.fields.postal_code", scope: "decidim.admin") %>
|
61
61
|
</div>
|
62
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
62
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
63
63
|
<%= t("models.initiatives_votes.fields.time_and_date", scope: "decidim.admin") %>
|
64
64
|
</div>
|
65
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
65
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
66
66
|
<%= t("models.initiatives_votes.fields.timestamp", scope: "decidim.admin") %>
|
67
67
|
</div>
|
68
|
-
<div class="initiatives-votes-table-cell w11" style="width:
|
68
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
69
69
|
<%= t("models.initiatives_votes.fields.hash", scope: "decidim.admin") %>
|
70
70
|
</div>
|
71
|
+
<div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
|
72
|
+
<%= t("models.initiatives_votes.fields.scope", scope: "decidim.admin") %>
|
73
|
+
</div>
|
71
74
|
</div>
|
72
75
|
<% @votes.each do |vote| %>
|
73
76
|
<%= cell "decidim/initiatives_votes/vote", vote %>
|
@@ -12,6 +12,20 @@
|
|
12
12
|
<%= form.translated :editor, :description, toolbar: :full, lines: 25 %>
|
13
13
|
</div>
|
14
14
|
|
15
|
+
<div class="row">
|
16
|
+
<div class="columns xlarge-6">
|
17
|
+
<%= form.upload :banner_image %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="card">
|
24
|
+
<div class="card-divider">
|
25
|
+
<h2 class="card-title"><%= t ".options" %></h2>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="card-section">
|
15
29
|
<div class="row column">
|
16
30
|
<%= form.select :signature_type, form.object.signature_type_options %>
|
17
31
|
</div>
|
@@ -32,6 +46,16 @@
|
|
32
46
|
<%= form.check_box :area_enabled %>
|
33
47
|
</div>
|
34
48
|
|
49
|
+
<div class="row column">
|
50
|
+
<%= form.check_box :child_scope_threshold_enabled %>
|
51
|
+
<p class="help-text"><%== t(".child_scope_threshold_enabled_help") %></p>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div class="row column">
|
55
|
+
<%= form.check_box :only_global_scope_enabled %>
|
56
|
+
<p class="help-text"><%== t(".only_global_scope_enabled_help") %></p>
|
57
|
+
</div>
|
58
|
+
|
35
59
|
<div class="row column" id="promoting-committee-details">
|
36
60
|
<%= form.check_box :promoting_committee_enabled %>
|
37
61
|
|
@@ -47,13 +71,15 @@
|
|
47
71
|
<div class="row column">
|
48
72
|
<%= form.translated :editor, :extra_fields_legal_information %>
|
49
73
|
</div>
|
74
|
+
</div>
|
75
|
+
</div>
|
50
76
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<% end %>
|
77
|
+
<div class="card">
|
78
|
+
<div class="card-divider">
|
79
|
+
<h2 class="card-title"><%= t ".authorizations" %></h2>
|
80
|
+
</div>
|
56
81
|
|
82
|
+
<div class="card-section">
|
57
83
|
<div class="row column">
|
58
84
|
<%=
|
59
85
|
form.select(
|
@@ -64,12 +90,11 @@
|
|
64
90
|
%>
|
65
91
|
</div>
|
66
92
|
|
67
|
-
|
68
|
-
<div class="
|
69
|
-
<%= form.
|
93
|
+
<% if current_organization.available_authorizations.include? "sms" %>
|
94
|
+
<div class="row column">
|
95
|
+
<%= form.check_box :validate_sms_code_on_votes %>
|
70
96
|
</div>
|
71
|
-
|
72
|
-
|
97
|
+
<% end %>
|
73
98
|
</div>
|
74
99
|
</div>
|
75
100
|
|
@@ -7,33 +7,36 @@
|
|
7
7
|
class: "button tiny button--title" if allowed_to? :create, :initiative_type_scope %>
|
8
8
|
</h2>
|
9
9
|
</div>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
<
|
16
|
-
<th class="text-right">
|
17
|
-
<%= t("models.initiatives_type_scope.fields.supports_required", scope: "decidim.admin") %>
|
18
|
-
</th>
|
19
|
-
<th class="actions"></th>
|
20
|
-
</tr>
|
21
|
-
</thead>
|
22
|
-
<tbody>
|
23
|
-
<% initiative_type.scopes.each do |s| %>
|
10
|
+
|
11
|
+
<div class="card-section">
|
12
|
+
<div class="row column">
|
13
|
+
<div class="table-scroll">
|
14
|
+
<table class="table-list">
|
15
|
+
<thead>
|
24
16
|
<tr>
|
25
|
-
<
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
t("actions.configure", scope: "decidim.admin"),
|
31
|
-
class: "action-icon--new" if allowed_to? :edit, :initiative_type_scope, initiative_type_scope: s %>
|
32
|
-
</td>
|
17
|
+
<th><%= t("models.initiatives_type_scope.fields.scope", scope: "decidim.admin") %></th>
|
18
|
+
<th class="text-right">
|
19
|
+
<%= t("models.initiatives_type_scope.fields.supports_required", scope: "decidim.admin") %>
|
20
|
+
</th>
|
21
|
+
<th class="actions"></th>
|
33
22
|
</tr>
|
34
|
-
|
35
|
-
|
36
|
-
|
23
|
+
</thead>
|
24
|
+
<tbody>
|
25
|
+
<% initiative_type.scopes.each do |s| %>
|
26
|
+
<tr>
|
27
|
+
<td><%= translated_attribute(s.scope_name) %></td>
|
28
|
+
<td class="text-right"><%= s.supports_required %></td>
|
29
|
+
<td class="table-list__actions">
|
30
|
+
<%= icon_link_to "pencil",
|
31
|
+
decidim_admin_initiatives.edit_initiatives_type_initiatives_type_scope_path(initiative_type, s),
|
32
|
+
t("actions.configure", scope: "decidim.admin"),
|
33
|
+
class: "action-icon--new" if allowed_to? :edit, :initiative_type_scope, initiative_type_scope: s %>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
37
40
|
</div>
|
38
41
|
</div>
|
39
42
|
</div>
|
@@ -76,26 +76,28 @@
|
|
76
76
|
</div>
|
77
77
|
<% end %>
|
78
78
|
|
79
|
-
|
80
|
-
<
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
<% if initiative_type.attachments_enabled? %>
|
80
|
+
<fieldset>
|
81
|
+
<legend><%= t("attachment_legend", scope: "decidim.proposals.proposals.edit") %></legend>
|
82
|
+
<%= f.fields_for :attachment, @form.attachment do |nested_form| %>
|
83
|
+
<div class="field">
|
84
|
+
<%= nested_form.text_field :title %>
|
85
|
+
</div>
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
87
|
+
<div class="field">
|
88
|
+
<%= nested_form.upload :file, optional: false %>
|
89
|
+
</div>
|
89
90
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
<% if @form.errors[:attachment].present? %>
|
92
|
+
<% @form.errors[:attachment].each do |message| %>
|
93
|
+
<small class="form-error is-visible">
|
94
|
+
<%= message %>
|
95
|
+
</small>
|
96
|
+
<% end %>
|
95
97
|
<% end %>
|
96
98
|
<% end %>
|
97
|
-
|
98
|
-
|
99
|
+
</fieldset>
|
100
|
+
<% end %>
|
99
101
|
</div>
|
100
102
|
<div class="actions">
|
101
103
|
<%= f.submit t(".continue"), class: "button expanded", data: { disable_with: true } %>
|
@@ -11,7 +11,6 @@
|
|
11
11
|
<div class="card__content">
|
12
12
|
<%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form user_personal_data_signature_form" }) do |f| %>
|
13
13
|
<%= form_required_explanation %>
|
14
|
-
<%= f.hidden_field :group_id %>
|
15
14
|
<div>
|
16
15
|
<div class="field">
|
17
16
|
<%= f.text_field :name_and_surname, autofocus: true, required: true %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
(function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
var $initiativeVotesCount = $('#initiative-<%= current_initiative.id %>-
|
4
|
+
var $initiativeVotesCount = $('#initiative-<%= current_initiative.id %>-progress-bar'),
|
5
5
|
userIdentitiesDialog = $('#user-identities'),
|
6
6
|
refreshUrl;
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
(function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
var $initiativeVotesCount = $('#initiative-<%= current_initiative.id %>-
|
4
|
+
var $initiativeVotesCount = $('#initiative-<%= current_initiative.id %>-progress-bar'),
|
5
5
|
userIdentitiesDialog = $('#user-identities'),
|
6
6
|
refreshUrl;
|
7
7
|
|
@@ -2,10 +2,44 @@
|
|
2
2
|
<h1 id="initiatives-count" class="title-action__title section-heading">
|
3
3
|
<%= render partial: "count" %>
|
4
4
|
</h1>
|
5
|
-
<% if
|
6
|
-
|
5
|
+
<% if Decidim::Initiatives.creation_enabled %>
|
6
|
+
<% if current_user && allowed_to?(:create, :initiative) %>
|
7
|
+
<%= link_to create_initiative_path(:select_initiative_type), class: "title-action__action button small" do %>
|
7
8
|
<%= t(".new_initiative") %>
|
8
9
|
<%= icon "plus", role: "img", "aria-hidden": true %>
|
10
|
+
<% end %>
|
11
|
+
<% elsif current_user %>
|
12
|
+
<button type="button" class="title-action__action button small" data-open="not-authorized-modal" aria-controls="not-authorized-modal" aria-haspopup="true" tabindex="0">
|
13
|
+
<%= t(".new_initiative") %>
|
14
|
+
<%= icon "plus", role: "img", "aria-hidden": true %>
|
15
|
+
</button>
|
16
|
+
<% else %>
|
17
|
+
<% content_for(:redirect_after_login) { create_initiative_url(:select_initiative_type) } %>
|
18
|
+
<button type="button" class="title-action__action button small" data-open="loginModal" aria-controls="loginModal" aria-haspopup="true" tabindex="0">
|
19
|
+
<%= t(".new_initiative") %>
|
20
|
+
<%= icon "plus", role: "img", "aria-hidden": true %>
|
21
|
+
</button>
|
9
22
|
<% end %>
|
10
23
|
<% end %>
|
11
24
|
</div>
|
25
|
+
|
26
|
+
<div class="reveal not-authorized-reveal" id="not-authorized-modal" aria-hidden="true" role="dialog" aria-labelledby="not-authorized-modal-title" data-reveal data-multiple-opened="true">
|
27
|
+
<div class="reveal__header">
|
28
|
+
<h2 class="reveal__title" id="not-authorized-modal-title"><%= t(".not_authorized.title") %></h2>
|
29
|
+
<button class="close-button" data-close aria-label="<%= t(".not_authorized.close") %>"
|
30
|
+
type="button">
|
31
|
+
<span aria-hidden="true">×</span>
|
32
|
+
</button>
|
33
|
+
</div>
|
34
|
+
<div class="not-authhorized-content">
|
35
|
+
<div class="not-authorized-modal-content">
|
36
|
+
<p>
|
37
|
+
<%= t(".not_authorized.explanation") %>
|
38
|
+
</p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div class="not-authorized-modal-footer reveal__footer">
|
42
|
+
<%= link_to t(".not_authorized.authorizations_page"), decidim_verifications.authorizations_path(redirect_url: create_initiative_url(:select_initiative_type)), class: "button expanded" %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
@@ -1,3 +1,13 @@
|
|
1
|
+
<% if @forced_closed_initiatives %>
|
2
|
+
<div class="callout warning">
|
3
|
+
<%= t ".closed_initiatives_warning" %>
|
4
|
+
</div>
|
5
|
+
<% elsif initiatives.blank? %>
|
6
|
+
<div class="callout warning">
|
7
|
+
<%= t ".no_initiatives_warning" %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
1
11
|
<div class="collection-sort-controls row small-up-1 medium-up-2 card-grid">
|
2
12
|
<div class="column">
|
3
13
|
<%= order_selector available_orders, i18n_scope: "decidim.initiatives.initiatives.orders" %>
|
@@ -1,9 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
<div id="initiative-<%= current_initiative.id %>-progress-bar">
|
2
|
+
<% current_initiative.votable_initiative_type_scopes.each_with_index do |type_scope, index| %>
|
3
|
+
<% if index == 0 %>
|
4
|
+
<%= cell(
|
5
|
+
"decidim/progress_bar",
|
6
|
+
current_initiative.online_votes_count_for(type_scope.scope),
|
7
|
+
total: type_scope.supports_required,
|
8
|
+
units_name: "decidim.initiatives.initiatives.votes_count.count",
|
9
|
+
element_id: "initiative-#{current_initiative.id}-votes-count",
|
10
|
+
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"),
|
11
|
+
small: false
|
12
|
+
) %>
|
13
|
+
<% else %>
|
14
|
+
<%= cell(
|
15
|
+
"decidim/progress_bar",
|
16
|
+
current_initiative.online_votes_count_for(type_scope.scope),
|
17
|
+
total: type_scope.supports_required,
|
18
|
+
subtitle_text: translated_attribute(type_scope.scope_name),
|
19
|
+
element_id: "initiative-scope-#{type_scope.id}-#{current_initiative.id}-votes-count",
|
20
|
+
horizontal: true
|
21
|
+
) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
@@ -1,14 +1,4 @@
|
|
1
|
-
<% if
|
2
|
-
<button id="select-identity-button"
|
3
|
-
class="button expanded light button--sc">
|
4
|
-
<%= t(".vote") %>
|
5
|
-
</button>
|
6
|
-
|
7
|
-
<div class="reveal"
|
8
|
-
id="user-identities"
|
9
|
-
data-reveal data-refresh-url="<%= signature_identities_initiative_url(slug: initiative.slug) %>">
|
10
|
-
</div>
|
11
|
-
<% elsif initiative.accepts_online_votes? %>
|
1
|
+
<% if initiative.accepts_online_votes? %>
|
12
2
|
<%= render partial: "decidim/initiatives/initiatives/vote_button",
|
13
3
|
locals: {
|
14
4
|
initiative: initiative,
|
@@ -22,5 +12,3 @@
|
|
22
12
|
<%= t(".votes_blocked") %>
|
23
13
|
</button>
|
24
14
|
<% end %>
|
25
|
-
|
26
|
-
<%= javascript_include_tag "decidim/initiatives/identity_selector_dialog" %>
|