decidim-proposals 0.23.1 → 0.24.0.rc2
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/proposals/add_proposal.js.es6 +4 -1
- data/app/assets/stylesheets/decidim/proposals/_proposals.css.scss +1 -0
- data/app/assets/stylesheets/decidim/proposals/proposals/_preview.css.scss +3 -0
- data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal_cell.rb +3 -3
- data/app/cells/decidim/proposals/collaborative_drafts/reported_content/show.erb +3 -0
- data/app/cells/decidim/proposals/collaborative_drafts/reported_content_cell.rb +15 -0
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/elements.erb +5 -0
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/heading.erb +1 -0
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals_cell.rb +19 -0
- data/app/cells/decidim/proposals/irreversible_action_modal_cell.rb +1 -1
- data/app/cells/decidim/proposals/proposal_activity_cell.rb +13 -5
- data/app/cells/decidim/proposals/proposal_m_cell.rb +23 -2
- data/app/cells/decidim/proposals/reported_content/show.erb +4 -0
- data/app/cells/decidim/proposals/reported_content_cell.rb +13 -0
- data/app/commands/decidim/proposals/admin/update_proposal.rb +2 -0
- data/app/commands/decidim/proposals/hashtags_methods.rb +1 -1
- data/app/controllers/decidim/proposals/admin/proposals_controller.rb +7 -5
- data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +1 -30
- data/app/controllers/decidim/proposals/proposals_controller.rb +5 -6
- data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
- data/app/forms/decidim/proposals/access_to_collaborative_draft_form.rb +1 -3
- data/app/forms/decidim/proposals/admin/proposal_base_form.rb +3 -2
- data/app/forms/decidim/proposals/admin/proposal_form.rb +13 -0
- data/app/forms/decidim/proposals/proposal_form.rb +15 -5
- data/app/forms/decidim/proposals/proposal_wizard_create_step_form.rb +1 -9
- data/app/helpers/decidim/proposals/admin/filterable_helper.rb +1 -1
- data/app/helpers/decidim/proposals/admin/proposal_rankings_helper.rb +1 -1
- data/app/helpers/decidim/proposals/admin/proposals_helper.rb +8 -8
- data/app/helpers/decidim/proposals/application_helper.rb +5 -2
- data/app/helpers/decidim/proposals/map_helper.rb +25 -4
- data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +14 -44
- data/app/helpers/decidim/proposals/proposals_helper.rb +3 -6
- data/app/models/decidim/proposals/collaborative_draft.rb +10 -0
- data/app/models/decidim/proposals/proposal.rb +21 -11
- data/app/permissions/decidim/proposals/admin/permissions.rb +2 -2
- data/app/permissions/decidim/proposals/permissions.rb +3 -2
- data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +2 -2
- data/app/presenters/decidim/proposals/admin_log/valuation_assignment_presenter.rb +2 -2
- data/app/presenters/decidim/proposals/proposal_presenter.rb +35 -16
- data/app/queries/decidim/proposals/metrics/proposal_followers_metric_measure.rb +4 -4
- data/app/queries/decidim/proposals/metrics/proposal_participants_metric_measure.rb +6 -6
- data/app/services/decidim/proposals/diff_renderer.rb +7 -11
- data/app/services/decidim/proposals/proposal_builder.rb +1 -0
- data/app/validators/proposal_length_validator.rb +4 -2
- data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +8 -1
- data/app/views/decidim/proposals/admin/proposals/_form.html.erb +8 -2
- data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +5 -1
- data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/_filters_small_view.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +2 -7
- data/app/views/decidim/proposals/collaborative_drafts/_wizard_header.html.erb +14 -0
- data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +7 -7
- data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +5 -13
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +7 -11
- data/app/views/decidim/proposals/proposals/_dynamic_map_instructions.html.erb +3 -0
- data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +2 -2
- data/app/views/decidim/proposals/proposals/_filters.html.erb +34 -32
- data/app/views/decidim/proposals/proposals/_filters_small_view.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +21 -11
- data/app/views/decidim/proposals/proposals/edit.html.erb +7 -7
- data/app/views/decidim/proposals/proposals/preview.html.erb +50 -2
- data/app/views/decidim/proposals/proposals/show.html.erb +8 -12
- data/config/locales/ar.yml +2 -22
- data/config/locales/ca.yml +28 -32
- data/config/locales/cs.yml +48 -52
- data/config/locales/de.yml +127 -104
- data/config/locales/el.yml +2 -29
- data/config/locales/en.yml +25 -29
- data/config/locales/es-MX.yml +24 -29
- data/config/locales/es-PY.yml +24 -29
- data/config/locales/es.yml +24 -29
- data/config/locales/eu.yml +4 -22
- data/config/locales/fi-plain.yml +24 -28
- data/config/locales/fi.yml +31 -35
- data/config/locales/fr-CA.yml +21 -29
- data/config/locales/fr.yml +21 -29
- data/config/locales/gl.yml +4 -22
- data/config/locales/hu.yml +2 -22
- data/config/locales/id-ID.yml +2 -22
- data/config/locales/is-IS.yml +0 -5
- data/config/locales/it.yml +4 -29
- data/config/locales/ja.yml +2 -29
- data/config/locales/lv.yml +2 -21
- data/config/locales/nl.yml +33 -43
- data/config/locales/no.yml +4 -24
- data/config/locales/pl.yml +31 -31
- data/config/locales/pt-BR.yml +2 -21
- data/config/locales/pt.yml +2 -29
- data/config/locales/ro-RO.yml +5 -28
- data/config/locales/ru.yml +0 -5
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +5 -22
- data/config/locales/sv.yml +12 -34
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/tr-TR.yml +383 -231
- data/config/locales/uk.yml +0 -5
- data/config/locales/zh-CN.yml +2 -29
- data/db/migrate/20210127115628_fix_answered_proposals_after_copy.rb +14 -0
- data/{app/types/decidim/proposals → lib/decidim/api}/proposal_input_filter.rb +0 -0
- data/{app/types/decidim/proposals → lib/decidim/api}/proposal_input_sort.rb +3 -5
- data/lib/decidim/api/proposal_type.rb +56 -0
- data/lib/decidim/api/proposals_type.rb +43 -0
- data/lib/decidim/content_renderers/proposal_renderer.rb +1 -1
- data/lib/decidim/proposals.rb +2 -0
- data/lib/decidim/proposals/api.rb +10 -0
- data/lib/decidim/proposals/component.rb +30 -19
- data/lib/decidim/proposals/engine.rb +6 -27
- data/lib/decidim/proposals/proposal_creator.rb +98 -0
- data/lib/decidim/proposals/test/factories.rb +22 -8
- data/lib/decidim/proposals/version.rb +1 -1
- metadata +55 -41
- data/app/commands/decidim/proposals/create_proposal_export.rb +0 -37
- data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +0 -0
- data/app/queries/decidim/proposals/similar_collaborative_drafts.rb +0 -52
- data/app/types/decidim/proposals/proposal_type.rb +0 -70
- data/app/types/decidim/proposals/proposals_type.rb +0 -41
- data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_proposals.html.erb +0 -13
- data/app/views/decidim/proposals/collaborative_drafts/compare.html.erb +0 -21
- data/app/views/decidim/proposals/collaborative_drafts/complete.html.erb +0 -24
- data/app/views/decidim/proposals/proposals/_proposal_preview.html.erb +0 -1
- data/db/migrate/20200915151348_fix_proposals_data_to_ensure_title_and_body_are_hashes.rb +0 -37
@@ -57,9 +57,9 @@ module Decidim
|
|
57
57
|
# Only admin users can publish many answers at once
|
58
58
|
toggle_allow(user.admin?) if permission_action.subject == :proposals && permission_action.action == :publish_answers
|
59
59
|
|
60
|
-
if permission_action.subject == :participatory_texts && participatory_texts_are_enabled?
|
60
|
+
if permission_action.subject == :participatory_texts && participatory_texts_are_enabled? && permission_action.action == :manage
|
61
61
|
# Every user allowed by the space can manage (import, update and publish) participatory texts to proposals
|
62
|
-
allow!
|
62
|
+
allow!
|
63
63
|
end
|
64
64
|
|
65
65
|
permission_action
|
@@ -10,9 +10,10 @@ module Decidim
|
|
10
10
|
return Decidim::Proposals::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin
|
11
11
|
return permission_action if permission_action.scope != :public
|
12
12
|
|
13
|
-
|
13
|
+
case permission_action.subject
|
14
|
+
when :proposal
|
14
15
|
apply_proposal_permissions(permission_action)
|
15
|
-
|
16
|
+
when :collaborative_draft
|
16
17
|
apply_collaborative_draft_permissions(permission_action)
|
17
18
|
else
|
18
19
|
permission_action
|
@@ -38,28 +38,33 @@ module Decidim
|
|
38
38
|
# extras - should include extra hashtags?
|
39
39
|
#
|
40
40
|
# Returns a String.
|
41
|
-
def title(links: false, extras: true, html_escape: false)
|
42
|
-
|
43
|
-
text = decidim_html_escape(text) if html_escape
|
41
|
+
def title(links: false, extras: true, html_escape: false, all_locales: false)
|
42
|
+
return unless proposal
|
44
43
|
|
45
|
-
|
46
|
-
|
44
|
+
handle_locales(proposal.title, all_locales) do |content|
|
45
|
+
content = decidim_html_escape(content) if html_escape
|
46
|
+
|
47
|
+
renderer = Decidim::ContentRenderers::HashtagRenderer.new(content)
|
48
|
+
renderer.render(links: links, extras: extras).html_safe
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
49
52
|
def id_and_title(links: false, extras: true, html_escape: false)
|
50
53
|
"##{proposal.id} - #{title(links: links, extras: extras, html_escape: html_escape)}"
|
51
54
|
end
|
52
55
|
|
53
|
-
def body(links: false, extras: true, strip_tags: false)
|
54
|
-
|
56
|
+
def body(links: false, extras: true, strip_tags: false, all_locales: false)
|
57
|
+
return unless proposal
|
55
58
|
|
56
|
-
|
59
|
+
handle_locales(proposal.body, all_locales) do |content|
|
60
|
+
content = strip_tags(sanitize_text(content)) if strip_tags
|
57
61
|
|
58
|
-
|
59
|
-
|
62
|
+
renderer = Decidim::ContentRenderers::HashtagRenderer.new(content)
|
63
|
+
content = renderer.render(links: links, extras: extras).html_safe
|
60
64
|
|
61
|
-
|
62
|
-
|
65
|
+
content = Decidim::ContentRenderers::LinkRenderer.new(content).render if links
|
66
|
+
content
|
67
|
+
end
|
63
68
|
end
|
64
69
|
|
65
70
|
# Returns the proposal versions, hiding not published answers
|
@@ -95,13 +100,13 @@ module Decidim
|
|
95
100
|
private
|
96
101
|
|
97
102
|
def sanitize_unordered_lists(text)
|
98
|
-
text.gsub(%r{(
|
103
|
+
text.gsub(%r{(?=.*</ul>)(?!.*?<li>.*?</ol>.*?</ul>)<li>}) { |li| "#{li}• " }
|
99
104
|
end
|
100
105
|
|
101
106
|
def sanitize_ordered_lists(text)
|
102
107
|
i = 0
|
103
108
|
|
104
|
-
text.gsub(%r{(
|
109
|
+
text.gsub(%r{(?=.*</ol>)(?!.*?<li>.*?</ul>.*?</ol>)<li>}) do |li|
|
105
110
|
i += 1
|
106
111
|
|
107
112
|
li + "#{i}. "
|
@@ -109,11 +114,11 @@ module Decidim
|
|
109
114
|
end
|
110
115
|
|
111
116
|
def add_line_feeds_to_paragraphs(text)
|
112
|
-
text.gsub("</p>") { |p| p
|
117
|
+
text.gsub("</p>") { |p| "#{p}\n\n" }
|
113
118
|
end
|
114
119
|
|
115
120
|
def add_line_feeds_to_list_items(text)
|
116
|
-
text.gsub("</li>") { |li| li
|
121
|
+
text.gsub("</li>") { |li| "#{li}\n" }
|
117
122
|
end
|
118
123
|
|
119
124
|
# Adds line feeds after the paragraph and list item closing tags.
|
@@ -130,6 +135,20 @@ module Decidim
|
|
130
135
|
def sanitize_text(text)
|
131
136
|
add_line_feeds(sanitize_ordered_lists(sanitize_unordered_lists(text)))
|
132
137
|
end
|
138
|
+
|
139
|
+
def handle_locales(content, all_locales, &block)
|
140
|
+
if all_locales
|
141
|
+
content.each_with_object({}) do |(key, value), parsed_content|
|
142
|
+
parsed_content[key] = if key == "machine_translations"
|
143
|
+
handle_locales(value, all_locales, &block)
|
144
|
+
else
|
145
|
+
block.call(value)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
else
|
149
|
+
yield(translated_attribute(content))
|
150
|
+
end
|
151
|
+
end
|
133
152
|
end
|
134
153
|
end
|
135
154
|
end
|
@@ -17,8 +17,8 @@ module Decidim
|
|
17
17
|
cumulative_users |= retrieve_drafts_followers.pluck(:decidim_user_id)
|
18
18
|
|
19
19
|
quantity_users = []
|
20
|
-
quantity_users |= retrieve_proposals_followers(true).pluck(:decidim_user_id)
|
21
|
-
quantity_users |= retrieve_drafts_followers(true).pluck(:decidim_user_id)
|
20
|
+
quantity_users |= retrieve_proposals_followers(from_start: true).pluck(:decidim_user_id)
|
21
|
+
quantity_users |= retrieve_drafts_followers(from_start: true).pluck(:decidim_user_id)
|
22
22
|
|
23
23
|
{
|
24
24
|
cumulative_users: cumulative_users.uniq,
|
@@ -28,7 +28,7 @@ module Decidim
|
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
def retrieve_proposals_followers(from_start
|
31
|
+
def retrieve_proposals_followers(from_start: false)
|
32
32
|
@proposals_followers ||= Decidim::Follow.where(followable: retrieve_proposals).joins(:user)
|
33
33
|
.where("decidim_follows.created_at <= ?", end_time)
|
34
34
|
|
@@ -37,7 +37,7 @@ module Decidim
|
|
37
37
|
@proposals_followers
|
38
38
|
end
|
39
39
|
|
40
|
-
def retrieve_drafts_followers(from_start
|
40
|
+
def retrieve_drafts_followers(from_start: false)
|
41
41
|
@drafts_followers ||= Decidim::Follow.where(followable: retrieve_collaborative_drafts).joins(:user)
|
42
42
|
.where("decidim_follows.created_at <= ?", end_time)
|
43
43
|
return @drafts_followers.where("decidim_follows.created_at >= ?", start_time) if from_start
|
@@ -19,9 +19,9 @@ module Decidim
|
|
19
19
|
cumulative_users |= retrieve_proposals.pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
|
20
20
|
|
21
21
|
quantity_users = []
|
22
|
-
quantity_users |= retrieve_votes(true).pluck(:decidim_author_id)
|
23
|
-
quantity_users |= retrieve_endorsements(true).pluck(:decidim_author_id)
|
24
|
-
quantity_users |= retrieve_proposals(true).pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
|
22
|
+
quantity_users |= retrieve_votes(from_start: true).pluck(:decidim_author_id)
|
23
|
+
quantity_users |= retrieve_endorsements(from_start: true).pluck(:decidim_author_id)
|
24
|
+
quantity_users |= retrieve_proposals(from_start: true).pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
|
25
25
|
|
26
26
|
{
|
27
27
|
cumulative_users: cumulative_users.uniq,
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
-
def retrieve_proposals(from_start
|
34
|
+
def retrieve_proposals(from_start: false)
|
35
35
|
@proposals ||= Decidim::Proposals::Proposal.where(component: @resource).joins(:coauthorships)
|
36
36
|
.includes(:votes, :endorsements)
|
37
37
|
.where(decidim_coauthorships: {
|
@@ -49,7 +49,7 @@ module Decidim
|
|
49
49
|
@proposals
|
50
50
|
end
|
51
51
|
|
52
|
-
def retrieve_votes(from_start
|
52
|
+
def retrieve_votes(from_start: false)
|
53
53
|
@votes ||= Decidim::Proposals::ProposalVote.joins(:proposal).where(proposal: retrieve_proposals).joins(:author)
|
54
54
|
.where("decidim_proposals_proposal_votes.created_at <= ?", end_time)
|
55
55
|
|
@@ -58,7 +58,7 @@ module Decidim
|
|
58
58
|
@votes
|
59
59
|
end
|
60
60
|
|
61
|
-
def retrieve_endorsements(from_start
|
61
|
+
def retrieve_endorsements(from_start: false)
|
62
62
|
@endorsements ||= Decidim::Endorsement.joins("INNER JOIN decidim_proposals_proposals proposals ON resource_id = proposals.id")
|
63
63
|
.where(resource: retrieve_proposals)
|
64
64
|
.where("decidim_endorsements.created_at <= ?", end_time)
|
@@ -42,15 +42,7 @@ module Decidim
|
|
42
42
|
# Returns and Array of two Strings.
|
43
43
|
def parse_values(attribute, values)
|
44
44
|
values = [amended_previous_value(attribute), values[1]] if proposal&.emendation?
|
45
|
-
if attribute == :body
|
46
|
-
values = values.map do |value|
|
47
|
-
if value.is_a?(Hash)
|
48
|
-
value.values.map { |subvalue| normalize_line_endings(subvalue) }
|
49
|
-
else
|
50
|
-
normalize_line_endings(value)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
45
|
+
values = values.map { |value| normalize_line_endings(value) } if attribute == :body
|
54
46
|
values
|
55
47
|
end
|
56
48
|
|
@@ -66,8 +58,12 @@ module Decidim
|
|
66
58
|
end
|
67
59
|
|
68
60
|
# Returns a String with the newline escape sequences normalized.
|
69
|
-
def normalize_line_endings(
|
70
|
-
|
61
|
+
def normalize_line_endings(value)
|
62
|
+
if value.is_a?(Hash)
|
63
|
+
value.values.map { |subvalue| normalize_line_endings(subvalue) }
|
64
|
+
else
|
65
|
+
Decidim::ContentParsers::NewlineParser.new(value, context: {}).rewrite
|
66
|
+
end
|
71
67
|
end
|
72
68
|
|
73
69
|
def proposal
|
@@ -20,7 +20,8 @@ class ProposalLengthValidator < ActiveModel::EachValidator
|
|
20
20
|
if min && min.positive? && value.length < min
|
21
21
|
record.errors.add(
|
22
22
|
attribute,
|
23
|
-
options[:message] || :too_short
|
23
|
+
options[:message] || :too_short,
|
24
|
+
count: min
|
24
25
|
)
|
25
26
|
end
|
26
27
|
end
|
@@ -31,7 +32,8 @@ class ProposalLengthValidator < ActiveModel::EachValidator
|
|
31
32
|
if max && max.positive? && value.length > max
|
32
33
|
record.errors.add(
|
33
34
|
attribute,
|
34
|
-
options[:message] || :too_long
|
35
|
+
options[:message] || :too_long,
|
36
|
+
count: max
|
35
37
|
)
|
36
38
|
end
|
37
39
|
end
|
@@ -5,12 +5,19 @@
|
|
5
5
|
<% if component_settings.participatory_texts_enabled? %>
|
6
6
|
<%= link_to t("actions.participatory_texts", scope: "decidim.proposals"), participatory_texts_path, id: "participatory_texts", class: "button tiny button--simple" %>
|
7
7
|
<% end %>
|
8
|
-
<%= link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path, class: "button tiny button--simple" if allowed_to? :import, :proposals %>
|
9
8
|
|
10
9
|
<% if allowed_to? :export, :proposals %>
|
11
10
|
<%= export_dropdown %>
|
12
11
|
<% end %>
|
13
12
|
|
13
|
+
<% if allowed_to? :import, :proposals %>
|
14
|
+
<%= import_dropdown do %>
|
15
|
+
<% content_tag :li do %>
|
16
|
+
<% link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path %>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
|
14
21
|
<% if allowed_to? :create, :proposal %>
|
15
22
|
<%= link_to t("actions.new", scope: "decidim.proposals"), new_proposal_path, class: "button tiny button--simple" %>
|
16
23
|
<% end %>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
<div class="card-section">
|
7
7
|
<div class="row column hashtags__container">
|
8
|
-
<%= form.translated :text_field, :title, class: "js-hashtags",
|
8
|
+
<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div class="row column hashtags__container">
|
12
|
-
<%= form.translated :editor, :body, hashtaggable: true
|
12
|
+
<%= form.translated :editor, :body, hashtaggable: true %>
|
13
13
|
</div>
|
14
14
|
|
15
15
|
<% if @form.component_automatic_hashtags.any? %>
|
@@ -84,6 +84,12 @@
|
|
84
84
|
|
85
85
|
<div class="row column">
|
86
86
|
<%= form.upload :file, optional: false %>
|
87
|
+
<% if params[:id].present? %>
|
88
|
+
<% if proposal.documents.present? %>
|
89
|
+
<%= form.hidden_field :id, value: proposal.documents.first.id %>
|
90
|
+
<%= form.check_box :delete_file, label: t(".delete_attachment"), value: proposal.documents.first.id %>
|
91
|
+
<% end %>
|
92
|
+
<% end %>
|
87
93
|
</div>
|
88
94
|
<% end %>
|
89
95
|
</fieldset>
|
@@ -16,9 +16,11 @@
|
|
16
16
|
<%= translated_attribute proposal.category.name %>
|
17
17
|
<% end %>
|
18
18
|
</td>
|
19
|
+
|
19
20
|
<%= td_resource_scope_for(proposal.scope) %>
|
21
|
+
|
20
22
|
<td>
|
21
|
-
<strong class="<%= proposal_state_css_class proposal
|
23
|
+
<strong class="<%= proposal_state_css_class proposal %>">
|
22
24
|
<%= t("decidim/amendment", scope: "activerecord.models", count: 1) if proposal.emendation? %>
|
23
25
|
<%= proposal_complete_state proposal %>
|
24
26
|
</strong>
|
@@ -61,6 +63,8 @@
|
|
61
63
|
<td class="table-list__actions">
|
62
64
|
<% if allowed_to? :edit, :proposal, proposal: proposal %>
|
63
65
|
<%= icon_link_to "pencil", edit_proposal_path(proposal), t("actions.edit_proposal", scope: "decidim.proposals"), class: "action-icon--edit-proposal" %>
|
66
|
+
<% else %>
|
67
|
+
<span class="action-space icon"></span>
|
64
68
|
<% end %>
|
65
69
|
|
66
70
|
<%= icon_with_link_to_proposal(proposal) %>
|
@@ -2,17 +2,12 @@
|
|
2
2
|
<div class="m-bottom">
|
3
3
|
<%= link_to :back do %>
|
4
4
|
<%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
|
5
|
-
<%=
|
5
|
+
<%= t("back_from_collaborative_draft", scope: "decidim.proposals.collaborative_drafts.wizard_aside").html_safe %>
|
6
6
|
<% end %>
|
7
7
|
</div>
|
8
8
|
<div class="section">
|
9
9
|
<p>
|
10
|
-
<%=
|
10
|
+
<%= t("info", scope: "decidim.proposals.collaborative_drafts.wizard_aside").html_safe %>
|
11
11
|
</p>
|
12
12
|
</div>
|
13
|
-
<div class="show-for-large">
|
14
|
-
<div><%= proposal_wizard_steps_title %></div>
|
15
|
-
<div><%= proposal_wizard_current_step_of(@step) %></div>
|
16
|
-
<%= proposal_wizard_stepper(@step) %>
|
17
|
-
</div>
|
18
13
|
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if translated_attribute(component_settings.new_proposal_help_text).present? %>
|
2
|
+
<%= cell("decidim/announcement", component_settings.new_proposal_help_text) %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% if proposal_wizard_step_help_text?(@step) %>
|
6
|
+
<div class="proposal_wizard_help_text">
|
7
|
+
<% callout_step_help_text_class ||= nil %>
|
8
|
+
<%= cell("decidim/announcement", component_settings.try("proposal_wizard_#{@step}_help_text"), callout_class: callout_step_help_text_class) %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<h2 class="section-heading">
|
13
|
+
<%= t(".title") %>
|
14
|
+
</h2>
|
@@ -1,19 +1,19 @@
|
|
1
1
|
<% add_decidim_page_title(proposal_wizard_step_title(action_name)) %>
|
2
2
|
|
3
3
|
<div class="row columns">
|
4
|
-
|
5
|
-
<%=
|
6
|
-
|
7
|
-
|
4
|
+
<div class="m-bottom">
|
5
|
+
<%= link_to :back, class: "muted-link" do %>
|
6
|
+
<%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
|
7
|
+
<%= t(".back") %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
8
10
|
<h2 class="section-heading"><%= t(".title") %></h2>
|
9
11
|
</div>
|
10
12
|
|
11
13
|
<div class="row">
|
12
14
|
<div class="columns large-6 medium-centered">
|
13
15
|
<div class="card">
|
14
|
-
|
15
|
-
<%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.new_proposal_help_text } %>
|
16
|
-
<% end %>
|
16
|
+
<%= cell("decidim/announcement", component_settings.new_proposal_help_text) %>
|
17
17
|
|
18
18
|
<div class="card__content">
|
19
19
|
<%= decidim_form_for(@form) do |form| %>
|
@@ -1,26 +1,18 @@
|
|
1
|
-
<% add_decidim_page_title(
|
1
|
+
<% add_decidim_page_title(t("decidim.proposals.collaborative_drafts.wizard_header.title")) %>
|
2
2
|
|
3
3
|
<div class="row">
|
4
4
|
<%= render partial: "wizard_aside" %>
|
5
5
|
|
6
6
|
<div class="columns large-6">
|
7
|
-
<%= render partial: "
|
7
|
+
<%= render partial: "wizard_header" %>
|
8
8
|
|
9
9
|
<div class="card">
|
10
10
|
<div class="card__content">
|
11
|
-
<%= decidim_form_for(@form
|
12
|
-
<%=
|
13
|
-
|
14
|
-
<div class="field">
|
15
|
-
<%= form.text_field :title %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="field">
|
19
|
-
<%= form.text_area :body, rows: 10 %>
|
20
|
-
</div>
|
11
|
+
<%= decidim_form_for(@form) do |form| %>
|
12
|
+
<%= render partial: "edit_form_fields", locals: { form: form } %>
|
21
13
|
|
22
14
|
<div class="actions">
|
23
|
-
<%= form.submit t("
|
15
|
+
<%= form.submit t(".send"), class: "button expanded mt-s mb-none", data: { disable: true } %>
|
24
16
|
</div>
|
25
17
|
<% end %>
|
26
18
|
</div>
|