decidim-participatory_processes 0.9.0 → 0.9.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: 1df8a831dee4cc738d27694e65664a53a8b8c04619b6f60e3dba73f1262faf69
4
- data.tar.gz: 34743fee16f5a1f78d4d31a7ec0e81001d905ce1a05858c7eb158a7f4f6a6bbb
3
+ metadata.gz: 10ae89f350c69e8b3c13b8b2cd130d46c808ecfe67539a79d1a36364b1ed0c7d
4
+ data.tar.gz: 4ede2142cd578c57d4001744e8482e5f7b04e8467315be5a8c37c6542e449aaf
5
5
  SHA512:
6
- metadata.gz: 2bcb9ec0d0ca2141124311aa31ec2bdbcf20982cfa694c4337f1802d52f6a2213d65120c443dee103081367e3559ed14ff9c22bc971e248da8f5a972f1554b24
7
- data.tar.gz: 5a343e65a82f8212d5a15d108a38ee0c2c78baef42d4aa3185bf3b9fda8ce91e380cd1d1dcceb76f355a722fe4629b40b0de87864e5928bdb3d64b1ec9e265a9
6
+ metadata.gz: 50c21326fb9f4b0c5c3b64a6812908f426373684b7cec96493e16433d698f715898b69b4a0c529177fff6f5f4022dc1f6fc4901e8583b047255c2a67aa60a1e0
7
+ data.tar.gz: dd6e3fe9186afa9e5cf18b3a16adc4be64bbd17b8e11c5b7cdf5b6b510c5b336c7571908c97c55a5c8279304bdfdf871819004d0d25d7ea127b89d17ac1ea23c
@@ -31,7 +31,7 @@ module Decidim
31
31
 
32
32
  def detect_current_participatory_process(params)
33
33
  organization_processes.where(slug: params["participatory_process_slug"]).or(
34
- organization_processes.where(id: params["participatory_process_id"])
34
+ organization_processes.where(id: params["participatory_process_slug"])
35
35
  ).first!
36
36
  end
37
37
 
@@ -101,7 +101,7 @@ module Decidim
101
101
 
102
102
  def participatory_process_params
103
103
  {
104
- id: params[:id],
104
+ id: params[:slug],
105
105
  hero_image: current_participatory_process.hero_image,
106
106
  banner_image: current_participatory_process.banner_image
107
107
  }.merge(params[:participatory_process].to_unsafe_h)
@@ -17,7 +17,11 @@ module Decidim
17
17
  end
18
18
 
19
19
  def current_participatory_space
20
- @current_participatory_space ||= organization_participatory_processes.find_by(slug: params[:participatory_process_slug])
20
+ return unless params[:participatory_process_slug]
21
+
22
+ @current_participatory_space ||= organization_participatory_processes.where(slug: params[:participatory_process_slug]).or(
23
+ organization_participatory_processes.where(id: params[:participatory_process_slug])
24
+ ).first!
21
25
  end
22
26
  end
23
27
  end
@@ -8,7 +8,11 @@ module Decidim
8
8
  private
9
9
 
10
10
  def model
11
- @model ||= ParticipatoryProcess.where(slug: params[:participatory_process_slug]).first
11
+ return unless params[:participatory_process_slug]
12
+
13
+ @model ||= ParticipatoryProcess.where(slug: params[:participatory_process_slug]).or(
14
+ ParticipatoryProcess.where(id: params[:participatory_process_slug])
15
+ ).first!
12
16
  end
13
17
 
14
18
  def current_participatory_space
@@ -33,7 +33,11 @@ module Decidim
33
33
  end
34
34
 
35
35
  def current_participatory_space
36
- @current_participatory_space ||= organization_participatory_processes.find_by(slug: params[:slug])
36
+ return unless params["slug"]
37
+
38
+ @current_participatory_space ||= organization_participatory_processes.where(slug: params["slug"]).or(
39
+ organization_participatory_processes.where(id: params["slug"])
40
+ ).first!
37
41
  end
38
42
 
39
43
  def published_processes
@@ -65,7 +65,9 @@ module Decidim
65
65
  initializer "decidim_participatory_processes.view_hooks" do
66
66
  Decidim.view_hooks.register(:highlighted_elements, priority: Decidim::ViewHooks::HIGH_PRIORITY) do |view_context|
67
67
  highlighted_processes =
68
- OrganizationPublishedParticipatoryProcesses.new(view_context.current_organization) | HighlightedParticipatoryProcesses.new
68
+ OrganizationPublishedParticipatoryProcesses.new(view_context.current_organization) |
69
+ HighlightedParticipatoryProcesses.new |
70
+ FilteredParticipatoryProcesses.new("active")
69
71
 
70
72
  next unless highlighted_processes.any?
71
73
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-participatory_processes version.
5
5
  module ParticipatoryProcesses
6
6
  def self.version
7
- "0.9.0"
7
+ "0.9.1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-participatory_processes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-02-05 00:00:00.000000000 Z
13
+ date: 2018-02-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.9.0
21
+ version: 0.9.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.9.0
28
+ version: 0.9.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-admin
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.9.0
35
+ version: 0.9.1
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.9.0
42
+ version: 0.9.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-dev
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.9.0
49
+ version: 0.9.1
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.9.0
56
+ version: 0.9.1
57
57
  description: Participatory processes component for decidim.
58
58
  email:
59
59
  - josepjaume@gmail.com