decidim-meetings 0.32.1 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -1
  3. data/app/controllers/decidim/meetings/admin/attachment_collections_controller.rb +2 -0
  4. data/app/controllers/decidim/meetings/admin/attachments_controller.rb +2 -0
  5. data/app/controllers/decidim/meetings/admin/meetings_poll_controller.rb +5 -3
  6. data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +6 -0
  7. data/app/controllers/decidim/meetings/calendars_controller.rb +4 -0
  8. data/app/controllers/decidim/meetings/directory/meetings_controller.rb +2 -0
  9. data/app/controllers/decidim/meetings/live_events_controller.rb +2 -0
  10. data/app/controllers/decidim/meetings/meetings_controller.rb +11 -0
  11. data/app/controllers/decidim/meetings/polls/questions_controller.rb +2 -0
  12. data/app/controllers/decidim/meetings/registrations_controller.rb +5 -3
  13. data/app/controllers/decidim/meetings/versions_controller.rb +2 -0
  14. data/app/forms/decidim/meetings/meeting_form.rb +5 -1
  15. data/app/models/decidim/meetings/meeting.rb +1 -1
  16. data/app/permissions/decidim/meetings/meeting_permissions.rb +3 -1
  17. data/app/views/decidim/meetings/_calendar_modal.html.erb +18 -18
  18. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +1 -1
  19. data/app/views/decidim/meetings/admin/poll/_question.html.erb +1 -1
  20. data/app/views/decidim/meetings/meetings/_form.html.erb +1 -1
  21. data/config/locales/ca.yml +2 -2
  22. data/config/locales/de.yml +13 -1
  23. data/config/locales/es.yml +1 -1
  24. data/config/locales/eu.yml +100 -100
  25. data/config/locales/gl.yml +509 -27
  26. data/config/locales/sv.yml +12 -1
  27. data/decidim-meetings.gemspec +1 -1
  28. data/lib/decidim/meetings/version.rb +1 -1
  29. metadata +13 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0d13e0e4e1e2a93812fe535dc124ca193d7232f006fe7e0d5fd76bbf7652ae1
4
- data.tar.gz: 7aa19060c59dbdbaf268d532f7bd64c071b3c6bf420b65e359357a127f641d4e
3
+ metadata.gz: 427b03e226543473dfa00cbe1aa7e2c503ae7531fd6c272ec085de605b53c17c
4
+ data.tar.gz: 42c90e2f58ff29ee2270d1dc7e898c697101c0fd255f5f175db6d51523f7d183
5
5
  SHA512:
6
- metadata.gz: 171f82a204d23e0fec215f64c7b104045eb5c16c29e07c32dc5c402bfc0aa9461fc04535b41d6acba88f0010f54e2377c16a0c76260d304a29c4b618c43bf4bf
7
- data.tar.gz: 5209631828257a55ed7cf2fbe1bde431ff296267aca94b43d2a191b96eab762bf3ac19aaa2c821d420ef2a76f887ae89d496395170fcb93ff5fcaa1bcc869a47
6
+ metadata.gz: 47e0476e08e50ab3c87515d7925e055a4adcdcd9d039df26ec2e10837ff1c22fa6a9f2ea42b8f79fc5d5eff827ba567b5a80a5c2ed77f3499cb263010df56164
7
+ data.tar.gz: a252d1f71ad7dd4ce63b878b3f202ea1524fd40817c69733c64a22c86e01aca940ee93fc34318b2c7295eac076241a0b98552b8a7859fe1f0fd1b3736adafd96
@@ -39,7 +39,7 @@ module Decidim
39
39
 
40
40
  def copy_meeting!
41
41
  parsed_title = Decidim::ContentProcessor.parse(form.title, current_organization: meeting.organization).rewrite
42
- parsed_description = Decidim::ContentProcessor.parse_with_processor(:inline_images, form.description, current_organization: meeting.organization).rewrite
42
+ parsed_description = Decidim::ContentProcessor.parse(form.description, current_organization: meeting.organization).rewrite
43
43
 
44
44
  @copied_meeting = Decidim.traceability.create!(
45
45
  Meeting,
@@ -8,6 +8,8 @@ module Decidim
8
8
  class AttachmentCollectionsController < Admin::ApplicationController
9
9
  include Decidim::Admin::Concerns::HasAttachmentCollections
10
10
 
11
+ protected
12
+
11
13
  def after_destroy_path
12
14
  meeting_attachment_collections_path(meeting, meeting.component, current_participatory_space)
13
15
  end
@@ -9,6 +9,8 @@ module Decidim
9
9
  class AttachmentsController < Decidim::Meetings::Admin::ApplicationController
10
10
  include Decidim::Admin::Concerns::HasAttachments
11
11
 
12
+ protected
13
+
12
14
  def after_destroy_path
13
15
  meetings_path
14
16
  end
@@ -52,11 +52,13 @@ module Decidim
52
52
  end
53
53
  end
54
54
 
55
+ protected
56
+
55
57
  def response_options
56
58
  respond_to do |format|
57
59
  format.json do
58
60
  question_id = params["id"]
59
- question = Decidim::Meetings::Question.find_by(id: question_id)
61
+ question = questionnaire.questions.find_by(id: question_id)
60
62
  render json: question.response_options.map { |response_option| ResponseOptionPresenter.new(response_option).as_json } if question.present?
61
63
  end
62
64
  end
@@ -81,7 +83,7 @@ module Decidim
81
83
  private
82
84
 
83
85
  def questionnaire
84
- @questionnaire ||= Decidim::Meetings::Questionnaire.find_or_initialize_by(questionnaire_for:)
86
+ @questionnaire ||= poll.questionnaire || Decidim::Meetings::Questionnaire.new(questionnaire_for:)
85
87
  end
86
88
 
87
89
  def blank_question
@@ -111,7 +113,7 @@ module Decidim
111
113
  end
112
114
 
113
115
  def poll
114
- @poll ||= Poll.find_or_initialize_by(meeting:)
116
+ @poll ||= meeting.poll || Decidim::Meetings::Poll.new(meeting:)
115
117
  end
116
118
  end
117
119
  end
@@ -7,6 +7,8 @@ module Decidim
7
7
  class RegistrationFormController < Admin::ApplicationController
8
8
  include Decidim::Forms::Admin::Concerns::HasQuestionnaire
9
9
 
10
+ protected
11
+
10
12
  def questionnaire_for
11
13
  meeting
12
14
  end
@@ -27,6 +29,10 @@ module Decidim
27
29
  "decidim/meetings/admin/registration_form/edit_questions"
28
30
  end
29
31
 
32
+ def response_options_url(params)
33
+ url_for(params.merge(controller: "registration_form", action: "response_options", format: :json, meeting_id: meeting.id))
34
+ end
35
+
30
36
  private
31
37
 
32
38
  def i18n_questions_flashes_scope
@@ -14,10 +14,14 @@ module Decidim
14
14
  skip_around_action :use_organization_time_zone
15
15
 
16
16
  def show
17
+ enforce_permission_to :read, :calendar
18
+
17
19
  render plain: CalendarRenderer.for(current_component, filter_params), content_type: "type/calendar"
18
20
  end
19
21
 
20
22
  def meeting_calendar
23
+ enforce_permission_to(:read, :meeting, meeting:)
24
+
21
25
  send_data CalendarRenderer.for(meeting), content_type: "type/calendar", filename: "#{meeting.reference}.ics"
22
26
  end
23
27
 
@@ -17,6 +17,8 @@ module Decidim
17
17
  helper_method :meetings, :search
18
18
 
19
19
  def calendar
20
+ enforce_permission_to :read, :calendar
21
+
20
22
  render plain: CalendarRenderer.for(current_organization, filter_params), content_type: "type/calendar"
21
23
  end
22
24
 
@@ -14,6 +14,8 @@ module Decidim
14
14
  def show
15
15
  raise ActionController::RoutingError, "Not Found" unless meeting
16
16
 
17
+ enforce_permission_to(:read, :meeting, meeting:)
18
+
17
19
  return if allowed_for_current_user?
18
20
 
19
21
  flash[:alert] = I18n.t("meeting.not_allowed", scope: "decidim.meetings")
@@ -48,6 +48,8 @@ module Decidim
48
48
  end
49
49
 
50
50
  def index
51
+ enforce_permission_to :read, :meeting
52
+
51
53
  return unless search.result.blank? && params.dig("filter", "date") != %w(past)
52
54
 
53
55
  @past_meetings ||= search_with(filter_params.merge(with_any_date: %w(past)))
@@ -206,6 +208,7 @@ module Decidim
206
208
  return unless params[:previous_space]
207
209
 
208
210
  previous_space_class, previous_space_id = params[:previous_space].split("#")
211
+ return unless valid_participatory_space_class?(previous_space_class)
209
212
 
210
213
  @previous_space = previous_space_class.constantize.find_by(id: previous_space_id)
211
214
  @previous_space
@@ -213,6 +216,14 @@ module Decidim
213
216
  nil
214
217
  end
215
218
 
219
+ def valid_participatory_space_class?(class_name)
220
+ return false if class_name.blank?
221
+
222
+ Decidim.participatory_space_manifests.any? do |manifest|
223
+ manifest.model_class_name == class_name
224
+ end
225
+ end
226
+
216
227
  def conference_context?
217
228
  return false unless Decidim.module_installed?(:conferences)
218
229
  return false if current_participatory_space.blank?
@@ -7,6 +7,8 @@ module Decidim
7
7
  include Decidim::Meetings::PollsResources
8
8
 
9
9
  def index
10
+ enforce_permission_to(:read, :meeting, meeting:)
11
+
10
12
  respond_to do |format|
11
13
  format.js do
12
14
  render template: pick_index_template, locals: { open_question: nil }
@@ -100,9 +100,7 @@ module Decidim
100
100
  end
101
101
  end
102
102
 
103
- def should_join_waitlist?
104
- meeting.waitlist_enabled? && !meeting.has_available_slots? && !meeting.has_registration_for?(current_user)
105
- end
103
+ protected
106
104
 
107
105
  def allow_responses?
108
106
  return false unless meeting.registrations_enabled? && meeting.registration_form_enabled?
@@ -126,6 +124,10 @@ module Decidim
126
124
 
127
125
  private
128
126
 
127
+ def should_join_waitlist?
128
+ meeting.waitlist_enabled? && !meeting.has_available_slots? && !meeting.has_registration_for?(current_user)
129
+ end
130
+
129
131
  def meeting
130
132
  @meeting ||= Meeting.where(component: current_component).find(params[:meeting_id])
131
133
  end
@@ -6,6 +6,8 @@ module Decidim
6
6
  class VersionsController < Decidim::Meetings::ApplicationController
7
7
  include Decidim::ResourceVersionsConcern
8
8
 
9
+ private
10
+
9
11
  def versioned_resource
10
12
  @versioned_resource ||= Meeting.not_hidden.where(component: current_component).find(params[:meeting_id])
11
13
  end
@@ -40,7 +40,11 @@ module Decidim
40
40
  def map_model(model)
41
41
  presenter = MeetingEditionPresenter.new(model)
42
42
  self.title = presenter.title(all_locales: false)
43
- self.description = presenter.editor_description(all_locales: false)
43
+ self.description = if model.component.organization.rich_text_editor_in_public_views?
44
+ presenter.editor_description(all_locales: false)
45
+ else
46
+ presenter.plain_locales(model.description, false)
47
+ end
44
48
  self.location = presenter.location(all_locales: false)
45
49
  self.location_hints = presenter.location_hints(all_locales: false)
46
50
  self.registration_terms = presenter.registration_terms(all_locales: false)
@@ -140,7 +140,7 @@ module Decidim
140
140
 
141
141
  scope :visible, -> { where("decidim_meetings_meetings.private_meeting != ? OR decidim_meetings_meetings.transparent = ?", true, true) }
142
142
 
143
- scope :authored_by, ->(author) { where(decidim_author_id: author) }
143
+ scope :authored_by, ->(author) { where(author:) }
144
144
 
145
145
  scope_search_multi :with_any_type, TYPE_OF_MEETING.keys
146
146
 
@@ -10,7 +10,9 @@ module Decidim
10
10
  def target_subject = :meeting
11
11
 
12
12
  def can_read?
13
- user_has_any_role?(user, meeting.participatory_space, broad_check: true) || (!meeting&.hidden? && meeting&.current_user_can_visit_meeting?(user))
13
+ return true if meeting.nil?
14
+
15
+ user_has_any_role?(user, meeting.participatory_space, broad_check: true) || (!meeting.hidden? && meeting.current_user_can_visit_meeting?(user))
14
16
  end
15
17
 
16
18
  def meeting
@@ -4,26 +4,26 @@
4
4
  </button>
5
5
 
6
6
  <%= decidim_modal id: "calendarShare", class: "meeting-list__modal" do %>
7
- <div class="meeting-list__modal-title">
8
- <%= icon "share-forward-2-line", class: "w-6 h-6 text-gray fill-current flex-none" %>
9
- <div class="space-y-8">
10
- <h3 id="dialog-title-calendarShare" class="h3"><%= t(".calendar_url") %></h3>
7
+ <div data-dialog-container>
8
+ <%= icon "share-forward-2-line" %>
9
+ <h2 id="dialog-title-calendarShare" tabindex="-1" data-dialog-title><%= t(".calendar_url") %></h2>
11
10
 
12
- <p id="dialog-desc-calendarShare" class="meeting-list__modal-text"><%= t(".copy_calendar_url_description") %></p>
13
- <p class="meeting-list__modal-text"><%= t(".copy_calendar_url_explanation") %></p>
11
+ <div class="space-y-8">
12
+ <p id="dialog-desc-calendarShare" class="meeting-list__modal-text"><%= t(".copy_calendar_url_description") %></p>
13
+ <p class="meeting-list__modal-text"><%= t(".copy_calendar_url_explanation") %></p>
14
14
 
15
- <div class="meeting-list__modal-input">
16
- <input id="urlCalendarUrl" type="text" title="<%= t(".calendar_url") %>" value="<%= "#{path}" %>" readonly>
17
- <button
18
- data-controller="clipboard-copy"
19
- data-clipboard-copy="#urlCalendarUrl"
20
- data-clipboard-copy-label="<%= t(".copy_calendar_url_copied") %>"
21
- data-clipboard-copy-message="<%= t(".copy_calendar_url_message") %>"
22
- aria-label="<%= t(".copy_calendar_url_clarification") %>">
23
- <%= icon "file-copy-line", class: "w-5 h-6 text-secondary fill-current" %>
24
- <span class="sr-only"><%= t(".copy_calendar_url") %></span>
25
- </button>
15
+ <div class="meeting-list__modal-input">
16
+ <input id="urlCalendarUrl" type="text" title="<%= t(".calendar_url") %>" value="<%= "#{path}" %>" readonly>
17
+ <button
18
+ data-controller="clipboard-copy"
19
+ data-clipboard-copy="#urlCalendarUrl"
20
+ data-clipboard-copy-label="<%= t(".copy_calendar_url_copied") %>"
21
+ data-clipboard-copy-message="<%= t(".copy_calendar_url_message") %>"
22
+ aria-label="<%= t(".copy_calendar_url_clarification") %>">
23
+ <%= icon "file-copy-line" %>
24
+ <span class="sr-only"><%= t(".copy_calendar_url") %></span>
25
+ </button>
26
+ </div>
26
27
  </div>
27
28
  </div>
28
- </div>
29
29
  <% end %>
@@ -6,7 +6,7 @@
6
6
  </div>
7
7
 
8
8
  <div class="row column">
9
- <%= form.translated :editor, :description, resource_mentionable: true, aria: { label: :description } %>
9
+ <%= form.translated :editor, :description, mentionable: true, resource_mentionable: true, aria: { label: :description } %>
10
10
  </div>
11
11
 
12
12
  <div class="row column">
@@ -14,7 +14,7 @@
14
14
  </span>
15
15
 
16
16
  <span class="ml-auto flex flex-row-reverse items-center gap-2">
17
- <button id="<%= id %>-button" type="button" class="question--collapse <%= "question-error" if is_expanded %>" data-controls="panel-<%= id %>-question-card">
17
+ <button id="<%= id %>-button" type="button" class="question--collapse" data-controls="panel-<%= id %>-question-card" data-open="<%= is_expanded %>">
18
18
  <span class="icon-collapse">
19
19
  <%== icon "arrow-up-s-line", aria_label: t("collapse", scope: "decidim.forms.admin.questionnaires.question"), role: "img" %>
20
20
  </span>
@@ -3,7 +3,7 @@
3
3
  </div>
4
4
 
5
5
  <div>
6
- <%= text_editor_for(form, :description) %>
6
+ <%= text_editor_for(form, :description, mentionable: true, data: { controller: "mention", search_prompt: t("decidim.shared.mentions.search_prompt") }) %>
7
7
  </div>
8
8
 
9
9
  <div>
@@ -439,7 +439,7 @@ ca:
439
439
  success: Enquesta actualitzada correctament.
440
440
  poll:
441
441
  edit:
442
- title: Edita l'enquesta
442
+ title: Editar l'enquesta
443
443
  form:
444
444
  announcement_html:
445
445
  - Quan una pregunta rep respostes o està publicada/tancada, ja no es pot seguir editant.
@@ -448,7 +448,7 @@ ca:
448
448
  - Visita la <a href='%{admin_link}'>pàgina d'administració d'enquestes</a> per enviar preguntes i publicar resultats.
449
449
  registration_form:
450
450
  edit_questions:
451
- title: Edita les preguntes
451
+ title: Editar les preguntes
452
452
  registrations:
453
453
  edit:
454
454
  save: Desa
@@ -167,6 +167,7 @@ de:
167
167
  announcement: Ankündigung
168
168
  clear_all: Alles löschen
169
169
  comments_enabled: Kommentare aktiviert
170
+ comments_max_length: Maximale Zeichenanzahl pro Kommentar (0 für Standardwert)
170
171
  creation_enabled_for_participants: Teilnehmende können Veranstaltungen erstellen
171
172
  default_registration_terms: Standard-Registrierungsbedingungen
172
173
  define_taxonomy_filters: Bitte definieren Sie einige Filter für diesen partizipativen Bereich, bevor Sie diese Einstellung verwenden.
@@ -353,10 +354,14 @@ de:
353
354
  index:
354
355
  invites: Lädt ein
355
356
  registrations_disabled: Sie können keine Teilnehmende einladen, weil Registrierungen deaktiviert sind.
357
+ title: Teilnehmende einladen
356
358
  meeting_closes:
357
359
  edit:
358
360
  close: Schließen
359
361
  title: Veranstaltung abschliessen
362
+ meeting_copies:
363
+ new:
364
+ title: Veranstaltung duplizieren
360
365
  meetings:
361
366
  close:
362
367
  invalid: Beim Abschliessen dieser Veranstaltung ist ein Problem aufgetreten.
@@ -389,6 +394,7 @@ de:
389
394
  assign: Zuweisen
390
395
  link_a_space: Bereich verknüpfen
391
396
  private_meeting_warning: Verknüpfte Bereiche werden nicht angewendet, wenn die Veranstaltung privat und nicht transparent ist.
397
+ restricted_space_warning: Verknüpfte Bereiche werden nicht angewendet, wenn die Veranstaltung zu einem eingeschränkten Bereich gehört.
392
398
  select: Einen Bereich auswählen
393
399
  table:
394
400
  actions: Aktionen
@@ -432,15 +438,21 @@ de:
432
438
  invalid: Beim Aktualisieren der Veranstaltungsumfrage ist ein Problem aufgetreten.
433
439
  success: Veranstaltungsumfrage erfolgreich aktualisiert.
434
440
  poll:
441
+ edit:
442
+ title: Umfrage bearbeiten
435
443
  form:
436
444
  announcement_html:
437
445
  - Wenn eine Frage Antworten erhalten hat oder veröffentlicht/geschlossen wird, kann sie nicht mehr bearbeitet werden.
438
446
  - Sie können jederzeit eine neue Frage hinzufügen.
439
447
  - Die Umfrage wird geschlossen, wenn die Ergebnisse aller erstellten Fragen veröffentlicht wurden.
440
448
  - Besuchen Sie die <a href='%{admin_link}'>Umfrageverwaltungsseite</a> um Fragen zu versenden oder Ergebnisse zu veröffentlichen.
449
+ registration_form:
450
+ edit_questions:
451
+ title: Fragen bearbeiten
441
452
  registrations:
442
453
  edit:
443
454
  save: Speichern
455
+ title: Anmeldungen
444
456
  form:
445
457
  available_slots_help: Belassen Sie es auf 0, wenn Sie unbegrenzte Plätze zur Verfügung haben.
446
458
  invites: Lädt ein
@@ -804,7 +816,7 @@ de:
804
816
  longitude: Der Längengrad des Veranstaltungsorts
805
817
  online_meeting_url: Die URL der Online-Veranstaltung
806
818
  organizations: Die Organisationen, die an dieser Veranstaltung teilnehmen
807
- participatory_space: Zu welchem Bereich diese Veranstaltung gehört (z.B. Beteiligungsprozesse oder Gremien)
819
+ participatory_space: Zu welchem Bereich diese Veranstaltung gehört (z.B. Beteiligungsprozesse oder Versammlungen)
808
820
  private_meeting: Um anzugeben, ob die Veranstaltung privat ist oder nicht
809
821
  published: Wann die Veranstaltung veröffentlicht wurde
810
822
  reference: Die eindeutige Bezeichnung der Ressource auf dieser Plattform
@@ -394,7 +394,7 @@ es:
394
394
  assign: Asignar
395
395
  link_a_space: Vincular un espacio
396
396
  private_meeting_warning: Los espacios enlazados no se aplicarán si la reunión es privada y no transparente.
397
- restricted_space_warning: Los espacios enlazados no se aplicarán cuando el encuentro pertenezca a un espacio restringido no transparente.
397
+ restricted_space_warning: Los espacios enlazados no se aplicarán cuando el encuentro pertenezca a un espacio restringido.
398
398
  select: Selecciona un espacio
399
399
  table:
400
400
  actions: Acciones