decidim-proposals 0.26.5 → 0.26.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/proposals/collaborative_draft_m_cell.rb +1 -1
- data/app/commands/decidim/proposals/admin/notify_proposal_answer.rb +2 -0
- data/app/helpers/decidim/proposals/application_helper.rb +14 -3
- data/app/helpers/decidim/proposals/proposals_helper.rb +1 -1
- data/app/views/decidim/proposals/admin/participatory_texts/_article-preview.html.erb +2 -2
- data/app/views/decidim/proposals/admin/proposals/edit.html.erb +1 -0
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -0
- data/app/views/decidim/proposals/admin/proposals/new.html.erb +1 -0
- data/app/views/decidim/proposals/admin/proposals/show.html.erb +1 -0
- data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +2 -1
- data/config/environment.rb +0 -0
- data/config/locales/ar.yml +254 -2
- data/config/locales/bg.yml +5 -0
- data/config/locales/ca.yml +4 -4
- data/config/locales/cs.yml +1 -1
- data/config/locales/de.yml +51 -5
- data/config/locales/el.yml +140 -2
- data/config/locales/es-MX.yml +5 -5
- data/config/locales/es-PY.yml +5 -5
- data/config/locales/es.yml +3 -3
- data/config/locales/eu.yml +39 -41
- data/config/locales/fa-IR.yml +1 -0
- data/config/locales/fi-plain.yml +5 -5
- data/config/locales/fi.yml +9 -9
- data/config/locales/fr-CA.yml +6 -8
- data/config/locales/fr.yml +6 -8
- data/config/locales/gl.yml +2 -2
- data/config/locales/hu.yml +52 -4
- data/config/locales/id-ID.yml +10 -2
- data/config/locales/is-IS.yml +15 -6
- data/config/locales/it.yml +5 -7
- data/config/locales/ja.yml +16 -16
- data/config/locales/kaa.yml +1 -0
- data/config/locales/lt.yml +0 -2
- data/config/locales/lv.yml +7 -2
- data/config/locales/nl.yml +9 -7
- data/config/locales/no.yml +4 -3
- data/config/locales/pl.yml +0 -2
- data/config/locales/pt-BR.yml +2 -2
- data/config/locales/pt.yml +1 -3
- data/config/locales/ro-RO.yml +0 -2
- data/config/locales/ru.yml +15 -7
- data/config/locales/sk.yml +8 -3
- data/config/locales/sl.yml +0 -3
- data/config/locales/sv.yml +2 -4
- data/config/locales/tr-TR.yml +2 -4
- data/config/locales/uk.yml +15 -7
- data/config/locales/zh-CN.yml +3 -2
- data/config/locales/zh-TW.yml +964 -0
- data/db/migrate/20181003074440_fix_user_groups_ids_in_proposals_endorsements.rb +9 -2
- data/db/migrate/20200708091228_move_proposals_fields_to_i18n.rb +28 -18
- data/db/migrate/20201002085508_fix_proposals_data.rb +25 -13
- data/lib/decidim/proposals/component.rb +7 -6
- data/lib/decidim/proposals/engine.rb +6 -0
- data/lib/decidim/proposals/import/proposal_answer_creator.rb +31 -23
- data/lib/decidim/proposals/proposal_serializer.rb +9 -1
- data/lib/decidim/proposals/version.rb +1 -1
- data/lib/tasks/proposals/upgrade/decdim_proposal_upgrade_tasks.rake +34 -0
- metadata +36 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 588c96a2c88b8b1844e6107d7a00ecacb1623d5f46268ae0a99e2ef52d352bae
|
4
|
+
data.tar.gz: 62e899178f283b1832942df2632bd1fff663d2120da121aa84b4f68c6857665c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4410a1db3510d522a2e83680604365c844fb09fd687a6787715b2213ddaf70c682913cd91d5f3a3184a5edfe4aa3b02156446e05ba151d856c83e6ccf6bb8c53
|
7
|
+
data.tar.gz: a5318b533d9dcf55e5967962a0ad9688ef0bdb825b2c96ad99d60d9bed4a4ba5c06f8e922fd3150c7c9b09add1259215a15ad317a5610e8570c51a4a511daada
|
@@ -96,13 +96,24 @@ module Decidim
|
|
96
96
|
# frontend, the proposal body is considered as safe content; that's unless
|
97
97
|
# the proposal comes from a collaborative_draft or a participatory_text.
|
98
98
|
def safe_content?
|
99
|
-
rich_text_editor_in_public_views? && not_from_collaborative_draft(@proposal) ||
|
100
|
-
|
99
|
+
(rich_text_editor_in_public_views? && not_from_collaborative_draft(@proposal)) ||
|
100
|
+
safe_content_admin?
|
101
|
+
end
|
102
|
+
|
103
|
+
# For admin entered content, the proposal body can contain certain extra
|
104
|
+
# tags, such as iframes.
|
105
|
+
def safe_content_admin?
|
106
|
+
(@proposal.official? || @proposal.official_meeting?) && not_from_participatory_text(@proposal)
|
101
107
|
end
|
102
108
|
|
103
109
|
# If the content is safe, HTML tags are sanitized, otherwise, they are stripped.
|
104
110
|
def render_proposal_body(proposal)
|
105
|
-
|
111
|
+
sanitized = render_sanitized_content(proposal, :body)
|
112
|
+
if safe_content?
|
113
|
+
Decidim::ContentProcessor.render_without_format(sanitized).html_safe
|
114
|
+
else
|
115
|
+
Decidim::ContentProcessor.render(sanitized, "div")
|
116
|
+
end
|
106
117
|
end
|
107
118
|
|
108
119
|
# Returns :text_area or :editor based on the organization' settings.
|
@@ -7,7 +7,7 @@ module Decidim
|
|
7
7
|
def proposal_reason_callout_announcement
|
8
8
|
{
|
9
9
|
title: proposal_reason_callout_title,
|
10
|
-
body:
|
10
|
+
body: decidim_sanitize_editor_admin(translated_attribute(@proposal.answer))
|
11
11
|
}
|
12
12
|
end
|
13
13
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<div class="grid-x">
|
2
2
|
<div class="cell">
|
3
3
|
<%= form.hidden_field :position, class: "position" %>
|
4
|
-
<%= form.text_field :title,
|
4
|
+
<%= form.text_field :title, required: true %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
7
|
<% if proposal.article? %>
|
8
8
|
<div class="grid-x">
|
9
9
|
<div class="cell">
|
10
|
-
<%= form.text_area :body,
|
10
|
+
<%= form.text_area :body, required: true, rows: 5 %>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<div class="field hashtags__container">
|
8
|
-
<%= form
|
8
|
+
<%= text_editor_for_proposal_body(form) %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<% if @form.component_automatic_hashtags.any? %>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<div class="section">
|
34
34
|
<%== cell("decidim/proposals/collaborative_draft_m", @collaborative_draft, full_badge: true).badge %>
|
35
35
|
|
36
|
-
<%=
|
36
|
+
<%= decidim_sanitize_editor present(@collaborative_draft).body(links: true) %>
|
37
37
|
|
38
38
|
<% if component_settings.geocoding_enabled? %>
|
39
39
|
<%= render partial: "decidim/shared/static_map", locals: { icon_name: "proposals", geolocalizable: @collaborative_draft } %>
|
@@ -22,7 +22,8 @@
|
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
|
-
<% if !current_settings.try(:votes_hidden?) && !proposal.component.current_settings.votes_hidden?
|
25
|
+
<% if !current_settings.try(:votes_hidden?) && !proposal.component.current_settings.votes_hidden? &&
|
26
|
+
proposal.component.current_settings.votes_enabled? %>
|
26
27
|
<div class="card--list__data">
|
27
28
|
<span class="card--list__data__number">
|
28
29
|
<%= proposal.votes.size %>
|
File without changes
|