decidim-meetings 0.27.2 → 0.27.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b88ac00953596a7640770559687f1ba48657b65f11e0d706ebbb16f929f4c28
4
- data.tar.gz: 552640be23e75bb9497ff5d9c3b9a0b629de0bc8a035968db1b5b0fb54811890
3
+ metadata.gz: 22996c6eba8e4d08a0fea3fd677846567792c2b1826ad33027bf4023a183653a
4
+ data.tar.gz: 5cef864fb91bb45baa72ccb274e5d36fabfc31ef8ecacccf7abfe051ea4e4a43
5
5
  SHA512:
6
- metadata.gz: 7b5d5eafa08343e8a4fbbbb8963e08d757b75bf80ab151652922e14e48f774e4809727ed483fe835b4218a0940a389d9f76ba8b3a640444f15bff894fce2894b
7
- data.tar.gz: 046ed8504405af4923c73037b3463c63b78f5c920662c1501e3bb34a107a7f00920bb5ce940cd4e40778f94a6d487ade50aa5db2e93532016068883324f5cd23
6
+ metadata.gz: d34e99ce49db7f4ece052065032ac934fb119959581dbf120a3efc833e86633c279b47afe85ec659e2494f1be2bcebb3e7c884ebd0b10347b24a93323b555b55
7
+ data.tar.gz: c2847c2c7b6c6f1dfac880c3594cb4a4a475f3a054ae0a508bc83f45f3fbbf8c5174a9b9301da98da78e7970feea34e539002d5bfa8ac9a1ef6ef9d4dcb7ff80
@@ -52,6 +52,7 @@ module Decidim
52
52
  transparent: form.transparent,
53
53
  author: form.current_organization,
54
54
  registration_terms: form.current_component.settings.default_registration_terms,
55
+ registrations_enabled: form.registrations_enabled,
55
56
  component: form.current_component,
56
57
  questionnaire: Decidim::Forms::Questionnaire.new,
57
58
  iframe_embed_type: form.iframe_embed_type,
@@ -26,7 +26,7 @@ module Decidim
26
26
 
27
27
  transaction do
28
28
  publish_meeting
29
- send_notification
29
+ send_notification unless meeting.previously_published?
30
30
  schedule_upcoming_meeting_notification
31
31
  end
32
32
 
@@ -51,6 +51,7 @@ module Decidim
51
51
  online_meeting_url: form.online_meeting_url,
52
52
  registration_type: form.registration_type,
53
53
  registration_url: form.registration_url,
54
+ registrations_enabled: form.registrations_enabled,
54
55
  type_of_meeting: form.clean_type_of_meeting,
55
56
  address: form.address,
56
57
  latitude: form.latitude,
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+
5
+ module Decidim
6
+ module Meetings
7
+ # A controller concern to specify default filter parameters for the
8
+ # controller resources within a meetings component.
9
+ module ComponentFilterable
10
+ extend ActiveSupport::Concern
11
+
12
+ included do
13
+ private
14
+
15
+ def default_filter_params
16
+ {
17
+ search_text_cont: "",
18
+ with_any_date: "upcoming",
19
+ activity: "all",
20
+ with_availability: "",
21
+ with_any_scope: default_filter_scope_params,
22
+ with_any_category: default_filter_category_params,
23
+ with_any_state: nil,
24
+ with_any_origin: default_filter_origin_params,
25
+ with_any_type: default_filter_type_params
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -5,13 +5,17 @@ module Decidim
5
5
  # Exposes the meeting resources as an .ics file so users can import them
6
6
  # to their favorite calendar app
7
7
  class CalendarsController < Decidim::Meetings::ApplicationController
8
+ include FilterResource
9
+ include Filterable
10
+ include ComponentFilterable
11
+
8
12
  layout false
9
13
  helper_method :meetings
10
14
  before_action :set_default_request_format
11
15
  skip_around_action :use_organization_time_zone
12
16
 
13
17
  def show
14
- render plain: CalendarRenderer.for(current_component, params[:filter]), content_type: "type/calendar"
18
+ render plain: CalendarRenderer.for(current_component, filter_params), content_type: "type/calendar"
15
19
  end
16
20
 
17
21
  def meeting_calendar
@@ -20,7 +20,7 @@ module Decidim
20
20
  helper_method :meetings, :search
21
21
 
22
22
  def calendar
23
- render plain: CalendarRenderer.for(current_organization, params[:filter]), content_type: "type/calendar"
23
+ render plain: CalendarRenderer.for(current_organization, filter_params), content_type: "type/calendar"
24
24
  end
25
25
 
26
26
  private
@@ -6,6 +6,7 @@ module Decidim
6
6
  class MeetingsController < Decidim::Meetings::ApplicationController
7
7
  include FilterResource
8
8
  include Filterable
9
+ include ComponentFilterable
9
10
  include Flaggable
10
11
  include Withdrawable
11
12
  include FormFactory
@@ -129,20 +130,6 @@ module Decidim
129
130
  def meeting_form
130
131
  form(Decidim::Meetings::MeetingForm)
131
132
  end
132
-
133
- def default_filter_params
134
- {
135
- search_text_cont: "",
136
- with_any_date: "upcoming",
137
- activity: "all",
138
- with_availability: "",
139
- with_any_scope: default_filter_scope_params,
140
- with_any_category: default_filter_category_params,
141
- with_any_state: nil,
142
- with_any_origin: default_filter_origin_params,
143
- with_any_type: default_filter_type_params
144
- }
145
- end
146
133
  end
147
134
  end
148
135
  end
@@ -13,6 +13,7 @@ module Decidim
13
13
  attribute :private_meeting, Boolean
14
14
  attribute :transparent, Boolean
15
15
  attribute :registration_type, String
16
+ attribute :registrations_enabled, Boolean, default: false
16
17
  attribute :registration_url, String
17
18
  attribute :customize_registration_email, Boolean
18
19
  attribute :iframe_embed_type, String, default: "none"
@@ -132,6 +133,10 @@ module Decidim
132
133
  end
133
134
  end
134
135
 
136
+ def registrations_enabled
137
+ on_this_platform?
138
+ end
139
+
135
140
  def embeddable_meeting_url
136
141
  if online_meeting_url.present? && %w(embed_in_meeting_page open_in_live_event_page).include?(iframe_embed_type)
137
142
  embedder_service = Decidim::Meetings::MeetingIframeEmbedder.new(online_meeting_url)
@@ -60,7 +60,13 @@ module Decidim
60
60
  # frontend, the meeting body is considered as safe content; that's unless
61
61
  # the meeting comes from a collaborative_draft or a participatory_text.
62
62
  def safe_content?
63
- rich_text_editor_in_public_views? || @meeting.official?
63
+ rich_text_editor_in_public_views? || safe_content_admin?
64
+ end
65
+
66
+ # For admin entered content, the meeting body can contain certain extra
67
+ # tags, such as iframes.
68
+ def safe_content_admin?
69
+ @meeting.official?
64
70
  end
65
71
 
66
72
  # If the content is safe, HTML tags are sanitized, otherwise, they are stripped.
@@ -51,7 +51,7 @@
51
51
  </div>
52
52
 
53
53
  <div class="row column">
54
- <%= form.translated :editor, :registration_terms %>
54
+ <%= form.translated :editor, :registration_terms, toolbar: :content %>
55
55
  </div>
56
56
  </div>
57
57
  </div>
@@ -14,7 +14,7 @@
14
14
  <%= meeting.start_time.strftime("%H:%M") %> - <%= meeting.end_time.strftime("%H:%M") %>
15
15
  </div>
16
16
  </div>
17
- <%= decidim_sanitize_editor(present(meeting).description) %>
17
+ <%= decidim_sanitize_editor present(meeting).description(strip_tags: true) %>
18
18
  </div>
19
19
  </div>
20
20
  </div>