decidim-plans 0.16.2 → 0.16.3

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: 7e8c60c3aad835eee3789f5d65146952a7233b0375cef797fbfb221d44954354
4
- data.tar.gz: 0e6c025fefdedf2d8056244a10103cdd8e82a70f89817dfa415065be08a058d7
3
+ metadata.gz: 89daec1bca29a601922a38e6eaac70f669272784d23cefa2ad74e0d4f7fad1ad
4
+ data.tar.gz: 363a50ba655819e2ddc02a30972083d21650aa4bdc686a0396dbcb6aabddcbc5
5
5
  SHA512:
6
- metadata.gz: 3b4eed8d262f4da32503813c798e52a4cc3ca2fe8f8f731478b36d60d6e887df09a14f20471c56e76bdca29221836d66c123418d54c443a3966f60d8b9ffb23b
7
- data.tar.gz: 6efc6bdb4c26729630870b7147615297dd2bde7861f5d3ea60f9655b0459740426f62ac056a335f94dd55cb17c789402e5b3cceb42ced92e6bcb6a25deb03643
6
+ metadata.gz: 408c5f2d9daf2adb71255c90ae28d0e5d739a6177db4c93c607fcf5968c508126ea32c9f417ab765cbc169483881615a3252110eecdcad05f8d0a2874c1313a9
7
+ data.tar.gz: 3f1863c3c6ad6b929b57803beb447f06ca3e32044c0ca391b6f8d74e6489f8a7043466962f18ac03f5d29671a2749f1c8554dee7990314a90e7e67b8b9de332b
@@ -19,7 +19,7 @@ module Decidim
19
19
 
20
20
  optionally_translatable_validate_presence :title
21
21
 
22
- validates :proposals, presence: true
22
+ validates :proposals, presence: true, if: ->(form) { form.current_component.settings.proposal_linking_enabled? }
23
23
  validates :category, presence: true, if: ->(form) { form.category_id.present? }
24
24
  validates :scope, presence: true, if: ->(form) { form.scope_id.present? }
25
25
 
@@ -18,7 +18,7 @@ module Decidim
18
18
  attribute :contents, Array[ContentForm]
19
19
  attribute :proposal_ids, Array[Integer]
20
20
 
21
- validates :proposals, presence: true
21
+ validates :proposals, presence: true, if: ->(form) { form.current_component.settings.proposal_linking_enabled? }
22
22
  validates :category, presence: true, if: ->(form) { form.category_id.present? }
23
23
  validates :scope, presence: true, if: ->(form) { form.scope_id.present? }
24
24
  optionally_translatable_validate_presence :title
@@ -11,12 +11,14 @@ form.multipart = true
11
11
  </div>
12
12
 
13
13
  <div class="card-section">
14
- <div class="row column">
15
- <%= attached_proposals_picker_field form, :proposals %>
16
- </div>
14
+ <% if component_settings.proposal_linking_enabled? %>
15
+ <div class="row column">
16
+ <%= attached_proposals_picker_field form, :proposals %>
17
+ </div>
17
18
 
18
- <%= javascript_include_tag "decidim/plans/proposal_picker" %>
19
- <%= stylesheet_link_tag "decidim/plans/proposal_picker" %>
19
+ <%= javascript_include_tag "decidim/plans/proposal_picker" %>
20
+ <%= stylesheet_link_tag "decidim/plans/proposal_picker" %>
21
+ <% end %>
20
22
 
21
23
  <div class="row column">
22
24
  <%= remaining_characters("plans_title", component_settings.plan_title_length) do |opts| %>
@@ -33,15 +35,15 @@ form.multipart = true
33
35
  <% end %>
34
36
  </div>
35
37
 
36
- <% if @form.categories&.any? %>
38
+ <% if component_settings.scopes_enabled? && current_participatory_space.has_subscopes? %>
37
39
  <div class="row column">
38
- <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
40
+ <%= scopes_picker_field form, :scope_id %>
39
41
  </div>
40
42
  <% end %>
41
43
 
42
- <% if current_participatory_space.has_subscopes? %>
44
+ <% if component_settings.categories_enabled? && @form.categories&.any? %>
43
45
  <div class="row column">
44
- <%= scopes_picker_field form, :scope_id %>
46
+ <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
45
47
  </div>
46
48
  <% end %>
47
49
 
@@ -11,12 +11,14 @@ form.multipart = true
11
11
  </div>
12
12
  <% end %>
13
13
 
14
- <div class="row column">
15
- <%= attached_proposals_picker_field form, :proposals %>
16
- </div>
14
+ <% if component_settings.proposal_linking_enabled? %>
15
+ <div class="row column">
16
+ <%= attached_proposals_picker_field form, :proposals %>
17
+ </div>
17
18
 
18
- <%= javascript_include_tag "decidim/plans/proposal_picker" %>
19
- <%= stylesheet_link_tag "decidim/plans/proposal_picker" %>
19
+ <%= javascript_include_tag "decidim/plans/proposal_picker" %>
20
+ <%= stylesheet_link_tag "decidim/plans/proposal_picker" %>
21
+ <% end %>
20
22
 
21
23
  <div class="field">
22
24
  <%= remaining_characters("plans_title", component_settings.plan_title_length) do |opts| %>
@@ -33,15 +35,15 @@ form.multipart = true
33
35
  <% end %>
34
36
  </div>
35
37
 
36
- <% if @form.categories&.any? %>
38
+ <% if component_settings.scopes_enabled? && current_participatory_space.has_subscopes? %>
37
39
  <div class="field">
38
- <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
40
+ <%= scopes_picker_field form, :scope_id %>
39
41
  </div>
40
42
  <% end %>
41
43
 
42
- <% if current_participatory_space.has_subscopes? %>
44
+ <% if component_settings.categories_enabled? && @form.categories&.any? %>
43
45
  <div class="field">
44
- <%= scopes_picker_field form, :scope_id %>
46
+ <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
45
47
  </div>
46
48
  <% end %>
47
49
 
@@ -34,10 +34,13 @@ en:
34
34
  global:
35
35
  announcement: Announcement
36
36
  attachments_allowed: Attachments allowed
37
+ categories_enabled: Categories enabled
37
38
  comments_enabled: Comments enabled
38
39
  multilingual_answers: Multilingual answers
39
40
  plan_answering_enabled: Answering enabled
40
41
  plan_title_length: Title length
42
+ proposal_linking_enabled: Proposal linking enabled
43
+ scopes_enabled: Scopes enabled
41
44
  step:
42
45
  announcement: Announcement
43
46
  comments_blocked: Comments blocked
@@ -33,10 +33,13 @@ fi:
33
33
  global:
34
34
  announcement: Ilmoitus
35
35
  attachments_allowed: Liitteet sallittu
36
+ categories_enabled: Kategoriat käytössä
36
37
  comments_enabled: Kommentointi sallittu
37
38
  multilingual_answers: Monikieliset vastaukset
38
39
  plan_answering_enabled: Vastaaminen sallittu
39
40
  plan_title_length: Otsikon pituus
41
+ proposal_linking_enabled: Ehdotusten linkkaaminen käytössä
42
+ scopes_enabled: Teemat käytössä
40
43
  step:
41
44
  announcement: Ilmoitus
42
45
  comments_blocked: Kommentointi estetty
@@ -33,10 +33,13 @@ sv:
33
33
  global:
34
34
  announcement: Announcement
35
35
  attachments_allowed: Attachments allowed
36
+ categories_enabled: Categories enabled
36
37
  comments_enabled: Comments enabled
37
38
  multilingual_answers: Multilingual answers
38
39
  plan_answering_enabled: Answering enabled
39
40
  plan_title_length: Title length
41
+ proposal_linking_enabled: Proposal linking enabled
42
+ scopes_enabled: Scopes enabled
40
43
  step:
41
44
  announcement: Announcement
42
45
  comments_blocked: Comments blocked
@@ -22,6 +22,9 @@ Decidim.register_component(:plans) do |component|
22
22
  settings.attribute :plan_answering_enabled, type: :boolean, default: true
23
23
  settings.attribute :comments_enabled, type: :boolean, default: true
24
24
  settings.attribute :announcement, type: :text, translated: true, editor: true
25
+ settings.attribute :scopes_enabled, type: :boolean, default: true
26
+ settings.attribute :categories_enabled, type: :boolean, default: true
27
+ settings.attribute :proposal_linking_enabled, type: :boolean, default: true
25
28
  settings.attribute :attachments_allowed, type: :boolean, default: false
26
29
  settings.attribute :multilingual_answers, type: :boolean
27
30
  end
@@ -48,6 +48,14 @@ FactoryBot.define do
48
48
  }
49
49
  end
50
50
  end
51
+
52
+ trait :with_proposal_linking_disabled do
53
+ settings do
54
+ {
55
+ proposal_linking_enabled: false
56
+ }
57
+ end
58
+ end
51
59
  end
52
60
 
53
61
  factory :attached_proposal, class: "Decidim::Plans::AttachedProposal" do
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Plans
5
- VERSION = "0.16.2"
5
+ VERSION = "0.16.3"
6
6
  DECIDIM_VERSION = "~> 0.16.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.16.2
4
+ version: 0.16.3
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-02-15 00:00:00.000000000 Z
11
+ date: 2019-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
325
  version: '0'
326
326
  requirements: []
327
327
  rubyforge_project:
328
- rubygems_version: 2.7.7
328
+ rubygems_version: 2.7.6
329
329
  signing_key:
330
330
  specification_version: 4
331
331
  summary: Provides a plans component for Decidim.