decidim-meetings 0.21.0 → 0.23.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_meetings_manifest.js +2 -0
  3. data/app/assets/images/decidim/gamification/badges/attended_meetings.svg +1 -106
  4. data/app/assets/images/decidim/meetings/icon.svg +1 -5
  5. data/app/assets/javascripts/decidim/meetings/admin/destroy_meeting_alert.js.es6 +16 -0
  6. data/app/assets/javascripts/decidim/meetings/admin/meetings_form.js.es6 +3 -0
  7. data/app/assets/javascripts/decidim/meetings/meetings_form.js.es6 +9 -0
  8. data/app/cells/decidim/meetings/content_blocks/upcoming_events_cell.rb +2 -1
  9. data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +7 -7
  10. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
  11. data/app/cells/decidim/meetings/join_meeting_button/show.erb +2 -2
  12. data/app/cells/decidim/meetings/meeting_cell.rb +1 -0
  13. data/app/cells/decidim/meetings/meeting_list_item/show.erb +3 -3
  14. data/app/cells/decidim/meetings/meeting_list_item_cell.rb +1 -1
  15. data/app/cells/decidim/meetings/meeting_m/date.erb +1 -1
  16. data/app/cells/decidim/meetings/meeting_m/footer.erb +1 -1
  17. data/app/cells/decidim/meetings/meeting_m/multiple_dates.erb +1 -1
  18. data/app/cells/decidim/meetings/meeting_m_cell.rb +9 -1
  19. data/app/cells/decidim/meetings/meeting_s/show.erb +6 -6
  20. data/app/cells/decidim/meetings/meetings_map/show.erb +0 -2
  21. data/app/cells/decidim/meetings/meetings_map_cell.rb +3 -1
  22. data/app/commands/decidim/meetings/admin/close_meeting.rb +1 -2
  23. data/app/commands/decidim/meetings/admin/copy_meeting.rb +38 -28
  24. data/app/commands/decidim/meetings/admin/create_meeting.rb +36 -24
  25. data/app/commands/decidim/meetings/admin/destroy_meeting.rb +6 -1
  26. data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +2 -1
  27. data/app/commands/decidim/meetings/admin/update_meeting.rb +9 -3
  28. data/app/commands/decidim/meetings/create_meeting.rb +78 -0
  29. data/app/commands/decidim/meetings/update_meeting.rb +94 -0
  30. data/app/controllers/decidim/meetings/admin/application_controller.rb +1 -1
  31. data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +2 -0
  32. data/app/controllers/decidim/meetings/admin/meetings_controller.rb +21 -7
  33. data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +4 -0
  34. data/app/controllers/decidim/meetings/meetings_controller.rb +76 -13
  35. data/app/controllers/decidim/meetings/registrations_controller.rb +1 -1
  36. data/app/controllers/decidim/meetings/versions_controller.rb +14 -0
  37. data/app/controllers/decidim/meetings/{meeting_widgets_controller.rb → widgets_controller.rb} +2 -2
  38. data/app/forms/decidim/meetings/admin/close_meeting_form.rb +7 -1
  39. data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +2 -8
  40. data/app/forms/decidim/meetings/admin/meeting_form.rb +24 -23
  41. data/app/forms/decidim/meetings/meeting_form.rb +78 -0
  42. data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -6
  43. data/app/helpers/decidim/meetings/application_helper.rb +26 -0
  44. data/app/helpers/decidim/meetings/map_helper.rb +2 -1
  45. data/app/helpers/decidim/meetings/meetings_helper.rb +13 -1
  46. data/app/models/decidim/meetings/agenda.rb +3 -0
  47. data/app/models/decidim/meetings/agenda_item.rb +3 -0
  48. data/app/models/decidim/meetings/meeting.rb +79 -23
  49. data/app/models/decidim/meetings/minutes.rb +3 -0
  50. data/app/models/decidim/meetings/service.rb +13 -0
  51. data/app/permissions/decidim/meetings/admin/permissions.rb +2 -0
  52. data/app/permissions/decidim/meetings/permissions.rb +20 -0
  53. data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +5 -1
  54. data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +3 -4
  55. data/app/presenters/decidim/meetings/meeting_presenter.rb +21 -6
  56. data/app/presenters/decidim/meetings/official_author_presenter.rb +14 -0
  57. data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
  58. data/app/queries/decidim/meetings/metrics/meetings_metric_manage.rb +2 -8
  59. data/app/services/decidim/meetings/calendar/meeting_to_event.rb +1 -1
  60. data/app/services/decidim/meetings/diff_renderer.rb +21 -0
  61. data/app/services/decidim/meetings/meeting_search.rb +3 -25
  62. data/app/types/decidim/meetings/meeting_type.rb +1 -1
  63. data/app/views/decidim/meetings/_calendar_modal.html.erb +4 -4
  64. data/app/views/decidim/meetings/admin/invites/index.html.erb +2 -2
  65. data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +1 -6
  66. data/app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb +1 -0
  67. data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +2 -9
  68. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +5 -12
  69. data/app/views/decidim/meetings/admin/meetings/edit.html.erb +1 -1
  70. data/app/views/decidim/meetings/admin/meetings/index.html.erb +22 -3
  71. data/app/views/decidim/meetings/admin/registrations/_form.html.erb +4 -0
  72. data/app/views/decidim/meetings/directory/meetings/index.html.erb +5 -3
  73. data/app/views/decidim/meetings/directory/meetings/index.js.erb +11 -4
  74. data/app/views/decidim/meetings/meetings/_count.html.erb +1 -0
  75. data/app/views/decidim/meetings/meetings/_filters.html.erb +13 -7
  76. data/app/views/decidim/meetings/meetings/_form.html.erb +51 -0
  77. data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +2 -2
  78. data/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +2 -2
  79. data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +8 -8
  80. data/app/views/decidim/meetings/meetings/edit.html.erb +25 -0
  81. data/app/views/decidim/meetings/meetings/index.html.erb +16 -1
  82. data/app/views/decidim/meetings/meetings/index.js.erb +13 -4
  83. data/app/views/decidim/meetings/meetings/new.html.erb +25 -0
  84. data/app/views/decidim/meetings/meetings/show.html.erb +32 -8
  85. data/app/views/decidim/meetings/versions/index.html.erb +8 -0
  86. data/app/views/decidim/meetings/versions/show.html.erb +10 -0
  87. data/app/views/decidim/participatory_processes/participatory_process_groups/_meeting.html.erb +2 -2
  88. data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +1 -1
  89. data/app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb +1 -3
  90. data/config/locales/am-ET.yml +1 -0
  91. data/config/locales/ar.yml +0 -8
  92. data/config/locales/bg-BG.yml +21 -0
  93. data/config/locales/bg.yml +21 -0
  94. data/config/locales/ca.yml +60 -7
  95. data/config/locales/cs.yml +68 -9
  96. data/config/locales/da-DK.yml +1 -0
  97. data/config/locales/da.yml +1 -0
  98. data/config/locales/de.yml +128 -71
  99. data/config/locales/el.yml +448 -0
  100. data/config/locales/en.yml +61 -8
  101. data/config/locales/eo.yml +1 -0
  102. data/config/locales/es-MX.yml +60 -7
  103. data/config/locales/es-PY.yml +61 -8
  104. data/config/locales/es.yml +61 -8
  105. data/config/locales/et-EE.yml +1 -0
  106. data/config/locales/et.yml +1 -0
  107. data/config/locales/eu.yml +0 -8
  108. data/config/locales/fi-plain.yml +60 -7
  109. data/config/locales/fi.yml +183 -130
  110. data/config/locales/fr-CA.yml +504 -0
  111. data/config/locales/fr.yml +60 -7
  112. data/config/locales/ga-IE.yml +1 -0
  113. data/config/locales/gl.yml +3 -7
  114. data/config/locales/hr-HR.yml +1 -0
  115. data/config/locales/hr.yml +1 -0
  116. data/config/locales/hu.yml +11 -7
  117. data/config/locales/id-ID.yml +0 -8
  118. data/config/locales/is-IS.yml +0 -9
  119. data/config/locales/is.yml +228 -0
  120. data/config/locales/it.yml +58 -7
  121. data/config/locales/ja-JP.yml +494 -0
  122. data/config/locales/ja.yml +496 -0
  123. data/config/locales/ko-KR.yml +1 -0
  124. data/config/locales/ko.yml +1 -0
  125. data/config/locales/lt-LT.yml +1 -0
  126. data/config/locales/lt.yml +1 -0
  127. data/config/locales/lv.yml +452 -0
  128. data/config/locales/mt-MT.yml +1 -0
  129. data/config/locales/mt.yml +1 -0
  130. data/config/locales/nl.yml +52 -7
  131. data/config/locales/no.yml +35 -9
  132. data/config/locales/om-ET.yml +1 -0
  133. data/config/locales/pl.yml +210 -147
  134. data/config/locales/pt-BR.yml +2 -10
  135. data/config/locales/pt.yml +232 -177
  136. data/config/locales/ro-RO.yml +500 -0
  137. data/config/locales/ru.yml +0 -8
  138. data/config/locales/si-LK.yml +1 -0
  139. data/config/locales/sk-SK.yml +463 -0
  140. data/config/locales/sk.yml +458 -0
  141. data/config/locales/sl.yml +33 -0
  142. data/config/locales/so-SO.yml +1 -0
  143. data/config/locales/sr-CS.yml +13 -0
  144. data/config/locales/sv.yml +67 -13
  145. data/config/locales/sw-KE.yml +1 -0
  146. data/config/locales/ti-ER.yml +1 -0
  147. data/config/locales/tr-TR.yml +154 -98
  148. data/config/locales/uk.yml +0 -9
  149. data/config/locales/vi-VN.yml +1 -0
  150. data/config/locales/vi.yml +1 -0
  151. data/config/locales/zh-CN.yml +496 -0
  152. data/config/locales/zh-TW.yml +1 -0
  153. data/db/migrate/20200320105922_index_foreign_keys_in_decidim_meetings_registrations.rb +7 -0
  154. data/db/migrate/20200526110940_add_author_to_meetings.rb +30 -0
  155. data/db/migrate/20200702123209_create_meeting_services_table.rb +13 -0
  156. data/db/migrate/20200702123210_move_meeting_services_to_own_model.rb +31 -0
  157. data/db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb +9 -0
  158. data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +29 -0
  159. data/db/migrate/20201111133246_add_salt_to_decidim_meetings.rb +8 -0
  160. data/lib/decidim/api/services_interface.rb +1 -7
  161. data/lib/decidim/meetings/admin_engine.rb +5 -1
  162. data/lib/decidim/meetings/component.rb +63 -11
  163. data/lib/decidim/meetings/engine.rb +3 -6
  164. data/lib/decidim/meetings/meeting_serializer.rb +1 -1
  165. data/lib/decidim/meetings/seeds/city.jpeg +0 -0
  166. data/lib/decidim/meetings/test/factories.rb +46 -8
  167. data/lib/decidim/meetings/version.rb +1 -1
  168. data/lib/tasks/decidim_meetings.rake +16 -0
  169. metadata +88 -23
  170. data/app/presenters/decidim/meetings/admin_log/value_types/organizer_presenter.rb +0 -70
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class IndexForeignKeysInDecidimMeetingsRegistrations < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_index :decidim_meetings_registrations, :decidim_user_group_id
6
+ end
7
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddAuthorToMeetings < ActiveRecord::Migration[5.2]
4
+ class Meeting < ApplicationRecord
5
+ self.table_name = :decidim_meetings_meetings
6
+ include Decidim::HasComponent
7
+ end
8
+
9
+ def change
10
+ add_column :decidim_meetings_meetings, :decidim_author_type, :string
11
+ add_column :decidim_meetings_meetings, :decidim_user_group_id, :integer
12
+
13
+ Meeting.reset_column_information
14
+ Meeting.find_each do |meeting|
15
+ if meeting.organizer_id.present?
16
+ meeting.decidim_author_id = meeting.organizer_id
17
+ meeting.decidim_author_type = "Decidim::UserBaseEntity"
18
+ else
19
+ meeting.decidim_author_id = meeting.organization.id
20
+ meeting.decidim_author_type = "Decidim::Organization"
21
+ end
22
+ meeting.save!
23
+ end
24
+
25
+ remove_column :decidim_meetings_meetings, :organizer_id
26
+ add_index :decidim_meetings_meetings,
27
+ [:decidim_author_id, :decidim_author_type],
28
+ name: "index_decidim_meetings_meetings_on_author"
29
+ end
30
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateMeetingServicesTable < ActiveRecord::Migration[5.2]
4
+ def change
5
+ create_table :decidim_meetings_services do |t|
6
+ t.jsonb :title
7
+ t.jsonb :description
8
+ t.bigint :decidim_meeting_id, null: false, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MoveMeetingServicesToOwnModel < ActiveRecord::Migration[5.2]
4
+ class Meeting < ApplicationRecord
5
+ self.table_name = :decidim_meetings_meetings
6
+ end
7
+
8
+ class Service < ApplicationRecord
9
+ self.table_name = :decidim_meetings_services
10
+ end
11
+
12
+ def change
13
+ Meeting.reset_column_information
14
+ Service.reset_column_information
15
+
16
+ Meeting.find_each do |meeting|
17
+ meeting["services"].each do |service|
18
+ Service.create!(
19
+ decidim_meeting_id: meeting.id,
20
+ title: service["title"],
21
+ description: service["description"]
22
+ )
23
+ end
24
+ end
25
+
26
+ remove_column :decidim_meetings_meetings, :services
27
+
28
+ Meeting.reset_column_information
29
+ Service.reset_column_information
30
+ end
31
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCommentableCounterCacheToMeetings < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_meetings_meetings, :comments_count, :integer, null: false, default: 0
6
+ Decidim::Meetings::Meeting.reset_column_information
7
+ Decidim::Meetings::Meeting.find_each(&:update_comments_count)
8
+ end
9
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ class FixMeetingsRegistrationTerms < ActiveRecord::Migration[5.2]
4
+ def up
5
+ reset_column_information
6
+
7
+ PaperTrail.request(enabled: false) do
8
+ Decidim::Meetings::Meeting.find_each do |meeting|
9
+ next if meeting.component.nil?
10
+ # Only user-created meetings have this problem
11
+ next if meeting.official?
12
+
13
+ # Since user-created meetings have no way to override the `registration_terms` field
14
+ # and it's supposed to use the component defaults,
15
+ # we can safely override this.
16
+ meeting.registration_terms = meeting.component.settings.default_registration_terms
17
+ meeting.save!
18
+ end
19
+ end
20
+ reset_column_information
21
+ end
22
+
23
+ def down; end
24
+
25
+ def reset_column_information
26
+ Decidim::Meetings::Meeting.reset_column_information
27
+ Decidim::Component.reset_column_information
28
+ end
29
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddSaltToDecidimMeetings < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_meetings_meetings, :salt, :string
6
+ # we leave old entries empty to maintain the old pad reference
7
+ end
8
+ end
@@ -7,13 +7,7 @@ module Decidim
7
7
  name "ServicesInterface"
8
8
  description "An interface that can be used with services."
9
9
 
10
- field :services, !types[ServiceType], "The object's services" do
11
- resolve ->(meeting, _args, _ctx) {
12
- return [] unless meeting.services.respond_to? :map
13
-
14
- meeting.services.map { |service| OpenStruct.new(service) }
15
- }
16
- end
10
+ field :services, !types[ServiceType], "The object's services"
17
11
  end
18
12
  end
19
13
  end
@@ -12,8 +12,12 @@ module Decidim
12
12
  paths["lib/tasks"] = nil
13
13
 
14
14
  routes do
15
+ get "/answer_options", to: "registration_form#answer_options", as: :answer_options_meeting
16
+
15
17
  resources :meetings do
16
- resources :meeting_closes, only: [:edit, :update]
18
+ resources :meeting_closes, only: [:edit, :update] do
19
+ get :proposals_picker, on: :collection
20
+ end
17
21
  resource :registrations, only: [:edit, :update] do
18
22
  resources :invites, only: [:index, :create]
19
23
  resource :form, only: [:edit, :update], controller: "registration_form"
@@ -36,6 +36,7 @@ Decidim.register_component(:meetings) do |component|
36
36
  component.exports :meetings do |exports|
37
37
  exports.collection do |component_instance|
38
38
  Decidim::Meetings::Meeting
39
+ .not_hidden
39
40
  .visible
40
41
  .where(component: component_instance)
41
42
  .includes(component: { participatory_space: :organization })
@@ -49,11 +50,15 @@ Decidim.register_component(:meetings) do |component|
49
50
  component.actions = %w(join)
50
51
 
51
52
  component.settings(:global) do |settings|
53
+ settings.attribute :scopes_enabled, type: :boolean, default: false
54
+ settings.attribute :scope_id, type: :scope
52
55
  settings.attribute :announcement, type: :text, translated: true, editor: true
53
56
  settings.attribute :default_registration_terms, type: :text, translated: true, editor: true
54
57
  settings.attribute :comments_enabled, type: :boolean, default: true
58
+ settings.attribute :comments_max_length, type: :integer, required: false
55
59
  settings.attribute :resources_permissions_enabled, type: :boolean, default: true
56
60
  settings.attribute :enable_pads_creation, type: :boolean, default: false
61
+ settings.attribute :creation_enabled_for_participants, type: :boolean, default: false
57
62
  end
58
63
 
59
64
  component.settings(:step) do |settings|
@@ -109,13 +114,10 @@ Decidim.register_component(:meetings) do |component|
109
114
  longitude: Faker::Address.longitude,
110
115
  registrations_enabled: [true, false].sample,
111
116
  available_slots: (10..50).step(10).to_a.sample,
117
+ author: participatory_space.organization,
112
118
  registration_terms: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
113
119
  Decidim::Faker::Localized.paragraph(3)
114
- end,
115
- services: [
116
- { title: Decidim::Faker::Localized.sentence(2), description: Decidim::Faker::Localized.sentence(5) },
117
- { title: Decidim::Faker::Localized.sentence(2), description: Decidim::Faker::Localized.sentence(5) }
118
- ]
120
+ end
119
121
  }
120
122
 
121
123
  meeting = Decidim.traceability.create!(
@@ -125,6 +127,14 @@ Decidim.register_component(:meetings) do |component|
125
127
  visibility: "all"
126
128
  )
127
129
 
130
+ 2.times do
131
+ Decidim::Meetings::Service.create!(
132
+ meeting: meeting,
133
+ title: Decidim::Faker::Localized.sentence(2),
134
+ description: Decidim::Faker::Localized.sentence(5)
135
+ )
136
+ end
137
+
128
138
  Decidim::Forms::Questionnaire.create!(
129
139
  title: Decidim::Faker::Localized.paragraph,
130
140
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
@@ -168,21 +178,63 @@ Decidim.register_component(:meetings) do |component|
168
178
  Decidim::Attachment.create!(
169
179
  title: Decidim::Faker::Localized.sentence(2),
170
180
  description: Decidim::Faker::Localized.sentence(5),
171
- file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
172
181
  attachment_collection: attachment_collection,
173
- attached_to: meeting
182
+ attached_to: meeting,
183
+ file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")) # Keep after attached_to
174
184
  )
175
185
  Decidim::Attachment.create!(
176
186
  title: Decidim::Faker::Localized.sentence(2),
177
187
  description: Decidim::Faker::Localized.sentence(5),
178
- file: File.new(File.join(__dir__, "seeds", "city.jpeg")),
179
- attached_to: meeting
188
+ attached_to: meeting,
189
+ file: File.new(File.join(__dir__, "seeds", "city.jpeg")) # Keep after attached_to
180
190
  )
181
191
  Decidim::Attachment.create!(
182
192
  title: Decidim::Faker::Localized.sentence(2),
183
193
  description: Decidim::Faker::Localized.sentence(5),
184
- file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
185
- attached_to: meeting
194
+ attached_to: meeting,
195
+ file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")) # Keep after attached_to
196
+ )
197
+ end
198
+
199
+ authors = [
200
+ Decidim::UserGroup.where(decidim_organization_id: participatory_space.decidim_organization_id).verified.sample,
201
+ Decidim::User.where(decidim_organization_id: participatory_space.decidim_organization_id).all.sample
202
+ ]
203
+
204
+ authors.each do |author|
205
+ user_group = nil
206
+
207
+ if author.is_a?(Decidim::UserGroup)
208
+ user_group = author
209
+ author = user_group.users.sample
210
+ end
211
+
212
+ params = {
213
+ component: component,
214
+ scope: Faker::Boolean.boolean(0.5) ? global : scopes.sample,
215
+ category: participatory_space.categories.sample,
216
+ title: Decidim::Faker::Localized.sentence(2),
217
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
218
+ Decidim::Faker::Localized.paragraph(3)
219
+ end,
220
+ location: Decidim::Faker::Localized.sentence,
221
+ location_hints: Decidim::Faker::Localized.sentence,
222
+ start_time: 3.weeks.from_now,
223
+ end_time: 3.weeks.from_now + 4.hours,
224
+ address: "#{Faker::Address.street_address} #{Faker::Address.zip} #{Faker::Address.city}",
225
+ latitude: Faker::Address.latitude,
226
+ longitude: Faker::Address.longitude,
227
+ registrations_enabled: [true, false].sample,
228
+ available_slots: (10..50).step(10).to_a.sample,
229
+ author: author,
230
+ user_group: user_group
231
+ }
232
+
233
+ Decidim.traceability.create!(
234
+ Decidim::Meetings::Meeting,
235
+ authors[0],
236
+ params,
237
+ visibility: "all"
186
238
  )
187
239
  end
188
240
  end
@@ -17,7 +17,7 @@ module Decidim
17
17
  isolate_namespace Decidim::Meetings
18
18
 
19
19
  routes do
20
- resources :meetings, only: [:index, :show] do
20
+ resources :meetings, only: [:index, :show, :new, :create, :edit, :update] do
21
21
  resource :registration, only: [:create, :destroy] do
22
22
  collection do
23
23
  get :create
@@ -26,7 +26,8 @@ module Decidim
26
26
  post :answer
27
27
  end
28
28
  end
29
- resource :meeting_widget, only: :show, path: "embed"
29
+ resources :versions, only: [:show, :index]
30
+ resource :widget, only: :show, path: "embed"
30
31
  end
31
32
  root to: "meetings#index"
32
33
  resource :calendar, only: [:show], format: :text
@@ -54,10 +55,6 @@ module Decidim
54
55
  end
55
56
  end
56
57
 
57
- Decidim.view_hooks.register(:current_participatory_space_meetings, priority: Decidim::ViewHooks::HIGH_PRIORITY) do |view_context|
58
- view_context.cell("decidim/meetings/highlighted_meetings", view_context.current_participatory_space)
59
- end
60
-
61
58
  # This view hook is used in card cells. It renders the next upcoming
62
59
  # meeting for the given participatory space.
63
60
  Decidim.view_hooks.register(:upcoming_meeting_for_card, priority: Decidim::ViewHooks::LOW_PRIORITY) do |view_context|
@@ -40,7 +40,7 @@ module Decidim
40
40
  address: meeting.address,
41
41
  location: meeting.location,
42
42
  reference: meeting.reference,
43
- comments: meeting.comments.count,
43
+ comments: meeting.comments_count,
44
44
  attachments: meeting.attachments.count,
45
45
  followers: meeting.followers.count,
46
46
  url: url,
Binary file
@@ -10,6 +10,14 @@ FactoryBot.define do
10
10
  name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :meetings).i18n_name }
11
11
  manifest_name { :meetings }
12
12
  participatory_space { create(:participatory_process, :with_steps, organization: organization) }
13
+
14
+ trait :with_creation_enabled do
15
+ settings do
16
+ {
17
+ creation_enabled_for_participants: true
18
+ }
19
+ end
20
+ end
13
21
  end
14
22
 
15
23
  factory :meeting, class: "Decidim::Meetings::Meeting" do
@@ -24,18 +32,42 @@ FactoryBot.define do
24
32
  end_time { start_time.advance(hours: 2) }
25
33
  private_meeting { false }
26
34
  transparent { true }
27
- services do
28
- [
29
- { title: generate_localized_title, description: generate_localized_title },
30
- { title: generate_localized_title, description: generate_localized_title }
31
- ]
32
- end
33
35
  questionnaire { build(:questionnaire) }
34
36
  registration_form_enabled { true }
35
37
  component { build(:component, manifest_name: "meetings") }
38
+ salt { SecureRandom.hex(32) }
39
+
40
+ author do
41
+ component.try(:organization)
42
+ end
43
+
44
+ trait :official do
45
+ author { component.organization if component }
46
+ end
47
+
48
+ trait :not_official do
49
+ author { create(:user, organization: component.organization) if component }
50
+ end
51
+
52
+ trait :with_services do
53
+ transient do
54
+ services do
55
+ nil
56
+ end
57
+ end
58
+
59
+ after(:build) do |meeting, evaluator|
60
+ meeting.services = evaluator.services || build_list(:service, 2, meeting: meeting)
61
+ end
62
+ end
36
63
 
37
- organizer do
38
- create(:user, organization: component.organization) if component
64
+ trait :user_group_author do
65
+ author do
66
+ create(:user, organization: component.organization) if component
67
+ end
68
+ user_group do
69
+ create(:user_group, :verified, organization: component.organization, users: [author]) if component
70
+ end
39
71
  end
40
72
 
41
73
  trait :closed do
@@ -121,4 +153,10 @@ FactoryBot.define do
121
153
  rejected_at { Time.current }
122
154
  end
123
155
  end
156
+
157
+ factory :service, class: "Decidim::Meetings::Service" do
158
+ meeting
159
+ title { generate_localized_title }
160
+ description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
161
+ end
124
162
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Meetings
6
6
  def self.version
7
- "0.21.0"
7
+ "0.23.2"
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :decidim_meetings do
4
+ # For privacy reasons we recommend that you delete this registration form when you no longer need it.
5
+ # By default this is 3 months after the meeting has passed
6
+ desc "Remove registration forms belonging to meetings that have ended more than X months ago"
7
+ task :clean_registration_forms, [:months] => :environment do |_t, args|
8
+ args.with_defaults(months: 3)
9
+
10
+ query = Decidim::Meetings::Meeting.arel_table[:end_time].lteq(Time.current - args[:months].months)
11
+ old_meeting_ids = Decidim::Meetings::Meeting.where(query).pluck(:id)
12
+ old_questionnaires = Decidim::Forms::Questionnaire.where(questionnaire_for_type: "Decidim::Meetings::Meeting", questionnaire_for_id: old_meeting_ids)
13
+
14
+ old_questionnaires.destroy_all
15
+ end
16
+ end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-meetings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
8
8
  - Marc Riera Casals
9
9
  - Oriol Gual Oliva
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-08 00:00:00.000000000 Z
13
+ date: 2021-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cells-erb
@@ -46,28 +46,28 @@ dependencies:
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.21.0
49
+ version: 0.23.2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.21.0
56
+ version: 0.23.2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-forms
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.21.0
63
+ version: 0.23.2
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.21.0
70
+ version: 0.23.2
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: httparty
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -116,14 +116,20 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '1.1'
119
+ version: '1.2'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 1.2.1
120
123
  type: :runtime
121
124
  prerelease: false
122
125
  version_requirements: !ruby/object:Gem::Requirement
123
126
  requirements:
124
127
  - - "~>"
125
128
  - !ruby/object:Gem::Version
126
- version: '1.1'
129
+ version: '1.2'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 1.2.1
127
133
  - !ruby/object:Gem::Dependency
128
134
  name: searchlight
129
135
  requirement: !ruby/object:Gem::Requirement
@@ -144,56 +150,56 @@ dependencies:
144
150
  requirements:
145
151
  - - '='
146
152
  - !ruby/object:Gem::Version
147
- version: 0.21.0
153
+ version: 0.23.2
148
154
  type: :development
149
155
  prerelease: false
150
156
  version_requirements: !ruby/object:Gem::Requirement
151
157
  requirements:
152
158
  - - '='
153
159
  - !ruby/object:Gem::Version
154
- version: 0.21.0
160
+ version: 0.23.2
155
161
  - !ruby/object:Gem::Dependency
156
162
  name: decidim-assemblies
157
163
  requirement: !ruby/object:Gem::Requirement
158
164
  requirements:
159
165
  - - '='
160
166
  - !ruby/object:Gem::Version
161
- version: 0.21.0
167
+ version: 0.23.2
162
168
  type: :development
163
169
  prerelease: false
164
170
  version_requirements: !ruby/object:Gem::Requirement
165
171
  requirements:
166
172
  - - '='
167
173
  - !ruby/object:Gem::Version
168
- version: 0.21.0
174
+ version: 0.23.2
169
175
  - !ruby/object:Gem::Dependency
170
176
  name: decidim-dev
171
177
  requirement: !ruby/object:Gem::Requirement
172
178
  requirements:
173
179
  - - '='
174
180
  - !ruby/object:Gem::Version
175
- version: 0.21.0
181
+ version: 0.23.2
176
182
  type: :development
177
183
  prerelease: false
178
184
  version_requirements: !ruby/object:Gem::Requirement
179
185
  requirements:
180
186
  - - '='
181
187
  - !ruby/object:Gem::Version
182
- version: 0.21.0
188
+ version: 0.23.2
183
189
  - !ruby/object:Gem::Dependency
184
190
  name: decidim-participatory_processes
185
191
  requirement: !ruby/object:Gem::Requirement
186
192
  requirements:
187
193
  - - '='
188
194
  - !ruby/object:Gem::Version
189
- version: 0.21.0
195
+ version: 0.23.2
190
196
  type: :development
191
197
  prerelease: false
192
198
  version_requirements: !ruby/object:Gem::Requirement
193
199
  requirements:
194
200
  - - '='
195
201
  - !ruby/object:Gem::Version
196
- version: 0.21.0
202
+ version: 0.23.2
197
203
  description: A meetings component for decidim's participatory spaces.
198
204
  email:
199
205
  - josepjaume@gmail.com
@@ -209,9 +215,11 @@ files:
209
215
  - app/assets/images/decidim/gamification/badges/attended_meetings.svg
210
216
  - app/assets/images/decidim/meetings/icon.svg
211
217
  - app/assets/javascripts/decidim/meetings/admin/agendas.js.es6
218
+ - app/assets/javascripts/decidim/meetings/admin/destroy_meeting_alert.js.es6
212
219
  - app/assets/javascripts/decidim/meetings/admin/meetings_form.js.es6
213
220
  - app/assets/javascripts/decidim/meetings/admin/registrations_form.js.es6
214
221
  - app/assets/javascripts/decidim/meetings/admin/registrations_invite_form.es6
222
+ - app/assets/javascripts/decidim/meetings/meetings_form.js.es6
215
223
  - app/cells/decidim/meetings/content_blocks/upcoming_events/show.erb
216
224
  - app/cells/decidim/meetings/content_blocks/upcoming_events_cell.rb
217
225
  - app/cells/decidim/meetings/highlighted_meetings/show.erb
@@ -250,9 +258,11 @@ files:
250
258
  - app/commands/decidim/meetings/admin/update_minutes.rb
251
259
  - app/commands/decidim/meetings/admin/update_registrations.rb
252
260
  - app/commands/decidim/meetings/admin/validate_registration_code.rb
261
+ - app/commands/decidim/meetings/create_meeting.rb
253
262
  - app/commands/decidim/meetings/decline_invitation.rb
254
263
  - app/commands/decidim/meetings/join_meeting.rb
255
264
  - app/commands/decidim/meetings/leave_meeting.rb
265
+ - app/commands/decidim/meetings/update_meeting.rb
256
266
  - app/controllers/decidim/meetings/admin/agenda_controller.rb
257
267
  - app/controllers/decidim/meetings/admin/application_controller.rb
258
268
  - app/controllers/decidim/meetings/admin/attachment_collections_controller.rb
@@ -267,9 +277,10 @@ files:
267
277
  - app/controllers/decidim/meetings/application_controller.rb
268
278
  - app/controllers/decidim/meetings/calendars_controller.rb
269
279
  - app/controllers/decidim/meetings/directory/meetings_controller.rb
270
- - app/controllers/decidim/meetings/meeting_widgets_controller.rb
271
280
  - app/controllers/decidim/meetings/meetings_controller.rb
272
281
  - app/controllers/decidim/meetings/registrations_controller.rb
282
+ - app/controllers/decidim/meetings/versions_controller.rb
283
+ - app/controllers/decidim/meetings/widgets_controller.rb
273
284
  - app/events/decidim/meetings/close_meeting_event.rb
274
285
  - app/events/decidim/meetings/create_meeting_event.rb
275
286
  - app/events/decidim/meetings/meeting_registration_notification_event.rb
@@ -289,6 +300,7 @@ files:
289
300
  - app/forms/decidim/meetings/admin/minutes_form.rb
290
301
  - app/forms/decidim/meetings/admin/validate_registration_code_form.rb
291
302
  - app/forms/decidim/meetings/join_meeting_form.rb
303
+ - app/forms/decidim/meetings/meeting_form.rb
292
304
  - app/helpers/decidim/meetings/admin/application_helper.rb
293
305
  - app/helpers/decidim/meetings/application_helper.rb
294
306
  - app/helpers/decidim/meetings/map_helper.rb
@@ -304,16 +316,17 @@ files:
304
316
  - app/models/decidim/meetings/meeting.rb
305
317
  - app/models/decidim/meetings/minutes.rb
306
318
  - app/models/decidim/meetings/registration.rb
319
+ - app/models/decidim/meetings/service.rb
307
320
  - app/permissions/decidim/meetings/admin/permissions.rb
308
321
  - app/permissions/decidim/meetings/permissions.rb
309
322
  - app/presenters/decidim/meetings/admin_log/invite_presenter.rb
310
323
  - app/presenters/decidim/meetings/admin_log/meeting_presenter.rb
311
324
  - app/presenters/decidim/meetings/admin_log/minutes_presenter.rb
312
325
  - app/presenters/decidim/meetings/admin_log/value_types/meeting_title_description_presenter.rb
313
- - app/presenters/decidim/meetings/admin_log/value_types/organizer_presenter.rb
314
326
  - app/presenters/decidim/meetings/invite_presenter.rb
315
327
  - app/presenters/decidim/meetings/log/resource_presenter.rb
316
328
  - app/presenters/decidim/meetings/meeting_presenter.rb
329
+ - app/presenters/decidim/meetings/official_author_presenter.rb
317
330
  - app/queries/decidim/meetings/admin/invites.rb
318
331
  - app/queries/decidim/meetings/filtered_meetings.rb
319
332
  - app/queries/decidim/meetings/metrics/meeting_followers_metric_measure.rb
@@ -326,6 +339,7 @@ files:
326
339
  - app/services/decidim/meetings/calendar/meeting_to_event.rb
327
340
  - app/services/decidim/meetings/calendar/organization_calendar.rb
328
341
  - app/services/decidim/meetings/calendar_renderer.rb
342
+ - app/services/decidim/meetings/diff_renderer.rb
329
343
  - app/services/decidim/meetings/meeting_search.rb
330
344
  - app/types/decidim/meetings/agenda_item_type.rb
331
345
  - app/types/decidim/meetings/agenda_type.rb
@@ -347,6 +361,7 @@ files:
347
361
  - app/views/decidim/meetings/admin/invites/index.html.erb
348
362
  - app/views/decidim/meetings/admin/meeting_closes/_form.html.erb
349
363
  - app/views/decidim/meetings/admin/meeting_closes/edit.html.erb
364
+ - app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb
350
365
  - app/views/decidim/meetings/admin/meeting_copies/_form.html.erb
351
366
  - app/views/decidim/meetings/admin/meeting_copies/new.html.erb
352
367
  - app/views/decidim/meetings/admin/meetings/_form.html.erb
@@ -363,55 +378,97 @@ files:
363
378
  - app/views/decidim/meetings/directory/meetings/_meetings.html.erb
364
379
  - app/views/decidim/meetings/directory/meetings/index.html.erb
365
380
  - app/views/decidim/meetings/directory/meetings/index.js.erb
381
+ - app/views/decidim/meetings/meetings/_count.html.erb
366
382
  - app/views/decidim/meetings/meetings/_datetime.html.erb
367
383
  - app/views/decidim/meetings/meetings/_filters.html.erb
368
384
  - app/views/decidim/meetings/meetings/_filters_small_view.html.erb
385
+ - app/views/decidim/meetings/meetings/_form.html.erb
369
386
  - app/views/decidim/meetings/meetings/_linked_meetings.html.erb
370
387
  - app/views/decidim/meetings/meetings/_meeting_agenda.html.erb
371
388
  - app/views/decidim/meetings/meetings/_meeting_minutes.html.erb
372
389
  - app/views/decidim/meetings/meetings/_meetings.html.erb
390
+ - app/views/decidim/meetings/meetings/edit.html.erb
373
391
  - app/views/decidim/meetings/meetings/index.html.erb
374
392
  - app/views/decidim/meetings/meetings/index.js.erb
393
+ - app/views/decidim/meetings/meetings/new.html.erb
375
394
  - app/views/decidim/meetings/meetings/show.html.erb
376
395
  - app/views/decidim/meetings/registration_mailer/confirmation.html.erb
396
+ - app/views/decidim/meetings/versions/index.html.erb
397
+ - app/views/decidim/meetings/versions/show.html.erb
377
398
  - app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_meetings.html.erb
378
399
  - app/views/decidim/participatory_processes/participatory_process_groups/_meeting.html.erb
379
400
  - app/views/decidim/participatory_spaces/_conference_venues.html.erb
380
401
  - app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb
381
402
  - app/views/devise/mailer/join_meeting.html.erb
382
403
  - app/views/devise/mailer/join_meeting.text.erb
404
+ - config/locales/am-ET.yml
383
405
  - config/locales/ar-SA.yml
384
406
  - config/locales/ar.yml
407
+ - config/locales/bg-BG.yml
408
+ - config/locales/bg.yml
385
409
  - config/locales/ca.yml
386
410
  - config/locales/cs-CZ.yml
387
411
  - config/locales/cs.yml
412
+ - config/locales/da-DK.yml
413
+ - config/locales/da.yml
388
414
  - config/locales/de.yml
389
415
  - config/locales/el-GR.yml
390
416
  - config/locales/el.yml
391
417
  - config/locales/en.yml
392
418
  - config/locales/eo-UY.yml
419
+ - config/locales/eo.yml
393
420
  - config/locales/es-MX.yml
394
421
  - config/locales/es-PY.yml
395
422
  - config/locales/es.yml
423
+ - config/locales/et-EE.yml
424
+ - config/locales/et.yml
396
425
  - config/locales/eu.yml
397
426
  - config/locales/fi-pl.yml
398
427
  - config/locales/fi-plain.yml
399
428
  - config/locales/fi.yml
429
+ - config/locales/fr-CA.yml
400
430
  - config/locales/fr.yml
431
+ - config/locales/ga-IE.yml
401
432
  - config/locales/gl.yml
433
+ - config/locales/hr-HR.yml
434
+ - config/locales/hr.yml
402
435
  - config/locales/hu.yml
403
436
  - config/locales/id-ID.yml
404
437
  - config/locales/is-IS.yml
438
+ - config/locales/is.yml
405
439
  - config/locales/it.yml
440
+ - config/locales/ja-JP.yml
441
+ - config/locales/ja.yml
442
+ - config/locales/ko-KR.yml
443
+ - config/locales/ko.yml
444
+ - config/locales/lt-LT.yml
445
+ - config/locales/lt.yml
446
+ - config/locales/lv.yml
447
+ - config/locales/mt-MT.yml
448
+ - config/locales/mt.yml
406
449
  - config/locales/nl.yml
407
450
  - config/locales/no.yml
451
+ - config/locales/om-ET.yml
408
452
  - config/locales/pl.yml
409
453
  - config/locales/pt-BR.yml
410
454
  - config/locales/pt.yml
455
+ - config/locales/ro-RO.yml
411
456
  - config/locales/ru.yml
457
+ - config/locales/si-LK.yml
458
+ - config/locales/sk-SK.yml
459
+ - config/locales/sk.yml
460
+ - config/locales/sl.yml
461
+ - config/locales/so-SO.yml
462
+ - config/locales/sr-CS.yml
412
463
  - config/locales/sv.yml
464
+ - config/locales/sw-KE.yml
465
+ - config/locales/ti-ER.yml
413
466
  - config/locales/tr-TR.yml
414
467
  - config/locales/uk.yml
468
+ - config/locales/vi-VN.yml
469
+ - config/locales/vi.yml
470
+ - config/locales/zh-CN.yml
471
+ - config/locales/zh-TW.yml
415
472
  - db/migrate/20161130121354_create_meetings.rb
416
473
  - db/migrate/20170110142105_close_a_meeting.rb
417
474
  - db/migrate/20170123151650_add_latitude_and_longitude_to_meetings.rb
@@ -436,6 +493,13 @@ files:
436
493
  - db/migrate/20180809134748_add_upcoming_events_as_content_block.rb
437
494
  - db/migrate/20181107175558_add_questionnaire_to_existing_meetings.rb
438
495
  - db/migrate/20190404132923_add_user_group_to_meetings_registrations.rb
496
+ - db/migrate/20200320105922_index_foreign_keys_in_decidim_meetings_registrations.rb
497
+ - db/migrate/20200526110940_add_author_to_meetings.rb
498
+ - db/migrate/20200702123209_create_meeting_services_table.rb
499
+ - db/migrate/20200702123210_move_meeting_services_to_own_model.rb
500
+ - db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb
501
+ - db/migrate/20201016065302_fix_meetings_registration_terms.rb
502
+ - db/migrate/20201111133246_add_salt_to_decidim_meetings.rb
439
503
  - lib/decidim/api/linked_resources_interface.rb
440
504
  - lib/decidim/api/services_interface.rb
441
505
  - lib/decidim/meetings.rb
@@ -453,11 +517,12 @@ files:
453
517
  - lib/decidim/meetings/seeds/city.jpeg
454
518
  - lib/decidim/meetings/test/factories.rb
455
519
  - lib/decidim/meetings/version.rb
520
+ - lib/tasks/decidim_meetings.rake
456
521
  homepage: https://github.com/decidim/decidim
457
522
  licenses:
458
523
  - AGPL-3.0
459
524
  metadata: {}
460
- post_install_message:
525
+ post_install_message:
461
526
  rdoc_options: []
462
527
  require_paths:
463
528
  - lib
@@ -465,15 +530,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
465
530
  requirements:
466
531
  - - ">="
467
532
  - !ruby/object:Gem::Version
468
- version: '2.5'
533
+ version: '2.6'
469
534
  required_rubygems_version: !ruby/object:Gem::Requirement
470
535
  requirements:
471
536
  - - ">="
472
537
  - !ruby/object:Gem::Version
473
538
  version: '0'
474
539
  requirements: []
475
- rubygems_version: 3.1.2
476
- signing_key:
540
+ rubygems_version: 3.0.3
541
+ signing_key:
477
542
  specification_version: 4
478
543
  summary: Decidim meetings module
479
544
  test_files: []