decidim-meetings 0.26.2 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +1 -1
  3. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings/show.erb +1 -1
  4. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb +2 -2
  5. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +10 -1
  6. data/app/commands/decidim/meetings/admin/close_meeting.rb +1 -1
  7. data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -1
  8. data/app/commands/decidim/meetings/admin/create_agenda.rb +1 -1
  9. data/app/commands/decidim/meetings/admin/create_meeting.rb +1 -4
  10. data/app/commands/decidim/meetings/admin/destroy_meeting.rb +1 -1
  11. data/app/commands/decidim/meetings/admin/export_meeting_registrations.rb +1 -1
  12. data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +9 -11
  13. data/app/commands/decidim/meetings/admin/publish_meeting.rb +1 -1
  14. data/app/commands/decidim/meetings/admin/unpublish_meeting.rb +1 -1
  15. data/app/commands/decidim/meetings/admin/update_agenda.rb +1 -1
  16. data/app/commands/decidim/meetings/admin/update_meeting.rb +1 -4
  17. data/app/commands/decidim/meetings/admin/update_question_status.rb +1 -1
  18. data/app/commands/decidim/meetings/admin/update_questionnaire.rb +10 -7
  19. data/app/commands/decidim/meetings/admin/update_registrations.rb +5 -3
  20. data/app/commands/decidim/meetings/admin/validate_registration_code.rb +1 -1
  21. data/app/commands/decidim/meetings/close_meeting.rb +1 -1
  22. data/app/commands/decidim/meetings/create_answer.rb +1 -1
  23. data/app/commands/decidim/meetings/create_meeting.rb +1 -1
  24. data/app/commands/decidim/meetings/decline_invitation.rb +1 -1
  25. data/app/commands/decidim/meetings/join_meeting.rb +15 -7
  26. data/app/commands/decidim/meetings/leave_meeting.rb +3 -3
  27. data/app/commands/decidim/meetings/update_meeting.rb +1 -1
  28. data/app/commands/decidim/meetings/withdraw_meeting.rb +1 -1
  29. data/app/controllers/concerns/decidim/meetings/admin/filterable.rb +4 -4
  30. data/app/controllers/concerns/decidim/meetings/filterable.rb +1 -7
  31. data/app/controllers/decidim/meetings/calendars_controller.rb +1 -1
  32. data/app/controllers/decidim/meetings/directory/meetings_controller.rb +17 -15
  33. data/app/controllers/decidim/meetings/meetings_controller.rb +21 -14
  34. data/app/events/decidim/meetings/meeting_registration_notification_event.rb +1 -1
  35. data/app/forms/decidim/meetings/admin/close_meeting_form.rb +1 -1
  36. data/app/forms/decidim/meetings/admin/meeting_form.rb +2 -5
  37. data/app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb +1 -1
  38. data/app/forms/decidim/meetings/admin/meeting_registrations_form.rb +3 -0
  39. data/app/forms/decidim/meetings/answer_form.rb +0 -1
  40. data/app/forms/decidim/meetings/close_meeting_form.rb +1 -1
  41. data/app/forms/decidim/meetings/meeting_form.rb +2 -2
  42. data/app/helpers/decidim/meetings/application_helper.rb +1 -1
  43. data/app/helpers/decidim/meetings/directory/application_helper.rb +1 -1
  44. data/app/helpers/decidim/meetings/meetings_helper.rb +1 -3
  45. data/app/jobs/decidim/meetings/send_close_meeting_reminder_job.rb +17 -0
  46. data/app/mailers/decidim/meetings/close_meeting_reminder_mailer.rb +43 -0
  47. data/app/models/decidim/meetings/answer.rb +2 -2
  48. data/app/models/decidim/meetings/invite.rb +2 -2
  49. data/app/models/decidim/meetings/meeting.rb +34 -16
  50. data/app/models/decidim/meetings/questionnaire.rb +6 -0
  51. data/app/models/decidim/meetings/registration.rb +2 -2
  52. data/app/packs/src/decidim/meetings/admin/meetings_form.js +0 -4
  53. data/app/packs/src/decidim/meetings/admin/registrations_form.js +2 -0
  54. data/app/presenters/decidim/meetings/admin_log/questionnaire_presenter.rb +39 -0
  55. data/app/queries/decidim/meetings/admin/invites.rb +1 -1
  56. data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
  57. data/app/queries/decidim/meetings/questionnaire_user_answers.rb +1 -1
  58. data/app/serializers/decidim/meetings/{data_portability_invite_serializer.rb → download_your_data_invite_serializer.rb} +2 -2
  59. data/app/serializers/decidim/meetings/{data_portability_registration_serializer.rb → download_your_data_registration_serializer.rb} +2 -2
  60. data/app/services/decidim/meetings/calendar/base_calendar.rb +4 -3
  61. data/app/services/decidim/meetings/calendar/component_calendar.rb +7 -9
  62. data/app/services/decidim/meetings/calendar/organization_calendar.rb +1 -1
  63. data/app/services/decidim/meetings/calendar_renderer.rb +4 -4
  64. data/app/services/decidim/meetings/close_meeting_reminder_generator.rb +68 -0
  65. data/app/services/decidim/meetings/meeting_iframe_embedder.rb +10 -6
  66. data/app/services/decidim/meetings/meeting_search.rb +7 -53
  67. data/app/views/decidim/meetings/_calendar_modal.html.erb +19 -2
  68. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +4 -16
  69. data/app/views/decidim/meetings/admin/registrations/_form.html.erb +9 -0
  70. data/app/views/decidim/meetings/close_meeting_reminder_mailer/close_meeting_reminder.html.erb +5 -0
  71. data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +7 -7
  72. data/app/views/decidim/meetings/directory/meetings/_meetings.html.erb +6 -1
  73. data/app/views/decidim/meetings/directory/meetings/index.html.erb +1 -1
  74. data/app/views/decidim/meetings/directory/meetings/index.js.erb +7 -1
  75. data/app/views/decidim/meetings/layouts/live_event.html.erb +6 -2
  76. data/app/views/decidim/meetings/meetings/_count.html.erb +1 -1
  77. data/app/views/decidim/meetings/meetings/_filters.html.erb +7 -7
  78. data/app/views/decidim/meetings/meetings/_form.html.erb +4 -2
  79. data/app/views/decidim/meetings/meetings/_meetings.html.erb +11 -6
  80. data/app/views/decidim/meetings/meetings/index.html.erb +2 -2
  81. data/app/views/decidim/meetings/meetings/index.js.erb +7 -1
  82. data/config/locales/am-ET.yml +1 -0
  83. data/config/locales/ar.yml +4 -7
  84. data/config/locales/bg.yml +1 -0
  85. data/config/locales/ca.yml +24 -10
  86. data/config/locales/cs.yml +24 -10
  87. data/config/locales/da.yml +1 -0
  88. data/config/locales/de.yml +10 -13
  89. data/config/locales/el.yml +1 -0
  90. data/config/locales/en.yml +23 -10
  91. data/config/locales/eo.yml +1 -0
  92. data/config/locales/es-MX.yml +25 -11
  93. data/config/locales/es-PY.yml +25 -11
  94. data/config/locales/es.yml +25 -11
  95. data/config/locales/et.yml +1 -0
  96. data/config/locales/eu.yml +10 -11
  97. data/config/locales/fi-plain.yml +24 -10
  98. data/config/locales/fi.yml +24 -10
  99. data/config/locales/fr-CA.yml +22 -10
  100. data/config/locales/fr.yml +22 -10
  101. data/config/locales/ga-IE.yml +1 -9
  102. data/config/locales/gl.yml +14 -2
  103. data/config/locales/hr.yml +1 -0
  104. data/config/locales/hu.yml +16 -8
  105. data/config/locales/id-ID.yml +1 -0
  106. data/config/locales/is-IS.yml +2 -1
  107. data/config/locales/it.yml +7 -11
  108. data/config/locales/ja.yml +26 -12
  109. data/config/locales/ko.yml +1 -0
  110. data/config/locales/lb.yml +6 -6
  111. data/config/locales/lt.yml +1 -0
  112. data/config/locales/lv.yml +1 -0
  113. data/config/locales/mt.yml +1 -0
  114. data/config/locales/nl.yml +7 -11
  115. data/config/locales/no.yml +7 -12
  116. data/config/locales/om-ET.yml +1 -0
  117. data/config/locales/pl.yml +2 -10
  118. data/config/locales/pt-BR.yml +3 -13
  119. data/config/locales/pt.yml +6 -11
  120. data/config/locales/ro-RO.yml +8 -8
  121. data/config/locales/ru.yml +1 -0
  122. data/config/locales/si-LK.yml +1 -0
  123. data/config/locales/sk.yml +1 -0
  124. data/config/locales/sl.yml +1 -0
  125. data/config/locales/so-SO.yml +1 -0
  126. data/config/locales/sr-CS.yml +1 -0
  127. data/config/locales/sv.yml +15 -11
  128. data/config/locales/sw-KE.yml +1 -0
  129. data/config/locales/ti-ER.yml +1 -0
  130. data/config/locales/tr-TR.yml +1 -11
  131. data/config/locales/uk.yml +1 -0
  132. data/config/locales/val-ES.yml +1 -0
  133. data/config/locales/vi.yml +1 -0
  134. data/config/locales/zh-CN.yml +1 -7
  135. data/config/locales/zh-TW.yml +1 -0
  136. data/db/migrate/20210512100333_drop_decidim_meetings_minutes_table.rb +2 -2
  137. data/db/migrate/20210518133236_merge_minutes_with_closing_report_in_meetings_table.rb +1 -1
  138. data/db/migrate/20211105115625_remove_not_null_on_customize_registration_email.rb +7 -0
  139. data/lib/decidim/api/meeting_type.rb +1 -1
  140. data/lib/decidim/meetings/component.rb +5 -5
  141. data/lib/decidim/meetings/{data_portability_user_answers_serializer.rb → download_your_data_user_answers_serializer.rb} +2 -2
  142. data/lib/decidim/meetings/engine.rb +14 -0
  143. data/lib/decidim/meetings/test/factories.rb +3 -1
  144. data/lib/decidim/meetings/test/notifications_handling.rb +1 -1
  145. data/lib/decidim/meetings/test/translated_event.rb +2 -2
  146. data/lib/decidim/meetings/version.rb +1 -1
  147. data/lib/decidim/meetings.rb +5 -1
  148. metadata +27 -22
  149. data/app/services/decidim/meetings/directory/meeting_search.rb +0 -53
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ # This class is the generator class which creates and updates meetings related reminders,
6
+ # after reminder is generated it is send to user who have not closed past meetings.
7
+ class CloseMeetingReminderGenerator
8
+ attr_reader :reminder_jobs_queued
9
+
10
+ def initialize
11
+ @reminder_manifest = Decidim.reminders_registry.for(:close_meeting)
12
+ @reminder_jobs_queued = 0
13
+ end
14
+
15
+ # Creates reminders and updates them if they already exists.
16
+ def generate
17
+ Decidim::Component.where(manifest_name: "meetings").published.each do |component|
18
+ send_reminders(component)
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :reminder_manifest
25
+
26
+ def finder_query(component_id, interval)
27
+ Decidim::Meetings::Meeting
28
+ .published
29
+ .not_hidden
30
+ .except_withdrawn
31
+ .where(
32
+ "decidim_component_id = ? AND end_time >= ? AND end_time <= ? AND closed_at IS NULL",
33
+ component_id,
34
+ interval.ago.beginning_of_day,
35
+ interval.ago.end_of_day
36
+ )
37
+ end
38
+
39
+ def send_reminders(component)
40
+ intervals = Array(reminder_manifest.settings.attributes[:reminder_times].default)
41
+ space_admins = Decidim::ParticipatoryProcessUserRole.where(decidim_participatory_process_id: component.participatory_space_id, role: "admin").collect(&:user)
42
+ space_admins = (global_admins + space_admins).uniq
43
+ intervals.each do |interval|
44
+ finder_query(component.id, interval).find_each do |meeting|
45
+ authors = meeting.official? ? space_admins : [meeting.author]
46
+ authors.each do |author|
47
+ send_notif = author.notification_settings.fetch("close_meeting_reminder", "1")
48
+ next unless send_notif == "1"
49
+
50
+ reminder = Decidim::Reminder.find_or_create_by(user: author, component: component)
51
+ record = Decidim::ReminderRecord.find_or_create_by(reminder: reminder, remindable: meeting)
52
+ record.update(state: "active") unless record.active?
53
+ reminder.records << record
54
+ reminder.save!
55
+
56
+ Decidim::Meetings::SendCloseMeetingReminderJob.perform_later(record)
57
+ @reminder_jobs_queued += 1
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+ def global_admins
64
+ @global_admins ||= Decidim::User.where(admin: true).all
65
+ end
66
+ end
67
+ end
68
+ end
@@ -30,28 +30,31 @@ module Decidim
30
30
  def embeddable?
31
31
  return nil if parsed_online_meeting_uri.nil?
32
32
 
33
- EMBEDDABLE_SERVICES.include?(parsed_online_meeting_uri.host)
33
+ embeddable_services.include?(parsed_online_meeting_uri.host)
34
34
  end
35
35
 
36
36
  def embed_code(request_host)
37
37
  return nil if parsed_online_meeting_uri.nil?
38
38
 
39
39
  %(
40
- <iframe
40
+ <div
41
+ class="disabled-iframe"
41
42
  allow="camera; microphone; fullscreen; display-capture; autoplay"
42
43
  loading="lazy"
43
44
  src="#{embed_transformed_url(request_host)}"
44
45
  style="height: 100%; width: 100%; border: 0px;"
45
- ></iframe>
46
+ ></div>
46
47
  )
47
48
  end
48
49
 
49
50
  private
50
51
 
51
- EMBEDDABLE_SERVICES = %( www.youtube.com www.twitch.tv meet.jit.si )
52
-
53
52
  attr_accessor :online_meeting_service_url
54
53
 
54
+ def embeddable_services
55
+ @embeddable_services ||= Meetings.embeddable_services
56
+ end
57
+
55
58
  # Youtube transformation consists on:
56
59
  # 1. extract the video id from the parameter v
57
60
  # 2. Create a new URL using the domain youtube-nocookie.com, converting it to an embed
@@ -59,7 +62,8 @@ module Decidim
59
62
  def transform_youtube_url(uri)
60
63
  return online_meeting_service_url if uri.query.blank?
61
64
 
62
- video_id = CGI.parse(uri.query).fetch("v")&.first
65
+ parsed_query = CGI.parse(uri.query)
66
+ video_id = parsed_query.has_key?("v") ? CGI.parse(uri.query).fetch("v")&.first : nil
63
67
 
64
68
  return online_meeting_service_url if video_id.blank?
65
69
 
@@ -2,63 +2,17 @@
2
2
 
3
3
  module Decidim
4
4
  module Meetings
5
- # This class handles search and filtering of meetings. Needs a
6
- # `current_component` param with a `Decidim::Component` in order to
7
- # find the meetings.
5
+ # This service scopes the meeting searches with parameters that cannot be
6
+ # passed from the user interface.
8
7
  class MeetingSearch < ResourceSearch
9
- text_search_fields :title, :description
8
+ attr_reader :activity
10
9
 
11
- # Public: Initializes the service.
12
- # component - A Decidim::Component to get the meetings from.
13
- # page - The page number to paginate the results.
14
- # per_page - The number of meetings to return per page.
15
- def initialize(options = {})
16
- options[:scope] = options.fetch(:scope, Meeting.published)
17
- options[:scope] = options[:state] == "withdrawn" ? options[:scope].withdrawn : options[:scope].except_withdrawn
18
- options[:scope] = options[:scope].includes(:component, :attachments)
19
- super(options[:scope], options)
20
- end
21
-
22
- # Handle the date filter
23
- def search_date
24
- apply_scopes(%w(upcoming past), date)
25
- end
26
-
27
- def search_space
28
- return query if options[:space].blank? || options[:space] == "all"
29
-
30
- query.joins(:component).where(decidim_components: { participatory_space_type: options[:space].classify })
31
- end
10
+ def build(params)
11
+ @activity = params[:activity]
32
12
 
33
- def search_type
34
- fields = Decidim::Meetings::Meeting::TYPE_OF_MEETING
35
- filtered = []
36
- options[:type].each do |inquiry|
37
- filtered.push(inquiry) if fields.include?(inquiry)
38
- end
39
- filtered.size.positive? ? query.where(decidim_meetings_meetings: { type_of_meeting: filtered }) : query
40
- end
41
-
42
- # Handle the activity filter
43
- def search_activity
44
- case activity
45
- when "my_meetings"
46
- query
47
- .where(decidim_author_id: user.id)
48
- else
49
- query
50
- end
51
- end
52
-
53
- # Handle the state filter
54
- def search_state
55
- return query.withdrawn if state == "withdrawn"
56
-
57
- query.except_withdrawn
58
- end
13
+ add_scope(:authored_by, user) if params[:activity] == "my_meetings" && user
59
14
 
60
- def results
61
- super.includes(attachments: :file_attachment, component: { participatory_space: :organization })
15
+ super
62
16
  end
63
17
  end
64
18
  end
@@ -2,12 +2,29 @@
2
2
  <%= t(".export_calendar") %>
3
3
  <%= icon "share", class: "icon--after", role: "img", "aria-hidden": true %>
4
4
  </button>
5
+
5
6
  <div class="reveal" id="calendarShare" data-reveal>
6
7
  <div class="reveal__header">
7
- <h2 class="reveal__title"><%= t(".calendar_url") %>:</h2>
8
+ <h3 class="reveal__title"><%= t(".calendar_url") %>:</h3>
8
9
  <button class="close-button" data-close aria-label="<%= t(".close_window") %>" type="button">
9
10
  <span aria-hidden="true">&times;</span>
10
11
  </button>
11
12
  </div>
12
- <input type="text" value="<%= "#{path}" %>" readonly title="<%= t(".calendar_url") %>">
13
+
14
+ <div class="calendar-url-description"><%= t(".copy_calendar_url_description") %></div>
15
+ <div class="calendar-url-explanation"><%= t(".copy_calendar_url_explanation") %></div>
16
+
17
+ <div class="input-group calendar_url_input">
18
+ <input id="urlCalendarUrl" class="input-group-field" type="text" title="<%= t(".calendar_url") %>" value="<%= "#{path}" %>" readonly>
19
+ <div class="input-group-button">
20
+ <button class="button primary"
21
+ data-clipboard-copy="#urlCalendarUrl"
22
+ data-clipboard-copy-label="<%= t(".copy_calendar_url_copied") %>"
23
+ data-clipboard-copy-message="<%= t(".copy_calendar_url_message") %>"
24
+ aria-label="<%= t(".copy_calendar_url_clarification") %>">
25
+ <%= icon "clipboard", role: "img", "aria-hidden": true %>
26
+ <%= t(".copy_calendar_url") %>
27
+ </button>
28
+ </div>
29
+ </div>
13
30
  </div>
@@ -43,7 +43,7 @@
43
43
  <%= form.select :iframe_embed_type,
44
44
  @form.iframe_embed_type_select,
45
45
  { multiple: false } %>
46
- <p class="help-text"><%= t(".show_embedded_iframe_help") %></p>
46
+ <p class="help-text"><%= t(".show_embedded_iframe_help", domains: Decidim::Meetings.embeddable_services&.join(" ")) %></p>
47
47
  </div>
48
48
 
49
49
  <div class="row column field iframe-fields--access-level" data-meeting-type="online-access-level">
@@ -82,15 +82,12 @@
82
82
  { multiple: false } %>
83
83
  </div>
84
84
 
85
- <div class="row column" id="meeting_available_slots">
86
- <%= form.number_field :available_slots %>
87
- <p class="help-text"><%= t(".available_slots_help") %></p>
88
- </div>
89
-
90
85
  <div class="field" id="meeting_registration_url">
91
86
  <%= form.text_field :registration_url %>
92
87
  <p class="help-text"><%= t(".registration_url_help") %></p>
93
- <label><%= t(".disclaimer", organization: current_component.organization.name) %></label><br>
88
+ <div class="callout alert">
89
+ <%= t(".disclaimer", organization: current_component.organization.name) %>
90
+ </div>
94
91
  </div>
95
92
 
96
93
  <div class="row column" id="private_meeting">
@@ -101,15 +98,6 @@
101
98
  <%= form.check_box :transparent %>
102
99
  </div>
103
100
 
104
- <div class="row column">
105
- <%= form.check_box :customize_registration_email, :"data-toggle" => "customize_registration_email-div" %>
106
- </div>
107
-
108
- <div id="customize_registration_email-div" data-toggler=".hide" class="row column <%= @form.customize_registration_email? ? nil : "hide" %>">
109
- <%= form.translated :editor, :registration_email_custom_content, lines: 10 %>
110
- <p class="help-text"><%= t(".registration_email_help") %></p>
111
- </div>
112
-
113
101
  <%= render partial: "decidim/comments/admin/shared/availability_fields", locals: { form: form } %>
114
102
  </div>
115
103
  </div>
@@ -41,6 +41,15 @@
41
41
  <p class="help-text"><%= t(".reserved_slots_help") %></p>
42
42
  </div>
43
43
 
44
+ <div class="row column">
45
+ <%= form.check_box :customize_registration_email, :"data-toggle" => "customize_registration_email-div" %>
46
+ </div>
47
+
48
+ <div id="customize_registration_email-div" data-toggler=".hide" class="row column <%= @form.customize_registration_email? ? nil : "hide" %>">
49
+ <%= form.translated :editor, :registration_email_custom_content, lines: 10 %>
50
+ <p class="help-text"><%= t(".registration_email_help") %></p>
51
+ </div>
52
+
44
53
  <div class="row column">
45
54
  <%= form.translated :editor, :registration_terms %>
46
55
  </div>
@@ -0,0 +1,5 @@
1
+ <p class="email-greeting"><%= t "decidim.meetings.close_meeting_reminder_mailer.close_meeting_reminder.hello", username: @user.name %></p>
2
+
3
+ <p class="email-instructions"><%= t("decidim.meetings.close_meeting_reminder_mailer.close_meeting_reminder.body", meeting_title: translated_attribute(@meeting.title), meeting_path: @meeting.reported_content_url).html_safe %></p>
4
+
5
+ <p class="email-closing"><%= t("decidim.meetings.close_meeting_reminder_mailer.close_meeting_reminder.greetings", organization_name: h(@organization.name), organization_url: decidim.root_url(host: @organization.host)).html_safe %></p>
@@ -4,7 +4,7 @@
4
4
  <div class="filters__section">
5
5
  <div class="filters__search">
6
6
  <div class="input-group">
7
- <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t("decidim.meetings.meetings.filters.search"), title: t("decidim.meetings.meetings.filters.search"), "aria-label": t("decidim.meetings.meetings.filters.search"), data: { disable_dynamic_change: true } %>
7
+ <%= form.search_field :title_or_description_cont, label: false, class: "input-group-field", placeholder: t("decidim.meetings.meetings.filters.search"), title: t("decidim.meetings.meetings.filters.search"), "aria-label": t("decidim.meetings.meetings.filters.search"), data: { disable_dynamic_change: true } %>
8
8
  <div class="input-group-button">
9
9
  <button type="submit" class="button" aria-controls="meetings">
10
10
  <%= icon "magnifying-glass", aria_label: t("decidim.meetings.meetings.filters.search"), role: "img" %>
@@ -15,18 +15,18 @@
15
15
  </div>
16
16
 
17
17
  <% unless @forced_past_meetings %>
18
- <%= form.check_boxes_tree :date, filter_date_values, legend_title: t("decidim.meetings.meetings.filters.date") %>
18
+ <%= form.check_boxes_tree :with_any_date, filter_date_values, legend_title: t("decidim.meetings.meetings.filters.date") %>
19
19
  <% end %>
20
20
 
21
- <%= form.check_boxes_tree :type, filter_type_values, legend_title: t("decidim.meetings.meetings.filters.type") %>
21
+ <%= form.check_boxes_tree :with_any_type, filter_type_values, legend_title: t("decidim.meetings.meetings.filters.type") %>
22
22
 
23
- <%= form.check_boxes_tree :scope_id, directory_filter_scopes_values, legend_title: t("decidim.meetings.meetings.filters.scope") %>
23
+ <%= form.check_boxes_tree :with_any_scope, directory_filter_scopes_values, legend_title: t("decidim.meetings.meetings.filters.scope") %>
24
24
 
25
- <%= form.check_boxes_tree :category_id, directory_filter_categories_values, legend_title: t("decidim.meetings.meetings.filters.category") %>
25
+ <%= form.check_boxes_tree :with_any_global_category, directory_filter_categories_values, legend_title: t("decidim.meetings.meetings.filters.category") %>
26
26
 
27
- <%= form.check_boxes_tree :origin, directory_filter_origin_values, legend_title: t("decidim.meetings.meetings.filters.origin") %>
27
+ <%= form.check_boxes_tree :with_any_origin, directory_filter_origin_values, legend_title: t("decidim.meetings.meetings.filters.origin") %>
28
28
 
29
- <%= form.check_boxes_tree :space, directory_meeting_spaces_values, legend_title: t("decidim.meetings.directory.meetings.index.space_type") %>
29
+ <%= form.check_boxes_tree :with_any_space, directory_meeting_spaces_values, legend_title: t("decidim.meetings.directory.meetings.index.space_type") %>
30
30
 
31
31
  <% if current_user %>
32
32
  <%= form.collection_radio_buttons :activity, activity_filter_values, :first, :last, { legend_title: t("decidim.meetings.meetings.filters.activity") }, "aria-controls": "meetings" %>
@@ -8,7 +8,12 @@
8
8
  <%= render partial: "decidim/shared/results_per_page" %>
9
9
  </div>
10
10
  <div class="column">
11
- <%= render partial: "decidim/meetings/calendar_modal", locals: { path: calendar_url } %>
11
+ <%= render partial: "decidim/meetings/calendar_modal", locals: {
12
+ path: short_url(
13
+ route_name: "calendar",
14
+ params: { filter: params.fetch(:filter, {}).try(:to_unsafe_hash) }
15
+ )
16
+ } %>
12
17
  </div>
13
18
  </div>
14
19
 
@@ -6,7 +6,7 @@
6
6
  <%= render partial: "decidim/meetings/meetings/count" %>
7
7
  </h1>
8
8
 
9
- <%= cell "decidim/meetings/meetings_map", search.results %>
9
+ <%= cell "decidim/meetings/meetings_map", search.result %>
10
10
 
11
11
  <div class="columns mediumlarge-4 large-3">
12
12
  <div class="card card--secondary show-for-mediumlarge">
@@ -1,13 +1,19 @@
1
1
  var $meetings = $('#meetings');
2
2
  var $meetingsCount = $('#meetings-count');
3
3
 
4
+ // make sure that calendar modal will use the updated filter values
5
+ var $calendarShare = $('#calendarShare');
6
+ $calendarShare.remove();
7
+
4
8
  $meetings.html('<%= j(render partial: "meetings").strip.html_safe %>');
5
9
  $meetingsCount.html('<%= j(render partial: "decidim/meetings/meetings/count").strip.html_safe %>');
6
10
 
7
11
  var $dropdownMenu = $('.dropdown.menu', $meetings);
8
12
  $dropdownMenu.foundation();
9
13
 
10
- var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.results).to_json.html_safe %>');
14
+ $("#calendarShare").foundation(); // initialize export calendar on the page
15
+
16
+ var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.result).to_json.html_safe %>');
11
17
 
12
18
  var $map = $("#map");
13
19
  var controller = $map.data("map-controller");
@@ -3,12 +3,13 @@
3
3
  <head>
4
4
  <title><%= decidim_page_title %></title>
5
5
  <%= render partial: "layouts/decidim/head" %>
6
- <%= javascript_pack_tag "decidim_meetings" %>
7
- <%= render partial: "layouts/decidim/js_configuration" %>
8
6
  </head>
9
7
 
10
8
  <body>
11
9
  <%= render partial: "layouts/decidim/timeout_modal" %>
10
+ <%= render partial: "layouts/decidim/cookie_warning" %>
11
+ <%= cell("decidim/data_consent", current_organization) %>
12
+
12
13
  <header class="meeting-polls__header">
13
14
  <% if current_user && poll %>
14
15
  <div class="flex--cc">
@@ -47,5 +48,8 @@
47
48
  <aside class="meeting-polls__aside" id="admin-meeting-poll-aside" data-decidim-admin-meetings-poll='{"questionsUrl":"<%= meeting_polls_questions_path(meeting, admin: true) %>"}'></aside>
48
49
  <%= yield %>
49
50
  </main>
51
+
52
+ <%= render partial: "layouts/decidim/decidim_javascript" %>
53
+ <%= javascript_pack_tag "decidim_meetings" %>
50
54
  </body>
51
55
  </html>
@@ -1 +1 @@
1
- <%= t(".meetings_count", count: search.results.count) %>
1
+ <%= t(".meetings_count", count: search.result.count) %>
@@ -4,7 +4,7 @@
4
4
  <div class="filters__section">
5
5
  <div class="filters__search">
6
6
  <div class="input-group">
7
- <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
7
+ <%= form.search_field :search_text_cont, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
8
8
  <div class="input-group-button">
9
9
  <button type="submit" class="button" aria-controls="meetings">
10
10
  <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
@@ -14,24 +14,24 @@
14
14
  </div>
15
15
  </div>
16
16
 
17
- <%= form.hidden_field "state", value: params.dig("filter", "state") %>
17
+ <%= form.hidden_field "with_availability", value: params.dig("filter", "with_availability") %>
18
18
 
19
19
  <% unless @forced_past_meetings %>
20
- <%= form.check_boxes_tree :date, filter_date_values, legend_title: t(".date") %>
20
+ <%= form.check_boxes_tree :with_any_date, filter_date_values, legend_title: t(".date") %>
21
21
  <% end %>
22
22
 
23
- <%= form.check_boxes_tree :type, filter_type_values, legend_title: t(".type") %>
23
+ <%= form.check_boxes_tree :with_any_type, filter_type_values, legend_title: t(".type") %>
24
24
 
25
25
  <% if current_component.has_subscopes? %>
26
- <%= form.check_boxes_tree :scope_id, filter_scopes_values, legend_title: t(".scope") %>
26
+ <%= form.check_boxes_tree :with_any_scope, filter_scopes_values, legend_title: t(".scope") %>
27
27
  <% end %>
28
28
 
29
29
  <% if current_component.categories.any? %>
30
- <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category") %>
30
+ <%= form.check_boxes_tree :with_any_category, filter_categories_values, legend_title: t(".category") %>
31
31
  <% end %>
32
32
 
33
33
  <% if component_settings.creation_enabled_for_participants? %>
34
- <%= form.check_boxes_tree :origin, filter_origin_values, legend_title: t(".origin") %>
34
+ <%= form.check_boxes_tree :with_any_origin, filter_origin_values, legend_title: t(".origin") %>
35
35
  <% end %>
36
36
 
37
37
  <% if current_user %>
@@ -38,7 +38,7 @@
38
38
  <%= form.select :iframe_embed_type,
39
39
  @form.iframe_embed_type_select,
40
40
  { multiple: false } %>
41
- <p class="help-text"><%= t(".show_embedded_iframe_help") %></p>
41
+ <p class="help-text"><%= t(".show_embedded_iframe_help", domains: Decidim::Meetings.embeddable_services&.join(" ")) %></p>
42
42
  </div>
43
43
 
44
44
  <div class="field iframe-fields--access-level" id="meeting_iframe_embed_type" data-meeting-type="online-access-level">
@@ -98,4 +98,6 @@
98
98
  ) %>
99
99
  </div>
100
100
 
101
- <%= javascript_pack_tag "decidim_meetings" %>
101
+ <% content_for :js_content do %>
102
+ <%= javascript_pack_tag "decidim_meetings" %>
103
+ <% end %>
@@ -1,7 +1,7 @@
1
- <% if params.dig("filter", "state").present? && params["filter"]["state"] == "withdrawn" %>
1
+ <% if params.dig("filter", "with_availability").present? && params["filter"]["with_availability"] == "withdrawn" %>
2
2
  <div class="callout warning">
3
3
  <%= t("decidim.meetings.meetings.index.text_banner",
4
- go_back_link: link_to(t("decidim.meetings.meetings.index.click_here"), meetings_path("filter[state]" => nil)),
4
+ go_back_link: link_to(t("decidim.meetings.meetings.index.click_here"), meetings_path("filter[with_availability]" => nil)),
5
5
  ).html_safe %>
6
6
  </div>
7
7
  <% end %>
@@ -21,7 +21,12 @@
21
21
  <%= render partial: "decidim/shared/results_per_page" %>
22
22
  </div>
23
23
  <div class="column">
24
- <%= render partial: "decidim/meetings/calendar_modal", locals: { path: calendar_url } %>
24
+ <%= render partial: "decidim/meetings/calendar_modal", locals: {
25
+ path: short_url(
26
+ route_name: "calendar",
27
+ params: { filter: params.fetch(:filter, {}).try(:to_unsafe_hash) }
28
+ )
29
+ } %>
25
30
  </div>
26
31
  </div>
27
32
 
@@ -34,10 +39,10 @@
34
39
 
35
40
  <div class="row">
36
41
  <div class="text-right">
37
- <% if params.dig("filter", "state").present? && params["filter"]["state"] == "withdrawn" %>
38
- <%= link_to t("decidim.meetings.meetings.index.see_all"), meetings_path("filter[state]" => nil) %>
42
+ <% if params.dig("filter", "with_availability").present? && params["filter"]["with_availability"] == "withdrawn" %>
43
+ <%= link_to t("decidim.meetings.meetings.index.see_all"), meetings_path("filter[with_availability]" => nil) %>
39
44
  <% else %>
40
- <%= link_to t("decidim.meetings.meetings.index.see_all_withdrawn"), meetings_path("filter[state]" => "withdrawn") %>
45
+ <%= link_to t("decidim.meetings.meetings.index.see_all_withdrawn"), meetings_path("filter[with_availability]" => "withdrawn") %>
41
46
  <% end %>
42
47
  </div>
43
48
  </div>
@@ -1,7 +1,7 @@
1
1
  <%= render partial: "decidim/shared/component_announcement" %>
2
2
 
3
- <% if current_component.settings.maps_enabled? && search.results.not_online.exists? %>
4
- <%= cell "decidim/meetings/meetings_map", search.results %>
3
+ <% if current_component.settings.maps_enabled? && search.result.not_online.exists? %>
4
+ <%= cell "decidim/meetings/meetings_map", search.result %>
5
5
  <% end %>
6
6
 
7
7
  <div class="row columns">
@@ -1,13 +1,19 @@
1
1
  var $meetings = $('#meetings');
2
2
  var $meetingsCount = $('#meetings-count');
3
3
 
4
+ // make sure that calendar modal will use the updated filter values
5
+ var $calendarShare = $('#calendarShare');
6
+ $calendarShare.remove();
7
+
4
8
  $meetings.html('<%= j(render partial: "meetings").strip.html_safe %>');
5
9
  $meetingsCount.html('<%= j(render partial: "count").strip.html_safe %>');
6
10
 
7
11
  var $dropdownMenu = $('.dropdown.menu', $meetings);
8
12
  $dropdownMenu.foundation();
9
13
 
10
- var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.results.select(&:geocoded_and_valid?)).to_json.html_safe %>');
14
+ var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.result.select(&:geocoded_and_valid?)).to_json.html_safe %>');
15
+
16
+ $("#calendarShare").foundation(); // initialize export calendar on the page
11
17
 
12
18
  var $map = $("#map");
13
19
  var controller = $map.data("map-controller");
@@ -1 +1,2 @@
1
+ ---
1
2
  am:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ar:
2
3
  activemodel:
3
4
  attributes:
@@ -76,11 +77,10 @@ ar:
76
77
  meetings:
77
78
  category_id_eq:
78
79
  label: الفئة
79
- origin_eq:
80
+ with_any_origin:
80
81
  values:
81
- citizen: المواطن
82
82
  user_group: مجموعات المستخدمين
83
- type_eq:
83
+ with_any_type:
84
84
  label: نوع الاجتماع
85
85
  values:
86
86
  in_person: وجهًا لوجه
@@ -251,8 +251,6 @@ ar:
251
251
  success: تم حذف الاجتماع بنجاح
252
252
  edit:
253
253
  update: تحديث
254
- form:
255
- registration_email_help: سيظهر هذا النص في منتصف البريد الإلكتروني الخاص بتأكيد التسجيل مباشرة بعد رمز التسجيل.
256
254
  index:
257
255
  title: اجتماعات
258
256
  new:
@@ -282,6 +280,7 @@ ar:
282
280
  form:
283
281
  available_slots_help: اتركه إلى 0 إذا كان لديك فتحات غير محدودة المتاحة.
284
282
  invites: دعوات
283
+ registration_email_help: سيظهر هذا النص في منتصف البريد الإلكتروني الخاص بتأكيد التسجيل مباشرة بعد رمز التسجيل.
285
284
  registration_form: إستمارة تسجيل
286
285
  registrations_count:
287
286
  zero: كان هناك %{count} التسجيلات.
@@ -344,8 +343,6 @@ ar:
344
343
  filters:
345
344
  category: الفئة
346
345
  date: تاريخ
347
- origin_values:
348
- citizens: المواطنون
349
346
  search: بحث
350
347
  filters_small_view:
351
348
  close_modal: إغلاق مشروط
@@ -1,3 +1,4 @@
1
+ ---
1
2
  bg:
2
3
  activemodel:
3
4
  attributes: