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 +4 -4
- data/app/forms/decidim/plans/admin/plan_form.rb +1 -1
- data/app/forms/decidim/plans/plan_form.rb +1 -1
- data/app/views/decidim/plans/admin/plans/_form.html.erb +11 -9
- data/app/views/decidim/plans/plans/_form.html.erb +11 -9
- data/config/locales/en.yml +3 -0
- data/config/locales/fi.yml +3 -0
- data/config/locales/sv.yml +3 -0
- data/lib/decidim/plans/component.rb +3 -0
- data/lib/decidim/plans/test/factories.rb +8 -0
- data/lib/decidim/plans/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89daec1bca29a601922a38e6eaac70f669272784d23cefa2ad74e0d4f7fad1ad
|
4
|
+
data.tar.gz: 363a50ba655819e2ddc02a30972083d21650aa4bdc686a0396dbcb6aabddcbc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
15
|
-
|
16
|
-
|
14
|
+
<% if component_settings.proposal_linking_enabled? %>
|
15
|
+
<div class="row column">
|
16
|
+
<%= attached_proposals_picker_field form, :proposals %>
|
17
|
+
</div>
|
17
18
|
|
18
|
-
|
19
|
-
|
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
|
38
|
+
<% if component_settings.scopes_enabled? && current_participatory_space.has_subscopes? %>
|
37
39
|
<div class="row column">
|
38
|
-
<%=
|
40
|
+
<%= scopes_picker_field form, :scope_id %>
|
39
41
|
</div>
|
40
42
|
<% end %>
|
41
43
|
|
42
|
-
<% if
|
44
|
+
<% if component_settings.categories_enabled? && @form.categories&.any? %>
|
43
45
|
<div class="row column">
|
44
|
-
<%=
|
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
|
-
|
15
|
-
|
16
|
-
|
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
|
38
|
+
<% if component_settings.scopes_enabled? && current_participatory_space.has_subscopes? %>
|
37
39
|
<div class="field">
|
38
|
-
<%=
|
40
|
+
<%= scopes_picker_field form, :scope_id %>
|
39
41
|
</div>
|
40
42
|
<% end %>
|
41
43
|
|
42
|
-
<% if
|
44
|
+
<% if component_settings.categories_enabled? && @form.categories&.any? %>
|
43
45
|
<div class="field">
|
44
|
-
<%=
|
46
|
+
<%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
|
45
47
|
</div>
|
46
48
|
<% end %>
|
47
49
|
|
data/config/locales/en.yml
CHANGED
@@ -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
|
data/config/locales/fi.yml
CHANGED
@@ -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
|
data/config/locales/sv.yml
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
328
|
+
rubygems_version: 2.7.6
|
329
329
|
signing_key:
|
330
330
|
specification_version: 4
|
331
331
|
summary: Provides a plans component for Decidim.
|