decidim-meetings 0.31.7 → 0.31.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb8e788a06fbd1e4d552dae942c93032605099dd1dc9dce352dc5deb4e2ac3f9
4
- data.tar.gz: eab2396fa737ab3ddddd37a2161e5d42973da5d2a50a48816a8df16409f061be
3
+ metadata.gz: e897fff27ccb0638be49d2b715babbc69d305fb7ba3982e081908d9fcd1b34d8
4
+ data.tar.gz: 329071b0ef486cdd1bcad21b4c3d003c681e666a1ede2b7762dbb96b3f526a82
5
5
  SHA512:
6
- metadata.gz: 98d97460223b683318c49d08a39c6f8820008a7fa11e7bc2e244f3bd68b65ccc6ecd61e6ba0deea86b7cf7fae1a93e8a3ac3b5cbd89ff8a7dbc020e47bc66931
7
- data.tar.gz: 72cb96584ea8e505c8610b267c0cad20c55e6efb5d0786f43b5bb1f6e6b17e84865c1b36a92eeb03942f8dade49f28460123a6b9d29e0d76039f0ddce106795d
6
+ metadata.gz: cdc2c8995712f405c8f2f5fbfa7462fd24ff2070c3c6749e3e6247cc3892573d37531753844f475ff76cba6ba5d013ed14416f99bf3b48bd53a7ff1bf3a47073
7
+ data.tar.gz: c72b045dd0cea7d9411bf4cd0eab36d8a09fea67450a7d8fc8c60eb81e9467b84df7f3029b833a065358c89cd351ef89fcb112b56ae02f65cd2d72249f3e3fbd
@@ -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
@@ -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 %>
@@ -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>
@@ -144,6 +144,7 @@ de:
144
144
  success: Veranstaltung erfolgreich dupliziert.
145
145
  new:
146
146
  copy: Kopieren
147
+ title: Veranstaltung duplizieren
147
148
  tooltips:
148
149
  cannot_close_meetings: Diese Veranstaltung kann nicht abgeschlossen werden, da sie von einem Teilnehmenden erstellt wurde
149
150
  cannot_duplicate_meetings: Dieses Meeting kann nicht dupliziert werden, da es von einem Teilnehmenden erstellt wurde
@@ -166,6 +167,7 @@ de:
166
167
  announcement: Ankündigung
167
168
  clear_all: Alles löschen
168
169
  comments_enabled: Kommentare aktiviert
170
+ comments_max_length: Maximale Zeichenanzahl pro Kommentar (0 für Standardwert)
169
171
  creation_enabled_for_participants: Teilnehmende können Veranstaltungen erstellen
170
172
  default_registration_terms: Standard-Registrierungsbedingungen
171
173
  define_taxonomy_filters: Bitte definieren Sie einige Filter für diesen partizipativen Bereich, bevor Sie diese Einstellung verwenden.
@@ -350,6 +352,7 @@ de:
350
352
  non_user: Nicht existierender Benutzer
351
353
  select_user: Nutzer wählen
352
354
  index:
355
+ invite_attendee: Teilnehmende einladen
353
356
  invites: Lädt ein
354
357
  registrations_disabled: Sie können keine Teilnehmende einladen, weil Registrierungen deaktiviert sind.
355
358
  meeting_closes:
@@ -804,7 +807,7 @@ de:
804
807
  longitude: Der Längengrad des Veranstaltungsorts
805
808
  online_meeting_url: Die URL der Online-Veranstaltung
806
809
  organizations: Die Organisationen, die an dieser Veranstaltung teilnehmen
807
- participatory_space: Zu welchem Bereich diese Veranstaltung gehört (z.B. Beteiligungsprozesse oder Gremien)
810
+ participatory_space: Zu welchem Bereich diese Veranstaltung gehört (z.B. Beteiligungsprozesse oder Versammlungen)
808
811
  private_meeting: Um anzugeben, ob die Veranstaltung privat ist oder nicht
809
812
  published: Wann die Veranstaltung veröffentlicht wurde
810
813
  reference: Die eindeutige Bezeichnung der Ressource auf dieser Plattform