decidim-plans 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_plans_manifest.css +1 -0
- data/app/assets/stylesheets/decidim/plans/versions.scss +9 -0
- data/app/helpers/decidim/plans/traceability_helper.rb +24 -0
- data/app/views/decidim/plans/versions/show.html.erb +2 -0
- data/db/migrate/20190603211538_change_plans_related_proposals_to_resource_links.rb +8 -0
- data/lib/decidim/plans/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe8b383772e49e09ace49f90f5b0bb9e931704d399df1ecf521102e84486043f
|
4
|
+
data.tar.gz: 64258a1add5488e8d69e3d28478500505e26ca360817c14dbd432973ab4ec8e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f09fa27fb446c4f0f9cc615cfd7f1033519a51337129a3295052b952d0ab11a42b9f2a59e89feb94442d5c9a52bd4f8f79990a338076e4e26d7edb03331daf6f
|
7
|
+
data.tar.gz: c5f0d16abb8018020d4d9e6c45def7fba015a3e9f86dd971c88b796e58c8263dbc1b018ff54c298db6314a978bdccb2144f2e440139f1eabef0b72752fde66fd
|
@@ -29,6 +29,30 @@ module Decidim
|
|
29
29
|
item_diff_renderers + associated_diff_renderers + content_diff_renderers
|
30
30
|
end
|
31
31
|
|
32
|
+
# Renders the diff between `:old_data` and `:new_data` keys in the `data` param.
|
33
|
+
#
|
34
|
+
# data - A Hash with `old_data`, `:new_data` and `:type` keys.
|
35
|
+
#
|
36
|
+
# Returns an HTML-safe string.
|
37
|
+
def render_diff_data(data)
|
38
|
+
content_tag(:div, class: "card card--list diff diff-#{data[:type]}") do
|
39
|
+
if [:i18n, :i18n_html].include?(data[:type])
|
40
|
+
render_diff_value(
|
41
|
+
" ",
|
42
|
+
data[:type],
|
43
|
+
nil,
|
44
|
+
data: {
|
45
|
+
old_value: data[:old_value].to_s.gsub("</p>", "</p>\n"),
|
46
|
+
new_value: data[:new_value].to_s.gsub("</p>", "</p>\n")
|
47
|
+
}
|
48
|
+
)
|
49
|
+
else
|
50
|
+
render_diff_value(data[:old_value], data[:type], :removal) +
|
51
|
+
render_diff_value(data[:new_value], data[:type], :addition)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
32
56
|
private
|
33
57
|
|
34
58
|
def renderer_for(version)
|
@@ -10,6 +10,14 @@ class ChangePlansRelatedProposalsToResourceLinks < ActiveRecord::Migration[5.2]
|
|
10
10
|
|
11
11
|
say("Linking proposals for plan: #{plan.id}")
|
12
12
|
|
13
|
+
# In case the plan has been moved from one participatory space to another,
|
14
|
+
# it may not have the correct mapping with the proposal. Make sure we are
|
15
|
+
# not linking them as that would cause the migration to fail.
|
16
|
+
proposal_ids = proposal_ids.select do |pid|
|
17
|
+
p = Decidim::Proposals::Proposal.find(pid)
|
18
|
+
p.participatory_space == plan.participatory_space
|
19
|
+
end
|
20
|
+
|
13
21
|
next unless proposal_ids.count.positive?
|
14
22
|
|
15
23
|
say("--Proposal IDs: #{proposal_ids.join(",")}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-plans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antti Hukkanen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- app/assets/stylesheets/decidim/plans/plans_form.scss
|
137
137
|
- app/assets/stylesheets/decidim/plans/proposal_picker.scss
|
138
138
|
- app/assets/stylesheets/decidim/plans/social_share.css.scss
|
139
|
+
- app/assets/stylesheets/decidim/plans/versions.scss
|
139
140
|
- app/cells/decidim/plans/author/flag.erb
|
140
141
|
- app/cells/decidim/plans/author/withdraw.erb
|
141
142
|
- app/cells/decidim/plans/author_cell.rb
|