decidim-meetings 0.26.4 → 0.26.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/meetings/admin/copy_meeting.rb +23 -4
  3. data/app/commands/decidim/meetings/admin/create_meeting.rb +1 -0
  4. data/app/commands/decidim/meetings/admin/publish_meeting.rb +1 -1
  5. data/app/commands/decidim/meetings/admin/update_meeting.rb +1 -0
  6. data/app/controllers/decidim/meetings/admin/meeting_copies_controller.rb +2 -2
  7. data/app/forms/decidim/meetings/admin/meeting_form.rb +10 -9
  8. data/app/helpers/decidim/meetings/application_helper.rb +13 -2
  9. data/app/presenters/decidim/meetings/meeting_presenter.rb +1 -6
  10. data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +1 -1
  11. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +1 -1
  12. data/app/views/decidim/meetings/admin/registrations/_form.html.erb +1 -1
  13. data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
  14. data/config/locales/ar.yml +253 -5
  15. data/config/locales/bg.yml +0 -6
  16. data/config/locales/ca.yml +17 -10
  17. data/config/locales/cs.yml +15 -8
  18. data/config/locales/de.yml +12 -10
  19. data/config/locales/el.yml +0 -6
  20. data/config/locales/en.yml +17 -10
  21. data/config/locales/es-MX.yml +17 -10
  22. data/config/locales/es-PY.yml +17 -10
  23. data/config/locales/es.yml +17 -10
  24. data/config/locales/eu.yml +195 -156
  25. data/config/locales/fa-IR.yml +1 -0
  26. data/config/locales/fi-plain.yml +17 -10
  27. data/config/locales/fi.yml +17 -10
  28. data/config/locales/fr-CA.yml +16 -9
  29. data/config/locales/fr.yml +16 -9
  30. data/config/locales/ga-IE.yml +0 -4
  31. data/config/locales/gl.yml +0 -9
  32. data/config/locales/hu.yml +0 -10
  33. data/config/locales/id-ID.yml +0 -6
  34. data/config/locales/is-IS.yml +0 -2
  35. data/config/locales/it.yml +0 -7
  36. data/config/locales/ja.yml +21 -14
  37. data/config/locales/ka-GE.yml +1 -0
  38. data/config/locales/kaa.yml +1 -0
  39. data/config/locales/lb.yml +0 -6
  40. data/config/locales/lt.yml +0 -10
  41. data/config/locales/lv.yml +0 -6
  42. data/config/locales/nl.yml +0 -10
  43. data/config/locales/no.yml +0 -10
  44. data/config/locales/pl.yml +0 -6
  45. data/config/locales/pt-BR.yml +0 -6
  46. data/config/locales/pt.yml +0 -7
  47. data/config/locales/ro-RO.yml +19 -10
  48. data/config/locales/ru.yml +0 -6
  49. data/config/locales/sk.yml +0 -6
  50. data/config/locales/sl.yml +0 -3
  51. data/config/locales/sv.yml +11 -9
  52. data/config/locales/tr-TR.yml +0 -6
  53. data/config/locales/uk.yml +0 -6
  54. data/config/locales/zh-CN.yml +0 -6
  55. data/config/locales/zh-TW.yml +654 -0
  56. data/lib/decidim/meetings/engine.rb +1 -1
  57. data/lib/decidim/meetings/version.rb +1 -1
  58. metadata +17 -16
  59. data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +0 -51
  60. data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +0 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04f94c16d529fda407b975b572fe2afef5e0a69f97eecf1331e773d91e8c5a3c
4
- data.tar.gz: c6d5ffabf1b8a64a8b132fda2f2502f74dae14841a84d85d89d046b180399aa9
3
+ metadata.gz: 2d14f27884cacd322a63c5ea75582f086d3067aadb7259f023eb0418971e61b3
4
+ data.tar.gz: 5b30c43af75e840f4af15ed9ff59e9eb6ea36776cd907e504c9309b1c728b4cb
5
5
  SHA512:
6
- metadata.gz: 43d01c99de5b08427dc71f13765c25c9d28f732c0e5d4baa750bc4b1000bc15a03946312ce7a419a3a062aa39e81edea110659f67882480332338aa3b9588ee6
7
- data.tar.gz: 7753214328280555959cffd6bfb48c4c4806b856f96c5fec1d05999e8f06efa948192ad9ab5fab6946fc9b4b722c94baaf59184e69452469b10c9aee7a60eb62
6
+ metadata.gz: 4585987697c2629a40dabbdcb5509157b9d113e0af231fb8b52d0e73935c72f3790c11ad8212e291d7d188e67190427987238b796b3e1360da3e6947d3181fe8
7
+ data.tar.gz: 3c86c3b8ccc2fc6b28ba47d33010e93ba75181547457dcd280822ecfd04236d43b88eb80f32fecc2b7634a13aa6c9e460faaca6ad41828529d7225a903cd98e7
@@ -44,8 +44,8 @@ module Decidim
44
44
  @copied_meeting = Decidim.traceability.create!(
45
45
  Meeting,
46
46
  form.current_user,
47
- scope: meeting.scope,
48
- category: meeting.category,
47
+ scope: form.scope,
48
+ category: form.category,
49
49
  title: parsed_title,
50
50
  description: parsed_description,
51
51
  end_time: form.end_time,
@@ -60,10 +60,29 @@ module Decidim
60
60
  transparent: form.transparent,
61
61
  author: form.current_organization,
62
62
  questionnaire: form.questionnaire,
63
+ online_meeting_url: form.online_meeting_url,
64
+ type_of_meeting: form.type_of_meeting,
65
+ iframe_embed_type: form.iframe_embed_type,
66
+ iframe_access_level: form.iframe_access_level,
67
+ comments_enabled: form.comments_enabled,
68
+ comments_start_time: form.comments_start_time,
69
+ comments_end_time: form.comments_end_time,
70
+ registration_type: form.registration_type,
71
+ registration_url: form.registration_url,
72
+ **fields_from_meeting
73
+ )
74
+ end
75
+
76
+ def fields_from_meeting
77
+ {
63
78
  registrations_enabled: meeting.registrations_enabled,
64
79
  available_slots: meeting.available_slots,
65
- registration_terms: meeting.registration_terms
66
- )
80
+ registration_terms: meeting.registration_terms,
81
+ reserved_slots: meeting.reserved_slots,
82
+ customize_registration_email: meeting.customize_registration_email,
83
+ registration_form_enabled: meeting.registration_form_enabled,
84
+ registration_email_custom_content: meeting.registration_email_custom_content
85
+ }
67
86
  end
68
87
 
69
88
  def copy_services!
@@ -53,6 +53,7 @@ module Decidim
53
53
  transparent: form.transparent,
54
54
  author: form.current_organization,
55
55
  registration_terms: form.current_component.settings.default_registration_terms,
56
+ registrations_enabled: form.registrations_enabled,
56
57
  component: form.current_component,
57
58
  questionnaire: Decidim::Forms::Questionnaire.new,
58
59
  customize_registration_email: form.customize_registration_email,
@@ -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
 
@@ -52,6 +52,7 @@ module Decidim
52
52
  registration_type: form.registration_type,
53
53
  registration_url: form.registration_url,
54
54
  available_slots: form.available_slots,
55
+ registrations_enabled: form.registrations_enabled,
55
56
  type_of_meeting: form.clean_type_of_meeting,
56
57
  address: form.address,
57
58
  latitude: form.latitude,
@@ -11,13 +11,13 @@ module Decidim
11
11
  def new
12
12
  enforce_permission_to :copy, :meeting, meeting: meeting
13
13
 
14
- @form = form(MeetingCopyForm).from_model(meeting)
14
+ @form = form(MeetingForm).from_model(meeting)
15
15
  end
16
16
 
17
17
  def create
18
18
  enforce_permission_to :copy, :meeting, meeting: meeting
19
19
 
20
- @form = form(MeetingCopyForm).from_params(params, current_component: current_component)
20
+ @form = form(MeetingForm).from_params(params, current_component: current_component)
21
21
 
22
22
  CopyMeeting.call(@form, meeting) do
23
23
  on(:ok) do
@@ -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 :available_slots, Integer, default: 0
18
19
  attribute :customize_registration_email, Boolean
@@ -95,15 +96,6 @@ module Decidim
95
96
  type_of_meeting.presence
96
97
  end
97
98
 
98
- def type_of_meeting_select
99
- Decidim::Meetings::Meeting::TYPE_OF_MEETING.map do |type|
100
- [
101
- I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
102
- type
103
- ]
104
- end
105
- end
106
-
107
99
  def iframe_access_level_select
108
100
  Decidim::Meetings::Meeting.iframe_access_levels.map do |level, _value|
109
101
  [
@@ -122,6 +114,11 @@ module Decidim
122
114
  end
123
115
  end
124
116
 
117
+ # Support for copy meeting
118
+ def questionnaire
119
+ Decidim::Forms::Questionnaire.new
120
+ end
121
+
125
122
  def on_this_platform?
126
123
  registration_type == "on_this_platform"
127
124
  end
@@ -139,6 +136,10 @@ module Decidim
139
136
  end
140
137
  end
141
138
 
139
+ def registrations_enabled
140
+ on_this_platform?
141
+ end
142
+
142
143
  def embeddable_meeting_url
143
144
  if online_meeting_url.present? && %w(embed_in_meeting_page open_in_live_event_page).include?(iframe_embed_type)
144
145
  embedder_service = Decidim::Meetings::MeetingIframeEmbedder.new(online_meeting_url)
@@ -60,12 +60,23 @@ 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.
67
73
  def render_meeting_body(meeting)
68
- Decidim::ContentProcessor.render(render_sanitized_content(meeting, :description), "div")
74
+ sanitized = render_sanitized_content(meeting, :description)
75
+ if safe_content?
76
+ Decidim::ContentProcessor.render_without_format(sanitized).html_safe
77
+ else
78
+ Decidim::ContentProcessor.render(sanitized, "div")
79
+ end
69
80
  end
70
81
 
71
82
  def prevent_timeout_seconds
@@ -31,12 +31,7 @@ module Decidim
31
31
  def description(links: false, extras: true, strip_tags: false, all_locales: false)
32
32
  return unless meeting
33
33
 
34
- new_description = handle_locales(meeting.description, all_locales) do |content|
35
- renderer = Decidim::ContentRenderers::HashtagRenderer.new(sanitized(content))
36
- renderer.render(links: links).html_safe
37
- end
38
-
39
- content_handle_locale(new_description, all_locales, extras, links, strip_tags)
34
+ content_handle_locale(meeting.description, all_locales, extras, links, strip_tags)
40
35
  end
41
36
 
42
37
  def location(all_locales: false)
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: meeting_copies_path(meeting), method: :post, html: { class: "form copy_meetings " }) do |f| %>
2
- <%= render partial: "form", object: f, locals: { title: t("meeting_copies.new.title", scope: "decidim.admin"), select: t("meeting_copies.new.select", scope: "decidim.admin") } %>
2
+ <%= render partial: "decidim/meetings/admin/meetings/form", object: f, locals: { title: t("meeting_copies.new.title", scope: "decidim.admin"), select: t("meeting_copies.new.select", scope: "decidim.admin") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("meeting_copies.new.copy", scope: "decidim.admin") %>
@@ -114,6 +114,6 @@
114
114
  </div>
115
115
  </div>
116
116
 
117
- <%= render "services", form: form, id: tabs_id_for_service(blank_service) %>
117
+ <%= render "decidim/meetings/admin/meetings/services", form: form, id: tabs_id_for_service(blank_service) %>
118
118
 
119
119
  <%= javascript_pack_tag "decidim_meetings_admin" %>
@@ -42,7 +42,7 @@
42
42
  </div>
43
43
 
44
44
  <div class="row column">
45
- <%= form.translated :editor, :registration_terms %>
45
+ <%= form.translated :editor, :registration_terms, toolbar: :content %>
46
46
  </div>
47
47
  </div>
48
48
  </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>