decidim-conferences 0.18.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/assets/stylesheet/decidim/conferences/conferences.scss +3 -0
- data/app/cells/decidim/conferences/conference_address/show.erb +1 -1
- data/app/cells/decidim/conferences/conference_speaker/show.erb +2 -2
- data/app/cells/decidim/conferences/conference_speaker_cell.rb +6 -2
- data/app/cells/decidim/conferences/linked_participatory_spaces_cell.rb +6 -0
- data/app/cells/decidim/conferences/partner_cell.rb +2 -0
- data/app/cells/decidim/conferences/photos_list_cell.rb +1 -0
- data/app/cells/decidim/conferences/registration_type_cell.rb +2 -0
- data/app/commands/decidim/conferences/admin/confirm_conference_registration.rb +1 -0
- data/app/commands/decidim/conferences/admin/create_conference.rb +3 -13
- data/app/commands/decidim/conferences/admin/create_conference_admin.rb +1 -0
- data/app/commands/decidim/conferences/admin/publish_conference.rb +12 -0
- data/app/commands/decidim/conferences/admin/update_conference.rb +9 -5
- data/app/commands/decidim/conferences/admin/update_diploma.rb +1 -0
- data/app/commands/decidim/conferences/join_conference.rb +2 -0
- data/app/commands/decidim/conferences/leave_conference.rb +1 -0
- data/app/controllers/concerns/decidim/conferences/admin/filterable.rb +27 -0
- data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +3 -1
- data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +2 -1
- data/app/controllers/decidim/conferences/admin/conference_user_roles_controller.rb +2 -1
- data/app/controllers/decidim/conferences/admin/conferences_controller.rb +4 -4
- data/app/controllers/decidim/conferences/admin/media_links_controller.rb +2 -1
- data/app/controllers/decidim/conferences/admin/partners_controller.rb +2 -1
- data/app/controllers/decidim/conferences/admin/registration_types_controller.rb +2 -1
- data/app/controllers/decidim/conferences/conference_program_controller.rb +4 -1
- data/app/controllers/decidim/conferences/conference_registrations_controller.rb +1 -0
- data/app/controllers/decidim/conferences/conference_speakers_controller.rb +1 -0
- data/app/controllers/decidim/conferences/media_controller.rb +1 -0
- data/app/controllers/decidim/conferences/registration_types_controller.rb +1 -0
- data/app/forms/decidim/conferences/admin/conference_form.rb +4 -0
- data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +1 -0
- data/app/forms/decidim/conferences/admin/registration_type_form.rb +1 -0
- data/app/helpers/decidim/conferences/conference_helper.rb +1 -0
- data/app/models/decidim/conference.rb +29 -4
- data/app/models/decidim/conference_user_role.rb +2 -1
- data/app/permissions/decidim/conferences/permissions.rb +15 -0
- data/app/presenters/decidim/conferences/admin_log/value_types/role_presenter.rb +1 -0
- data/app/presenters/decidim/log/value_types/conference_presenter.rb +1 -0
- data/app/queries/decidim/conferences/admin/conference_invites.rb +1 -0
- data/app/queries/decidim/conferences/admin/conference_speakers.rb +1 -0
- data/app/types/decidim/conferences/conference_media_link_type.rb +19 -0
- data/app/types/decidim/conferences/conference_partner_type.rb +20 -0
- data/app/types/decidim/conferences/conference_speaker_type.rb +24 -0
- data/app/types/decidim/conferences/conference_type.rb +45 -0
- data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +1 -0
- data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +4 -3
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +9 -5
- data/app/views/decidim/conferences/admin/partners/index.html.erb +1 -0
- data/app/views/decidim/conferences/admin/registration_types/index.html.erb +1 -0
- data/app/views/decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb +1 -1
- data/app/views/decidim/conferences/conference_registration_mailer/confirmation.html.erb +1 -1
- data/app/views/decidim/conferences/conference_registration_mailer/pending_validation.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/_partners.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/show.html.erb +3 -3
- data/app/views/decidim/conferences/media/index.html.erb +2 -2
- data/app/views/layouts/decidim/_conference_hero.html.erb +2 -2
- data/app/views/layouts/decidim/admin/conference.html.erb +2 -2
- data/app/views/layouts/decidim/diploma.html.erb +2 -2
- data/config/locales/ar.yml +4 -2
- data/config/locales/ca.yml +1 -0
- data/config/locales/cs.yml +2 -1
- data/config/locales/el-GR.yml +1 -0
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es-MX.yml +1 -0
- data/config/locales/es-PY.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/fi-plain.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/hu.yml +2 -1
- data/config/locales/is-IS.yml +1 -0
- data/config/locales/no.yml +566 -0
- data/lib/decidim/conferences/participatory_space.rb +5 -0
- data/lib/decidim/conferences/test/factories.rb +16 -0
- data/lib/decidim/conferences/version.rb +1 -1
- metadata +28 -20
- data/app/views/decidim/conferences/conference_widgets/show.html.erb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99821cad74f86b23d2243a063e9c5f347aff5a1c8e284e8c8c0cc250c726da59
|
4
|
+
data.tar.gz: 681fd61ed392ae35e2f580fac6e6ff49e6fad73f90e2e87585a5e343042ef73b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd9b00dae882f1a7e7aba6aced3e95ae4812abc5e7f81e2abf3f10cfa425a26cea3b6fef3c706ceae59cca30008e86c1fc505130b963668c888b13eecf8af285
|
7
|
+
data.tar.gz: 4ad9c3cfa57db46f38e22da1310323249f955d6c2f95b467ba62cbc184a7db7ff6b74e4bd60eec1bc75346f05bbf744674d2e8dbc07b2c1559e9d93559d78c84
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="mb-s">
|
2
2
|
<% if model.respond_to? :location %>
|
3
3
|
<div>
|
4
|
-
<strong><%= translated_attribute model.location %></strong><br
|
4
|
+
<strong><%= translated_attribute model.location %></strong><br>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
7
7
|
<div class="text-medium"><%= model.address %></div>
|
@@ -67,14 +67,14 @@
|
|
67
67
|
<% end %>
|
68
68
|
</div>
|
69
69
|
<% if meetings.present? %>
|
70
|
-
<hr class="reset mt-none mb-s"
|
70
|
+
<hr class="reset mt-none mb-s">
|
71
71
|
<div class="row">
|
72
72
|
<div class="column medium-12">
|
73
73
|
<div class="bio-acts">Speaking at</div>
|
74
74
|
|
75
75
|
<ul class="list-reset">
|
76
76
|
<% meetings.each do |meeting| %>
|
77
|
-
<%= meeting_title meeting %> <br
|
77
|
+
<%= meeting_title meeting %> <br>
|
78
78
|
<% end %>
|
79
79
|
</ul>
|
80
80
|
</div>
|
@@ -41,6 +41,7 @@ module Decidim
|
|
41
41
|
|
42
42
|
def avatar
|
43
43
|
return model.user.avatar if model.user.present?
|
44
|
+
|
44
45
|
model.avatar
|
45
46
|
end
|
46
47
|
|
@@ -58,17 +59,20 @@ module Decidim
|
|
58
59
|
|
59
60
|
def short_bio
|
60
61
|
return unless model.short_bio.presence
|
62
|
+
|
61
63
|
translated_attribute model.short_bio
|
62
64
|
end
|
63
65
|
|
64
66
|
def twitter_handle
|
65
67
|
return unless model.twitter_handle.presence
|
66
|
-
|
68
|
+
|
69
|
+
link_to t(".go_to_twitter"), "https://twitter.com/#{model.twitter_handle}", target: "_blank", rel: "noopener"
|
67
70
|
end
|
68
71
|
|
69
72
|
def personal_url
|
70
73
|
return unless model.personal_url.presence || (model.user.presence && model.user.personal_url.presence)
|
71
|
-
|
74
|
+
|
75
|
+
link_to model.personal_url || model.user.personal_url, target: "_blank", class: "card-link", rel: "noopener" do
|
72
76
|
"#{icon "external-link"}" " #{t(".personal_website")}"
|
73
77
|
end
|
74
78
|
end
|
@@ -20,22 +20,28 @@ module Decidim
|
|
20
20
|
|
21
21
|
def conference_participatory_processes
|
22
22
|
return unless Decidim.participatory_space_manifests.map(&:name).include?(:participatory_processes)
|
23
|
+
|
23
24
|
processes = model.linked_participatory_space_resources(:participatory_processes, "included_participatory_processes")
|
24
25
|
return unless processes.any?
|
26
|
+
|
25
27
|
processes
|
26
28
|
end
|
27
29
|
|
28
30
|
def conference_assemblies
|
29
31
|
return unless Decidim.participatory_space_manifests.map(&:name).include?(:assemblies)
|
32
|
+
|
30
33
|
assemblies = model.linked_participatory_space_resources(:assemblies, "included_assemblies")
|
31
34
|
return unless assemblies.any?
|
35
|
+
|
32
36
|
assemblies
|
33
37
|
end
|
34
38
|
|
35
39
|
def conference_consultations
|
36
40
|
return unless Decidim.participatory_space_manifests.map(&:name).include?(:consultations)
|
41
|
+
|
37
42
|
consultations = model.linked_participatory_space_resources(:consultations, "included_consultations")
|
38
43
|
return unless consultations.any?
|
44
|
+
|
39
45
|
consultations
|
40
46
|
end
|
41
47
|
|
@@ -12,11 +12,13 @@ module Decidim
|
|
12
12
|
|
13
13
|
def name
|
14
14
|
return unless model.name.presence
|
15
|
+
|
15
16
|
"<div class='text-medium'> #{model.name} </div>"
|
16
17
|
end
|
17
18
|
|
18
19
|
def logo
|
19
20
|
return unless model.logo.presence
|
21
|
+
|
20
22
|
"<div class='card p-m flex--cc'> #{image_tag model.logo.medium.url} </div>"
|
21
23
|
end
|
22
24
|
end
|
@@ -27,6 +27,7 @@ module Decidim
|
|
27
27
|
|
28
28
|
def price
|
29
29
|
return I18n.t("free", scope: "decidim.conferences.conference.show") if model.price.blank?
|
30
|
+
|
30
31
|
number_to_currency(model.price, locale: I18n.locale, unit: Decidim.currency_unit)
|
31
32
|
end
|
32
33
|
|
@@ -44,6 +45,7 @@ module Decidim
|
|
44
45
|
|
45
46
|
def i18n_join_text
|
46
47
|
return I18n.t("registration", scope: "decidim.conferences.conference.show") if conference.has_available_slots?
|
48
|
+
|
47
49
|
I18n.t("no_slots_available", scope: "decidim.conferences.conference.show")
|
48
50
|
end
|
49
51
|
end
|
@@ -29,7 +29,6 @@ module Decidim
|
|
29
29
|
link_consultations
|
30
30
|
|
31
31
|
broadcast(:ok, conference)
|
32
|
-
send_notification
|
33
32
|
else
|
34
33
|
form.errors.add(:hero_image, conference.errors[:hero_image]) if conference.errors.include? :hero_image
|
35
34
|
form.errors.add(:banner_image, conference.errors[:banner_image]) if conference.errors.include? :banner_image
|
@@ -81,21 +80,12 @@ module Decidim
|
|
81
80
|
end
|
82
81
|
end
|
83
82
|
|
84
|
-
def send_notification
|
85
|
-
Decidim::EventsManager.publish(
|
86
|
-
event: "decidim.events.conferences.registrations_enabled",
|
87
|
-
event_class: Decidim::Conferences::ConferenceRegistrationsEnabledEvent,
|
88
|
-
resource: conference,
|
89
|
-
followers: conference.followers
|
90
|
-
)
|
91
|
-
end
|
92
|
-
|
93
83
|
def participatory_processes
|
94
84
|
@participatory_processes ||= conference.participatory_space_sibling_scope(:participatory_processes).where(id: @form.participatory_processes_ids)
|
95
85
|
end
|
96
86
|
|
97
87
|
def link_participatory_processes
|
98
|
-
conference.
|
88
|
+
conference.link_participatory_space_resources(participatory_processes, "included_participatory_processes")
|
99
89
|
end
|
100
90
|
|
101
91
|
def assemblies
|
@@ -103,7 +93,7 @@ module Decidim
|
|
103
93
|
end
|
104
94
|
|
105
95
|
def link_assemblies
|
106
|
-
conference.
|
96
|
+
conference.link_participatory_space_resources(assemblies, "included_assemblies")
|
107
97
|
end
|
108
98
|
|
109
99
|
def consultations
|
@@ -112,7 +102,7 @@ module Decidim
|
|
112
102
|
end
|
113
103
|
|
114
104
|
def link_consultations
|
115
|
-
conference.
|
105
|
+
conference.link_participatory_space_resources(consultations, "included_consultations")
|
116
106
|
end
|
117
107
|
end
|
118
108
|
end
|
@@ -28,11 +28,23 @@ module Decidim
|
|
28
28
|
end
|
29
29
|
|
30
30
|
broadcast(:ok)
|
31
|
+
send_notification
|
31
32
|
end
|
32
33
|
|
33
34
|
private
|
34
35
|
|
35
36
|
attr_reader :conference, :current_user
|
37
|
+
|
38
|
+
def send_notification
|
39
|
+
return unless conference.registrations_enabled?
|
40
|
+
|
41
|
+
Decidim::EventsManager.publish(
|
42
|
+
event: "decidim.events.conferences.registrations_enabled",
|
43
|
+
event_class: Decidim::Conferences::ConferenceRegistrationsEnabledEvent,
|
44
|
+
resource: conference,
|
45
|
+
followers: conference.followers
|
46
|
+
)
|
47
|
+
end
|
36
48
|
end
|
37
49
|
end
|
38
50
|
end
|
@@ -23,6 +23,7 @@ module Decidim
|
|
23
23
|
# Returns nothing.
|
24
24
|
def call
|
25
25
|
return broadcast(:invalid) if form.invalid?
|
26
|
+
|
26
27
|
update_conference
|
27
28
|
link_participatory_processes
|
28
29
|
link_assemblies
|
@@ -99,7 +100,9 @@ module Decidim
|
|
99
100
|
end
|
100
101
|
|
101
102
|
def should_notify_followers_registrations_enabled?
|
102
|
-
@conference.previous_changes["registrations_enabled"].present? &&
|
103
|
+
@conference.previous_changes["registrations_enabled"].present? &&
|
104
|
+
@conference.registrations_enabled? &&
|
105
|
+
@conference.published?
|
103
106
|
end
|
104
107
|
|
105
108
|
def send_notification_update_conference
|
@@ -112,7 +115,8 @@ module Decidim
|
|
112
115
|
end
|
113
116
|
|
114
117
|
def should_notify_followers_update_conference?
|
115
|
-
important_attributes.any? { |attr| @conference.previous_changes[attr].present? }
|
118
|
+
important_attributes.any? { |attr| @conference.previous_changes[attr].present? } &&
|
119
|
+
@conference.published?
|
116
120
|
end
|
117
121
|
|
118
122
|
def important_attributes
|
@@ -136,7 +140,7 @@ module Decidim
|
|
136
140
|
end
|
137
141
|
|
138
142
|
def link_participatory_processes
|
139
|
-
@conference.
|
143
|
+
@conference.link_participatory_space_resources(participatory_processes, "included_participatory_processes")
|
140
144
|
end
|
141
145
|
|
142
146
|
def assemblies
|
@@ -144,7 +148,7 @@ module Decidim
|
|
144
148
|
end
|
145
149
|
|
146
150
|
def link_assemblies
|
147
|
-
@conference.
|
151
|
+
@conference.link_participatory_space_resources(assemblies, "included_assemblies")
|
148
152
|
end
|
149
153
|
|
150
154
|
def consultations
|
@@ -153,7 +157,7 @@ module Decidim
|
|
153
157
|
end
|
154
158
|
|
155
159
|
def link_consultations
|
156
|
-
@conference.
|
160
|
+
@conference.link_participatory_space_resources(consultations, "included_consultations")
|
157
161
|
end
|
158
162
|
end
|
159
163
|
end
|
@@ -22,6 +22,7 @@ module Decidim
|
|
22
22
|
def call
|
23
23
|
conference.with_lock do
|
24
24
|
return broadcast(:invalid) unless can_join_conference?
|
25
|
+
|
25
26
|
create_registration
|
26
27
|
create_meetings_registrations
|
27
28
|
accept_invitation
|
@@ -77,6 +78,7 @@ module Decidim
|
|
77
78
|
def notify_admin_over_percentage
|
78
79
|
return send_notification_over(0.5) if occupied_slots_over?(0.5)
|
79
80
|
return send_notification_over(0.8) if occupied_slots_over?(0.8)
|
81
|
+
|
80
82
|
send_notification_over(1.0) if occupied_slots_over?(1.0)
|
81
83
|
end
|
82
84
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Conferences
|
7
|
+
module Admin
|
8
|
+
module Filterable
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
|
11
|
+
included do
|
12
|
+
include Decidim::Admin::Filterable
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def base_query
|
17
|
+
collection
|
18
|
+
end
|
19
|
+
|
20
|
+
def filters
|
21
|
+
[:published_at_null]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -9,13 +9,14 @@ module Decidim
|
|
9
9
|
#
|
10
10
|
class ConferenceRegistrationsController < Decidim::Conferences::Admin::ApplicationController
|
11
11
|
include Concerns::ConferenceAdmin
|
12
|
+
include Decidim::Paginable
|
12
13
|
|
13
14
|
helper_method :conference
|
14
15
|
|
15
16
|
def index
|
16
17
|
enforce_permission_to :read_conference_registrations, :conference, conference: conference
|
17
18
|
|
18
|
-
@conference_registrations = Decidim::Conferences::ConferenceRegistration.where(conference: conference)
|
19
|
+
@conference_registrations = paginate(Decidim::Conferences::ConferenceRegistration.where(conference: conference))
|
19
20
|
end
|
20
21
|
|
21
22
|
def export
|
@@ -52,6 +53,7 @@ module Decidim
|
|
52
53
|
|
53
54
|
def conference_registration
|
54
55
|
return if params[:id].blank?
|
56
|
+
|
55
57
|
@conference_registration ||= conference.conference_registrations.find_by(id: params[:id])
|
56
58
|
end
|
57
59
|
end
|
@@ -8,13 +8,14 @@ module Decidim
|
|
8
8
|
class ConferenceSpeakersController < Decidim::Conferences::Admin::ApplicationController
|
9
9
|
helper Decidim::Conferences::Admin::ConferenceSpeakersHelper
|
10
10
|
include Concerns::ConferenceAdmin
|
11
|
+
include Decidim::Paginable
|
11
12
|
|
12
13
|
def index
|
13
14
|
enforce_permission_to :index, :conference_speaker
|
14
15
|
|
15
16
|
@query = params[:q]
|
16
17
|
|
17
|
-
@conference_speakers = Decidim::Conferences::Admin::ConferenceSpeakers.for(collection, @query)
|
18
|
+
@conference_speakers = paginate(Decidim::Conferences::Admin::ConferenceSpeakers.for(collection, @query))
|
18
19
|
end
|
19
20
|
|
20
21
|
def new
|
@@ -7,10 +7,11 @@ module Decidim
|
|
7
7
|
#
|
8
8
|
class ConferenceUserRolesController < Decidim::Conferences::Admin::ApplicationController
|
9
9
|
include Concerns::ConferenceAdmin
|
10
|
+
include Decidim::Paginable
|
10
11
|
|
11
12
|
def index
|
12
13
|
enforce_permission_to :index, :conference_user_role
|
13
|
-
@conference_user_roles = collection
|
14
|
+
@conference_user_roles = paginate(collection)
|
14
15
|
end
|
15
16
|
|
16
17
|
def new
|
@@ -8,10 +8,11 @@ module Decidim
|
|
8
8
|
class ConferencesController < Decidim::Conferences::Admin::ApplicationController
|
9
9
|
helper_method :current_conference, :current_participatory_space
|
10
10
|
layout "decidim/admin/conferences"
|
11
|
+
include Decidim::Conferences::Admin::Filterable
|
11
12
|
|
12
13
|
def index
|
13
14
|
enforce_permission_to :read, :conference_list
|
14
|
-
@conferences =
|
15
|
+
@conferences = filtered_collection
|
15
16
|
end
|
16
17
|
|
17
18
|
def new
|
@@ -69,9 +70,8 @@ module Decidim
|
|
69
70
|
private
|
70
71
|
|
71
72
|
def current_conference
|
72
|
-
|
73
|
-
|
74
|
-
scope.where(id: params[:slug])
|
73
|
+
@current_conference ||= collection.where(slug: params[:slug]).or(
|
74
|
+
collection.where(id: params[:slug])
|
75
75
|
).first
|
76
76
|
end
|
77
77
|
|
@@ -6,11 +6,12 @@ module Decidim
|
|
6
6
|
# Controller that allows managing conference media links.
|
7
7
|
class MediaLinksController < Decidim::Conferences::Admin::ApplicationController
|
8
8
|
include Concerns::ConferenceAdmin
|
9
|
+
include Decidim::Paginable
|
9
10
|
|
10
11
|
def index
|
11
12
|
enforce_permission_to :index, :media_link
|
12
13
|
|
13
|
-
@media_links = collection
|
14
|
+
@media_links = paginate(collection)
|
14
15
|
end
|
15
16
|
|
16
17
|
def new
|