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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc3cbcb541b346a6c051e02730b71db96b825f98e46b1080e747564dd50b494a
4
- data.tar.gz: 80e56f77fac5615ae9782c09b60bef63802bf05d7404f1f6c85e153c78ab740c
3
+ metadata.gz: fe8b383772e49e09ace49f90f5b0bb9e931704d399df1ecf521102e84486043f
4
+ data.tar.gz: 64258a1add5488e8d69e3d28478500505e26ca360817c14dbd432973ab4ec8e8
5
5
  SHA512:
6
- metadata.gz: b8cd2fcb3e1ed87bc7ba160222f90db3f3ae13dc25b36c6321bfb904d959c1aeb3e1d66625d66c0ead068b60d4863781bde8694228f4985b619437d376ffdaeb
7
- data.tar.gz: 7cac303735e627438c4861978e901025b5651e49debdcb4d22a70c51461173c855859722499f8844f2ca76b0ad634a319133f711ee5d16ade33675f58e1b5298
6
+ metadata.gz: f09fa27fb446c4f0f9cc615cfd7f1033519a51337129a3295052b952d0ab11a42b9f2a59e89feb94442d5c9a52bd4f8f79990a338076e4e26d7edb03331daf6f
7
+ data.tar.gz: c5f0d16abb8018020d4d9e6c45def7fba015a3e9f86dd971c88b796e58c8263dbc1b018ff54c298db6314a978bdccb2144f2e440139f1eabef0b72752fde66fd
@@ -1,4 +1,5 @@
1
1
  /*
2
2
  *= link decidim/plans/proposal_picker.scss
3
3
  *= link decidim/plans/plans_form.scss
4
+ *= link decidim/plans/versions.scss
4
5
  */
@@ -0,0 +1,9 @@
1
+ .diff{
2
+ .addition{
3
+ background-color: #e6ffed;
4
+ }
5
+
6
+ .removal{
7
+ background-color: #ffeef0;
8
+ }
9
+ }
@@ -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)
@@ -39,3 +39,5 @@
39
39
  </div>
40
40
  </div>
41
41
  </div>
42
+
43
+ <%= stylesheet_link_tag "decidim/plans/versions" %>
@@ -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(",")}")
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Plans
5
- VERSION = "0.18.0"
5
+ VERSION = "0.18.1"
6
6
  DECIDIM_VERSION = "~> 0.18.0"
7
7
  end
8
8
  end
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.0
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-08-28 00:00:00.000000000 Z
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