decidim-assemblies 0.17.1 → 0.17.2
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/assemblies/admin/assembly_form.rb +68 -52
- data/config/locales/eo-UY.yml +1 -0
- data/config/locales/hu.yml +1 -1
- data/config/locales/it.yml +3 -3
- data/config/locales/sv.yml +4 -4
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c0f24943af63649276875cef491e3886e5e018e16a770e50ef601a8bb6a37c9
|
4
|
+
data.tar.gz: c236863c629a10f674a7a89f1933c709184305e5f3d41d3281f902182f50194d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4916c1abd79855781ea8fa6ea5827e9116b3627057845439c77fed5de121692332b5952b45db5ba96af194c1b29a882dc8494ef629ede6da84c8c361fa10ef88
|
7
|
+
data.tar.gz: 5e8312841a18b16513c2939e7f985624851dacd71cfb38ee79a4e24decf906626d9fa0366289f05a3b015a373dd512bf6907c0f3f53f34b37f1874ddb0aebdf5
|
@@ -12,66 +12,74 @@ module Decidim
|
|
12
12
|
ASSEMBLY_TYPES = %w(government executive consultative_advisory participatory working_group commission others).freeze
|
13
13
|
CREATED_BY = %w(city_council public others).freeze
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
mimic :assembly
|
16
|
+
|
17
|
+
translatable_attribute :assembly_type_other, String
|
18
|
+
translatable_attribute :composition, String
|
19
|
+
translatable_attribute :closing_date_reason, String
|
20
|
+
translatable_attribute :created_by_other, String
|
17
21
|
translatable_attribute :description, String
|
18
|
-
translatable_attribute :short_description, String
|
19
|
-
translatable_attribute :meta_scope, String
|
20
22
|
translatable_attribute :developer_group, String
|
23
|
+
translatable_attribute :internal_organisation, String
|
21
24
|
translatable_attribute :local_area, String
|
22
|
-
translatable_attribute :
|
25
|
+
translatable_attribute :meta_scope, String
|
23
26
|
translatable_attribute :participatory_scope, String
|
24
27
|
translatable_attribute :participatory_structure, String
|
25
28
|
translatable_attribute :purpose_of_action, String
|
26
|
-
translatable_attribute :
|
27
|
-
translatable_attribute :assembly_type_other, String
|
28
|
-
translatable_attribute :created_by_other, String
|
29
|
-
translatable_attribute :closing_date_reason, String
|
30
|
-
translatable_attribute :internal_organisation, String
|
29
|
+
translatable_attribute :short_description, String
|
31
30
|
translatable_attribute :special_features, String
|
31
|
+
translatable_attribute :subtitle, String
|
32
|
+
translatable_attribute :target, String
|
33
|
+
translatable_attribute :title, String
|
32
34
|
|
33
|
-
mimic :assembly
|
34
|
-
|
35
|
-
attribute :slug, String
|
36
|
-
attribute :hashtag, String
|
37
|
-
attribute :promoted, Boolean
|
38
|
-
attribute :scopes_enabled, Boolean
|
39
|
-
attribute :scope_id, Integer
|
40
|
-
attribute :hero_image
|
41
|
-
attribute :remove_hero_image
|
42
|
-
attribute :banner_image
|
43
|
-
attribute :remove_banner_image
|
44
|
-
attribute :show_statistics, Boolean
|
45
|
-
attribute :area_id, Integer
|
46
|
-
attribute :parent_id, Integer
|
47
|
-
attribute :participatory_processes_ids, Array[Integer]
|
48
|
-
attribute :private_space, Boolean
|
49
35
|
attribute :assembly_type, String
|
50
|
-
attribute :creation_date, Decidim::Attributes::TimeWithZone
|
51
36
|
attribute :created_by, String
|
52
|
-
attribute :duration, Decidim::Attributes::TimeWithZone
|
53
|
-
attribute :included_at, Decidim::Attributes::TimeWithZone
|
54
|
-
attribute :closing_date, Decidim::Attributes::TimeWithZone
|
55
|
-
attribute :is_transparent, Boolean
|
56
|
-
attribute :twitter_handler, String
|
57
37
|
attribute :facebook_handler, String
|
38
|
+
attribute :github_handler, String
|
39
|
+
attribute :hashtag, String
|
58
40
|
attribute :instagram_handler, String
|
41
|
+
attribute :slug, String
|
42
|
+
attribute :twitter_handler, String
|
59
43
|
attribute :youtube_handler, String
|
60
|
-
attribute :github_handler, String
|
61
44
|
|
62
|
-
|
63
|
-
|
64
|
-
|
45
|
+
attribute :area_id, Integer
|
46
|
+
attribute :parent_id, Integer
|
47
|
+
attribute :participatory_processes_ids, Array[Integer]
|
48
|
+
attribute :scope_id, Integer
|
49
|
+
|
50
|
+
attribute :is_transparent, Boolean
|
51
|
+
attribute :promoted, Boolean
|
52
|
+
attribute :private_space, Boolean
|
53
|
+
attribute :show_statistics, Boolean
|
54
|
+
attribute :scopes_enabled, Boolean
|
55
|
+
|
56
|
+
attribute :closing_date, Decidim::Attributes::LocalizedDate
|
57
|
+
attribute :creation_date, Decidim::Attributes::LocalizedDate
|
58
|
+
attribute :duration, Decidim::Attributes::LocalizedDate
|
59
|
+
attribute :included_at, Decidim::Attributes::LocalizedDate
|
60
|
+
|
61
|
+
attribute :banner_image
|
62
|
+
attribute :hero_image
|
63
|
+
attribute :remove_banner_image
|
64
|
+
attribute :remove_hero_image
|
65
|
+
|
65
66
|
validates :area, presence: true, if: proc { |object| object.area_id.present? }
|
66
67
|
validates :parent, presence: true, if: ->(form) { form.parent_id.present? }
|
68
|
+
validates :scope, presence: true, if: proc { |object| object.scope_id.present? }
|
69
|
+
validates :slug, presence: true, format: { with: Decidim::Assembly.slug_format }
|
70
|
+
|
71
|
+
validate :slug_uniqueness
|
67
72
|
|
68
73
|
validates :assembly_type_other, translatable_presence: true, if: ->(form) { form.assembly_type == "others" }
|
69
74
|
validates :created_by_other, translatable_presence: true, if: ->(form) { form.created_by == "others" }
|
75
|
+
validates :title, :subtitle, :description, :short_description, translatable_presence: true
|
70
76
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
validates :
|
77
|
+
validates :banner_image,
|
78
|
+
file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
|
79
|
+
file_content_type: { allow: ["image/jpeg", "image/png"] }
|
80
|
+
validates :hero_image,
|
81
|
+
file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
|
82
|
+
file_content_type: { allow: ["image/jpeg", "image/png"] }
|
75
83
|
|
76
84
|
def map_model(model)
|
77
85
|
self.scope_id = model.decidim_scope_id
|
@@ -95,32 +103,40 @@ module Decidim
|
|
95
103
|
end
|
96
104
|
|
97
105
|
def created_by_for_select
|
98
|
-
CREATED_BY.map do |
|
106
|
+
CREATED_BY.map do |creator|
|
99
107
|
[
|
100
|
-
I18n.t("created_by.#{
|
101
|
-
|
108
|
+
I18n.t("created_by.#{creator}", scope: "decidim.assemblies"),
|
109
|
+
creator
|
102
110
|
]
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
106
114
|
def parent
|
107
|
-
@parent ||=
|
115
|
+
@parent ||= organization_assemblies.find_by(id: parent_id)
|
108
116
|
end
|
109
117
|
|
110
118
|
def processes_for_select
|
111
|
-
@processes_for_select ||=
|
112
|
-
|
113
|
-
|
114
|
-
translated_attribute(process.title),
|
115
|
-
process.id
|
116
|
-
]
|
117
|
-
end
|
119
|
+
@processes_for_select ||= organization_participatory_processes
|
120
|
+
&.map { |pp| [translated_attribute(pp.title), pp.id] }
|
121
|
+
&.sort_by { |arr| arr[0] }
|
118
122
|
end
|
119
123
|
|
120
124
|
private
|
121
125
|
|
126
|
+
def organization_participatory_processes
|
127
|
+
Decidim.find_participatory_space_manifest(:participatory_processes)
|
128
|
+
.participatory_spaces.call(current_organization)
|
129
|
+
end
|
130
|
+
|
131
|
+
def organization_assemblies
|
132
|
+
OrganizationAssemblies.new(current_organization).query
|
133
|
+
end
|
134
|
+
|
122
135
|
def slug_uniqueness
|
123
|
-
return unless
|
136
|
+
return unless organization_assemblies
|
137
|
+
.where(slug: slug)
|
138
|
+
.where.not(id: context[:assembly_id])
|
139
|
+
.any?
|
124
140
|
|
125
141
|
errors.add(:slug, :taken)
|
126
142
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
eo:
|
data/config/locales/hu.yml
CHANGED
data/config/locales/it.yml
CHANGED
@@ -39,7 +39,7 @@ it:
|
|
39
39
|
promoted: Promosso
|
40
40
|
published_at: Pubblicato a
|
41
41
|
purpose_of_action: Scopo dell'azione
|
42
|
-
scope_id:
|
42
|
+
scope_id: Obiettivi
|
43
43
|
scopes_enabled: Scopi abilitati
|
44
44
|
short_description: Breve descrizione
|
45
45
|
show_statistics: Mostra statistiche
|
@@ -48,7 +48,7 @@ it:
|
|
48
48
|
subtitle: Sottotitolo
|
49
49
|
target: Chi partecipa
|
50
50
|
title: Titolo
|
51
|
-
twitter:
|
51
|
+
twitter: Twitter
|
52
52
|
youtube: Youtube
|
53
53
|
assembly_member:
|
54
54
|
birthday: Compleanno
|
@@ -303,7 +303,7 @@ it:
|
|
303
303
|
read_less: Leggi di meno
|
304
304
|
read_more: Leggi di più
|
305
305
|
related_participatory_processes: Processi partecipativi correlati
|
306
|
-
scope:
|
306
|
+
scope: Obiettivi
|
307
307
|
social_networks: Social networks
|
308
308
|
target: Chi partecipa
|
309
309
|
statistics:
|
data/config/locales/sv.yml
CHANGED
@@ -36,7 +36,7 @@ sv:
|
|
36
36
|
participatory_scope: Vad bestäms
|
37
37
|
participatory_structure: Hur bestäms det
|
38
38
|
private_space: Privat utrymme
|
39
|
-
promoted:
|
39
|
+
promoted: Uppmärksammad
|
40
40
|
published_at: Publicerad på
|
41
41
|
purpose_of_action: Syfte med åtgärden
|
42
42
|
scope_id: Omfattning
|
@@ -66,8 +66,8 @@ sv:
|
|
66
66
|
activerecord:
|
67
67
|
models:
|
68
68
|
decidim/assembly:
|
69
|
-
one:
|
70
|
-
other:
|
69
|
+
one: Sammankomst
|
70
|
+
other: Sammankomster
|
71
71
|
decidim/assembly_member:
|
72
72
|
one: Församlingsmedlem
|
73
73
|
other: Församlingsmedlemmar
|
@@ -364,7 +364,7 @@ sv:
|
|
364
364
|
more_info: Mer information
|
365
365
|
take_part: Delta
|
366
366
|
assembly_navigation:
|
367
|
-
assembly_member_menu_item:
|
367
|
+
assembly_member_menu_item: Medlemmar
|
368
368
|
assembly_menu_item: Mötet
|
369
369
|
assembly_widgets:
|
370
370
|
show:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-assemblies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
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: 2019-
|
13
|
+
date: 2019-07-03 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.17.
|
21
|
+
version: 0.17.2
|
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.17.
|
28
|
+
version: 0.17.2
|
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.17.
|
35
|
+
version: 0.17.2
|
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.17.
|
42
|
+
version: 0.17.2
|
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.17.
|
49
|
+
version: 0.17.2
|
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.17.
|
56
|
+
version: 0.17.2
|
57
57
|
description: Assemblies component for decidim.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- config/locales/cs.yml
|
189
189
|
- config/locales/de.yml
|
190
190
|
- config/locales/en.yml
|
191
|
+
- config/locales/eo-UY.yml
|
191
192
|
- config/locales/es-MX.yml
|
192
193
|
- config/locales/es-PY.yml
|
193
194
|
- config/locales/es.yml
|