decidim-assemblies 0.13.1 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/assemblies/assembly_cell.rb +1 -1
  3. data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies/show.erb +31 -0
  4. data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb +28 -0
  5. data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +6 -0
  6. data/app/controllers/decidim/assemblies/admin/assembly_attachment_collections_controller.rb +0 -4
  7. data/app/controllers/decidim/assemblies/admin/assembly_attachments_controller.rb +0 -4
  8. data/app/controllers/decidim/assemblies/admin/participatory_space_private_users_controller.rb +0 -4
  9. data/app/models/decidim/assembly.rb +4 -0
  10. data/app/presenters/decidim/assembly_presenter.rb +14 -0
  11. data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +8 -2
  12. data/app/views/decidim/assemblies/admin/assembly_copies/new.html.erb +1 -1
  13. data/app/views/decidim/assemblies/assemblies/index.html.erb +8 -0
  14. data/app/views/decidim/assemblies/assemblies/show.html.erb +9 -0
  15. data/app/views/layouts/decidim/assembly.html.erb +0 -2
  16. data/config/locales/ca.yml +13 -8
  17. data/config/locales/en.yml +13 -8
  18. data/config/locales/es-PY.yml +13 -8
  19. data/config/locales/es.yml +13 -8
  20. data/config/locales/eu.yml +13 -8
  21. data/config/locales/fi.yml +96 -91
  22. data/config/locales/fr.yml +13 -8
  23. data/config/locales/gl.yml +13 -8
  24. data/config/locales/hu.yml +346 -0
  25. data/config/locales/it.yml +13 -8
  26. data/config/locales/nl.yml +13 -8
  27. data/config/locales/pl.yml +13 -8
  28. data/config/locales/pt-BR.yml +39 -34
  29. data/config/locales/pt.yml +13 -8
  30. data/config/locales/ru.yml +14 -11
  31. data/config/locales/sv.yml +122 -117
  32. data/config/locales/uk.yml +15 -12
  33. data/lib/decidim/assemblies/admin_engine.rb +1 -0
  34. data/lib/decidim/assemblies/engine.rb +10 -13
  35. data/lib/decidim/assemblies/participatory_space.rb +8 -0
  36. data/lib/decidim/assemblies/test/factories.rb +6 -6
  37. data/lib/decidim/assemblies/version.rb +1 -1
  38. metadata +13 -10
  39. data/app/views/decidim/assemblies/pages/home/_highlighted_assemblies.html.erb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0cfe9dab6ab3f78fbb6bbf3fb29b0b1f76222fb14923d608724fca412e51a6b
4
- data.tar.gz: 03a45f4af955a614d549c988e9912664d730ac97179044d342e7f2265cd87696
3
+ metadata.gz: 8a1cce146b08aee21bd8f3370beb76ff2a75c3f31ad642502d355f736070a37f
4
+ data.tar.gz: f1ac77939bfbc47d8c28b0421389150f9b201e329f9ac59e48e12916986e4e92
5
5
  SHA512:
6
- metadata.gz: e13e2e501fc4b307639523e2dea690d69a451ba1ae09b23a3c6cf769c78164c0026f46f8dcbd6b677e99749cbbdac683390dbd2da7016fb3e2ca096eb206ff58
7
- data.tar.gz: d1ca83cce5e4a99ebe8988e29495f8149612d6c51ac927a3253a7e0e20cc4abadb4a31220bc8f8641ab4e65395f5728520405c2e75c0d479a6128868ee9831ac
6
+ metadata.gz: 239a621b615bde42e4dea6f64875ca9e96e5e754f3e3a58cb6ea04936177ae21632efa65e4e741f2bfa445a185db2969ba8d7314d9d103b0c21b36b860f11ca2
7
+ data.tar.gz: ed47664aacf5eefe2e8a887cf22693236c895d4a17d690013558f6407f8f8a8d7606fba008abf5b8f41b4ca4158356c26316aa75bce6f2bd7f62fca7db26cfcd
@@ -6,7 +6,7 @@ module Decidim
6
6
  # the default size is the Medium Card (:m)
7
7
  class AssemblyCell < Decidim::ViewModel
8
8
  def show
9
- cell card_size, model
9
+ cell card_size, model, options
10
10
  end
11
11
 
12
12
  private
@@ -0,0 +1,31 @@
1
+ <section class="wrapper-home home-section">
2
+ <div class="row" id="highlighted-assemblies">
3
+ <h3 class="section-heading"><%= t("active_assemblies", scope: i18n_scope) %></h3>
4
+ <div class="row collapse">
5
+ <div class="row small-up-1 smallmedium-up-2 mediumlarge-up-3
6
+ large-up-4 card-grid">
7
+ <% highlighted_assemblies.each do |assembly| %>
8
+ <div class="column">
9
+ <article class="card card--assembly card--mini">
10
+ <%= link_to decidim_assemblies.assembly_path(assembly), class: "card__link" do %>
11
+ <div class="card__image-top"
12
+ style="background-image:url(<%= assembly.hero_image.url %>)"></div>
13
+ <% end %>
14
+ <div class="card__content">
15
+ <%= link_to decidim_assemblies.assembly_path(assembly), class: "card__link" do %>
16
+ <h4 class="card__title"><%= translated_attribute assembly.title %></h4>
17
+ <% end %>
18
+ </div>
19
+ </article>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="row" id="see-all-assemblies">
26
+ <div class="columns small-centered small-12
27
+ smallmedium-8 medium-6 large-4">
28
+ <%= link_to t("see_all_assemblies", scope: i18n_scope), decidim_assemblies.assemblies_path, class: "button expanded hollow button--sc home-section__cta" %>
29
+ </div>
30
+ </div>
31
+ </section>
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ module ContentBlocks
6
+ class HighlightedAssembliesCell < Decidim::ViewModel
7
+ delegate :current_organization, to: :controller
8
+ delegate :current_user, to: :controller
9
+
10
+ def show
11
+ render if highlighted_assemblies.any?
12
+ end
13
+
14
+ def highlighted_assemblies
15
+ OrganizationPrioritizedAssemblies.new(current_organization, current_user)
16
+ end
17
+
18
+ def i18n_scope
19
+ "decidim.assemblies.pages.home.highlighted_assemblies"
20
+ end
21
+
22
+ def decidim_assemblies
23
+ Decidim::Assemblies::Engine.routes.url_helpers
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -9,6 +9,8 @@ module Decidim
9
9
  helper_method :current_assembly, :parent_assembly, :parent_assemblies, :current_participatory_space
10
10
  layout "decidim/admin/assemblies"
11
11
 
12
+ before_action :set_all_assemblies, except: [:index, :destroy]
13
+
12
14
  def index
13
15
  enforce_permission_to :read, :assembly_list
14
16
  @assemblies = collection
@@ -78,6 +80,10 @@ module Decidim
78
80
 
79
81
  private
80
82
 
83
+ def set_all_assemblies
84
+ @all_assemblies = OrganizationAssemblies.new(current_user.organization).query
85
+ end
86
+
81
87
  def current_assembly
82
88
  scope = OrganizationAssemblies.new(current_user.organization).query
83
89
  @current_assembly ||= scope.where(slug: params[:slug]).or(
@@ -16,10 +16,6 @@ module Decidim
16
16
  def collection_for
17
17
  current_assembly
18
18
  end
19
-
20
- def authorization_object
21
- @attachment_collection || AttachmentCollection
22
- end
23
19
  end
24
20
  end
25
21
  end
@@ -17,10 +17,6 @@ module Decidim
17
17
  def attached_to
18
18
  current_assembly
19
19
  end
20
-
21
- def authorization_object
22
- @attachment || Attachment
23
- end
24
20
  end
25
21
  end
26
22
  end
@@ -16,10 +16,6 @@ module Decidim
16
16
  def privatable_to
17
17
  current_assembly
18
18
  end
19
-
20
- def authorization_object
21
- @participatory_space_private_user || ParticipatorySpacePrivateUser
22
- end
23
19
  end
24
20
  end
25
21
  end
@@ -115,6 +115,10 @@ module Decidim
115
115
  return false if private_space? && is_transparent?
116
116
  end
117
117
 
118
+ def translated_title
119
+ Decidim::AssemblyPresenter.new(self).translated_title
120
+ end
121
+
118
122
  private
119
123
 
120
124
  # When an assembly changes their parent, we need to update the parents_path attribute
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ #
5
+ # Decorator for areas
6
+ #
7
+ class AssemblyPresenter < SimpleDelegator
8
+ include Decidim::TranslationsHelper
9
+
10
+ def translated_title
11
+ @translated_title ||= translated_attribute title
12
+ end
13
+ end
14
+ end
@@ -1,7 +1,5 @@
1
1
  <%= javascript_include_tag "decidim/slug_form" %>
2
2
 
3
- <%= form.hidden_field :parent_id, value: @form.parent_id %>
4
-
5
3
  <div class="card">
6
4
  <div class="card-divider">
7
5
  <h2 class="card-title"><%= t "assemblies.form.title", scope: "decidim.admin" %></h2>
@@ -16,6 +14,14 @@
16
14
  <%= form.translated :text_field, :subtitle %>
17
15
  </div>
18
16
 
17
+ <% if params[:parent_id].present? %>
18
+ <%= form.hidden_field :parent_id, value: @form.parent_id %>
19
+ <% else %>
20
+ <div class="row column">
21
+ <%= form.select :parent_id, options_from_collection_for_select(@all_assemblies, :id, :translated_title, selected: current_assembly.try(:parent_id)), include_blank: t(".select_parent_assembly") %>
22
+ </div>
23
+ <% end %>
24
+
19
25
  <div class="row">
20
26
  <div class="columns xlarge-6 slug">
21
27
  <%= form.text_field :slug %>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: assembly_copies_path(current_assembly), method: :post, html: { class: "form copy_assembly" }) do |f| %>
2
- <%= render partial: "form", object: f, locals: { title: t("assembly_copies.new.title", scope: "decidim.admin"), select: t("assembly_copies.new.select", scope: "decidim.admin")} %>
2
+ <%= render partial: "form", object: f, locals: { title: t("assembly_copies.new.title", scope: "decidim.admin"), select: t("assembly_copies.new.select", scope: "decidim.admin") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("assembly_copies.new.copy", scope: "decidim.admin") %>
@@ -1,5 +1,13 @@
1
1
  <% add_decidim_meta_tags(title: t("assemblies.index.title", scope: "decidim")) %>
2
2
 
3
+ <%
4
+ edit_link(
5
+ decidim_admin_assemblies.assemblies_path,
6
+ :read,
7
+ :assembly_list
8
+ )
9
+ %>
10
+
3
11
  <main class="wrapper">
4
12
  <% if promoted_assemblies.any? %>
5
13
  <section id="highlighted-assemblies" class="row section">
@@ -5,6 +5,15 @@
5
5
  twitter_handler: current_organization.twitter_handler
6
6
  }) %>
7
7
 
8
+ <%
9
+ edit_link(
10
+ resource_locator(current_participatory_space).edit,
11
+ :update,
12
+ :assembly,
13
+ assembly: current_participatory_space
14
+ )
15
+ %>
16
+
8
17
  <% if current_participatory_space.private_space? %>
9
18
  <%= render partial: "decidim/shared/private_participatory_space", locals: { text: t("assemblies.show.private_space", scope: "decidim") } %>
10
19
  <% end %>
@@ -19,8 +19,6 @@
19
19
  </div>
20
20
  </div>
21
21
  <% end %>
22
-
23
- <%= render "layouts/decidim/component_authorization_modals" %>
24
22
  <% end %>
25
23
 
26
24
  <% provide :meta_image_url, current_participatory_space.banner_image.url %>
@@ -29,11 +29,12 @@ ca:
29
29
  instagram: Instagram
30
30
  internal_organisation: Organització interna
31
31
  is_transparent: És transparent
32
- local_area: Àrea municipal
32
+ local_area: Àrea d'organització
33
33
  meta_scope: Metadades d'àmbit
34
+ parent_id: Assemblea principal
34
35
  participatory_processes_ids: Processos participatius relacionats
35
- participatory_scope: Àmbit participatiu
36
- participatory_structure: Estructura participativa
36
+ participatory_scope: El que es decideix
37
+ participatory_structure: Com es decideix
37
38
  private_space: Espai privat
38
39
  promoted: Destacat
39
40
  published_at: Publicat el
@@ -45,7 +46,7 @@ ca:
45
46
  slug: Nom curt d'URL
46
47
  special_features: Característiques especials
47
48
  subtitle: Subtítol
48
- target: A qui va dirigit?
49
+ target: Qui participa
49
50
  title: Títol
50
51
  twitter: Twitter
51
52
  youtube: YouTube
@@ -217,6 +218,7 @@ ca:
217
218
  select_a_created_by: Selecciona un creador
218
219
  select_an_area: Selecciona una àrea
219
220
  select_an_assembly_type: Seleccioneu un tipus d'assemblea
221
+ select_parent_assembly: Seleccioneu una assemblea principal
220
222
  slug_help: 'Els noms curts d''URL s''utilitzen per generar les URL que apunten a aquesta assemblea. Només accepta lletres, números i guions, i ha de començar amb una lletra. Exemple: %{url}'
221
223
  social_handlers: Social
222
224
  assembly_copies:
@@ -247,6 +249,9 @@ ca:
247
249
  others: Altres
248
250
  participatory: Participativa
249
251
  working_group: Grup de treball
252
+ content_blocks:
253
+ highlighted_assemblies:
254
+ name: Asemblees destacades
250
255
  created_by:
251
256
  city_council: Ajuntament
252
257
  others: Altres
@@ -277,9 +282,9 @@ ca:
277
282
  is_transparent:
278
283
  'false': opaca
279
284
  'true': transparent
280
- local_area: Àrea municipal
281
- participatory_scope: Àmbit participatiu
282
- participatory_structure: Estructura participativa
285
+ local_area: Àrea d'organització
286
+ participatory_scope: El que es decideix
287
+ participatory_structure: Com es decideix
283
288
  private_space: Aquesta és una assemblea privada
284
289
  purpose_of_action: Propòsit de l'acció
285
290
  read_less: Llegir menys
@@ -287,7 +292,7 @@ ca:
287
292
  related_participatory_processes: Processos participatius relacionats
288
293
  scope: Àmbit
289
294
  social_networks: Xarxes socials
290
- target: A qui va dirigit
295
+ target: Qui participa
291
296
  statistics:
292
297
  answers_count: Respostes
293
298
  assemblies_count: Assemblees
@@ -30,11 +30,12 @@ en:
30
30
  instagram: Instagram
31
31
  internal_organisation: Internal organisation
32
32
  is_transparent: Is transparent
33
- local_area: Local area
33
+ local_area: Organization area
34
34
  meta_scope: Scope metadata
35
+ parent_id: Parent assembly
35
36
  participatory_processes_ids: Related Participatory processes
36
- participatory_scope: Participatory scope
37
- participatory_structure: Participatory structure
37
+ participatory_scope: What is decided
38
+ participatory_structure: How is it decided
38
39
  private_space: Private space
39
40
  promoted: Promoted
40
41
  published_at: Published at
@@ -46,7 +47,7 @@ en:
46
47
  slug: URL slug
47
48
  special_features: Special features
48
49
  subtitle: Subtitle
49
- target: Target
50
+ target: Who participates
50
51
  title: Title
51
52
  twitter: Twitter
52
53
  youtube: YouTube
@@ -218,6 +219,7 @@ en:
218
219
  select_a_created_by: Select a created by
219
220
  select_an_area: Select an Area
220
221
  select_an_assembly_type: Select an assembly type
222
+ select_parent_assembly: Select parent assembly
221
223
  slug_help: 'URL slugs are used to generate the URLs that point to this assembly. Only accepts letters, numbers and dashes, and must start with a letter. Example: %{url}'
222
224
  social_handlers: Social
223
225
  assembly_copies:
@@ -248,6 +250,9 @@ en:
248
250
  others: Others
249
251
  participatory: Participatory
250
252
  working_group: Working group
253
+ content_blocks:
254
+ highlighted_assemblies:
255
+ name: Highlighted assemblies
251
256
  created_by:
252
257
  city_council: City Council
253
258
  others: Others
@@ -278,9 +283,9 @@ en:
278
283
  is_transparent:
279
284
  'false': opaque
280
285
  'true': transparent
281
- local_area: Local area
282
- participatory_scope: Participatory scope
283
- participatory_structure: Participatory structure
286
+ local_area: Organization area
287
+ participatory_scope: What is decided
288
+ participatory_structure: How is it decided
284
289
  private_space: This is a private assembly
285
290
  purpose_of_action: Purpose of action
286
291
  read_less: Read less
@@ -288,7 +293,7 @@ en:
288
293
  related_participatory_processes: Related participatory processes
289
294
  scope: Scope
290
295
  social_networks: Social Networks
291
- target: Target
296
+ target: Who participates
292
297
  statistics:
293
298
  answers_count: Answers
294
299
  assemblies_count: Assemblies
@@ -29,11 +29,12 @@ es-PY:
29
29
  instagram: Instagram
30
30
  internal_organisation: Organización interna
31
31
  is_transparent: Es transparente
32
- local_area: Áreas municipales
32
+ local_area: Área de organización
33
33
  meta_scope: 'Metadatos: ámbito'
34
+ parent_id: Asamblea principal
34
35
  participatory_processes_ids: Procesos participativos relacionados
35
- participatory_scope: Ámbito participativo
36
- participatory_structure: Estructura participativa
36
+ participatory_scope: Qué se decide
37
+ participatory_structure: Cómo se decide
37
38
  private_space: Espacio privado
38
39
  promoted: Destacado
39
40
  published_at: Publicado
@@ -45,7 +46,7 @@ es-PY:
45
46
  slug: Texto corto de URL
46
47
  special_features: Características especiales
47
48
  subtitle: Subtítulo
48
- target: '¿A quién va dirigido?'
49
+ target: Quién participa
49
50
  title: Título
50
51
  twitter: Twitter
51
52
  youtube: Youtube
@@ -217,6 +218,7 @@ es-PY:
217
218
  select_a_created_by: Selecciona creada por
218
219
  select_an_area: Seleccione un Área
219
220
  select_an_assembly_type: Selecciona tipo de asamblea
221
+ select_parent_assembly: Seleccionar ensamblaje principal
220
222
  slug_help: 'Los textos cortos de URL se utilizan para generar las URL que apuntan a esta asamblea. Sólo acepta letras, números y guiones, y debe comenzar con una letra. Ejemplo: %{url}'
221
223
  social_handlers: Social
222
224
  assembly_copies:
@@ -247,6 +249,9 @@ es-PY:
247
249
  others: Otros
248
250
  participatory: Participativo
249
251
  working_group: Grupo de trabajo
252
+ content_blocks:
253
+ highlighted_assemblies:
254
+ name: Asambleas destacadas
250
255
  created_by:
251
256
  city_council: Ayuntamiento
252
257
  others: Otros
@@ -277,9 +282,9 @@ es-PY:
277
282
  is_transparent:
278
283
  'false': opaco
279
284
  'true': transparente
280
- local_area: Áreas municipales
281
- participatory_scope: Ámbito participativo
282
- participatory_structure: Estructura participativa
285
+ local_area: Área de organización
286
+ participatory_scope: Qué se decide
287
+ participatory_structure: Cómo se decide
283
288
  private_space: Esta es una asamblea privada
284
289
  purpose_of_action: Propósito de la acción
285
290
  read_less: Leer menos
@@ -287,7 +292,7 @@ es-PY:
287
292
  related_participatory_processes: Procesos participativos relacionados
288
293
  scope: Ámbito
289
294
  social_networks: Redes sociales
290
- target: '¿A quién va dirigida?'
295
+ target: Quién participa
291
296
  statistics:
292
297
  answers_count: Respuestas
293
298
  assemblies_count: Asambleas
@@ -29,11 +29,12 @@ es:
29
29
  instagram: Instagram
30
30
  internal_organisation: Organización interna
31
31
  is_transparent: Es transparente
32
- local_area: Áreas municipales
32
+ local_area: Área de organización
33
33
  meta_scope: 'Metadatos: ámbito'
34
+ parent_id: Asamblea padre
34
35
  participatory_processes_ids: Procesos participativos relacionados
35
- participatory_scope: Ámbito participativo
36
- participatory_structure: Estructura participativa
36
+ participatory_scope: Qué se decide
37
+ participatory_structure: Cómo se decide
37
38
  private_space: Espacio privado
38
39
  promoted: Destacado
39
40
  published_at: Publicado
@@ -45,7 +46,7 @@ es:
45
46
  slug: Texto corto de URL
46
47
  special_features: Características especiales
47
48
  subtitle: Subtítulo
48
- target: '¿A quién va dirigido?'
49
+ target: Quién participa
49
50
  title: Título
50
51
  twitter: Twitter
51
52
  youtube: Youtube
@@ -217,6 +218,7 @@ es:
217
218
  select_a_created_by: Selecciona creada por
218
219
  select_an_area: Seleccione un Área
219
220
  select_an_assembly_type: Selecciona tipo de asamblea
221
+ select_parent_assembly: Selecciona asamblea principal
220
222
  slug_help: 'Los textos cortos de URL se utilizan para generar las URL que apuntan a esta asamblea. Sólo acepta letras, números y guiones, y debe comenzar con una letra. Ejemplo: %{url}'
221
223
  social_handlers: Social
222
224
  assembly_copies:
@@ -247,6 +249,9 @@ es:
247
249
  others: Otros
248
250
  participatory: Participativo
249
251
  working_group: Grupo de trabajo
252
+ content_blocks:
253
+ highlighted_assemblies:
254
+ name: Asambleas destacadas
250
255
  created_by:
251
256
  city_council: Ayuntamiento
252
257
  others: Otros
@@ -277,9 +282,9 @@ es:
277
282
  is_transparent:
278
283
  'false': opaco
279
284
  'true': transparente
280
- local_area: Áreas municipales
281
- participatory_scope: Ámbito participativo
282
- participatory_structure: Estructura participativa
285
+ local_area: Área de organización
286
+ participatory_scope: Qué se decide
287
+ participatory_structure: Cómo se decide
283
288
  private_space: Esta es una asamblea privada
284
289
  purpose_of_action: Propósito de la acción
285
290
  read_less: Leer menos
@@ -287,7 +292,7 @@ es:
287
292
  related_participatory_processes: Procesos participativos relacionados
288
293
  scope: Ámbito
289
294
  social_networks: Redes sociales
290
- target: '¿A quién va dirigida?'
295
+ target: Quién participa
291
296
  statistics:
292
297
  answers_count: Respuestas
293
298
  assemblies_count: Asambleas