decidim-conferences 0.26.10 → 0.27.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +2 -2
- data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb +4 -5
- data/app/commands/decidim/conferences/admin/confirm_conference_registration.rb +3 -3
- data/app/commands/decidim/conferences/admin/copy_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/create_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +8 -8
- data/app/commands/decidim/conferences/admin/create_media_link.rb +6 -6
- data/app/commands/decidim/conferences/admin/create_partner.rb +8 -8
- data/app/commands/decidim/conferences/admin/create_registration_type.rb +6 -6
- data/app/commands/decidim/conferences/admin/destroy_conference_admin.rb +1 -6
- data/app/commands/decidim/conferences/admin/destroy_conference_speaker.rb +1 -1
- data/app/commands/decidim/conferences/admin/destroy_media_link.rb +1 -1
- data/app/commands/decidim/conferences/admin/destroy_partner.rb +1 -1
- data/app/commands/decidim/conferences/admin/destroy_registration_type.rb +1 -1
- data/app/commands/decidim/conferences/admin/export_conference_registrations.rb +1 -1
- data/app/commands/decidim/conferences/admin/invite_user_to_join_conference.rb +10 -12
- data/app/commands/decidim/conferences/admin/notify_role_assigned_to_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/publish_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/publish_registration_type.rb +1 -1
- data/app/commands/decidim/conferences/admin/send_conference_diplomas.rb +1 -1
- data/app/commands/decidim/conferences/admin/unpublish_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/unpublish_registration_type.rb +1 -1
- data/app/commands/decidim/conferences/admin/update_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +8 -8
- data/app/commands/decidim/conferences/admin/update_diploma.rb +3 -3
- data/app/commands/decidim/conferences/admin/update_media_link.rb +6 -6
- data/app/commands/decidim/conferences/admin/update_partner.rb +6 -6
- data/app/commands/decidim/conferences/admin/update_registration_type.rb +6 -6
- data/app/commands/decidim/conferences/decline_invitation.rb +1 -1
- data/app/commands/decidim/conferences/join_conference.rb +1 -8
- data/app/commands/decidim/conferences/leave_conference.rb +4 -4
- data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +12 -8
- data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +10 -8
- data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +11 -17
- data/app/controllers/decidim/conferences/admin/media_links_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/partners_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/registration_type_publications_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/registration_types_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/reminders_controller.rb +14 -0
- data/app/controllers/decidim/conferences/conference_program_controller.rb +2 -2
- data/app/controllers/decidim/conferences/conference_registrations_controller.rb +1 -18
- data/app/controllers/decidim/conferences/conferences_controller.rb +1 -1
- data/app/events/decidim/conferences/conference_registration_notification_event.rb +1 -1
- data/app/events/decidim/conferences/conference_role_assigned_event.rb +1 -1
- data/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb +1 -1
- data/app/helpers/decidim/conferences/admin/conference_speakers_helper.rb +14 -0
- data/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb +2 -2
- data/app/models/decidim/conference.rb +2 -3
- data/app/models/decidim/conferences/conference_invite.rb +2 -2
- data/app/models/decidim/conferences/conference_registration.rb +2 -2
- data/app/permissions/decidim/conferences/permissions.rb +0 -1
- data/app/presenters/decidim/conference_speaker_presenter.rb +3 -5
- data/app/presenters/decidim/conferences/conference_stats_presenter.rb +4 -1
- data/app/queries/decidim/conferences/admin/admin_users.rb +1 -1
- data/app/queries/decidim/conferences/admin/conference_invites.rb +1 -1
- data/app/queries/decidim/conferences/admin/conference_speakers.rb +1 -1
- data/app/queries/decidim/conferences/conference_program_meetings.rb +2 -2
- data/app/queries/decidim/conferences/conference_program_meetings_by_day.rb +3 -3
- data/app/queries/decidim/conferences/conferences_with_user_role.rb +1 -1
- data/app/queries/decidim/conferences/organization_conferences.rb +1 -1
- data/app/queries/decidim/conferences/organization_prioritized_conferences.rb +3 -3
- data/app/queries/decidim/conferences/organization_published_conferences.rb +3 -3
- data/app/queries/decidim/conferences/prioritized_conferences.rb +1 -1
- data/app/queries/decidim/conferences/promoted_conferences.rb +1 -1
- data/app/queries/decidim/conferences/published_conferences.rb +1 -1
- data/app/queries/decidim/conferences/visible_conferences.rb +1 -1
- data/app/serializers/decidim/conferences/{data_portability_conference_invite_serializer.rb → download_your_data_conference_invite_serializer.rb} +2 -2
- data/app/serializers/decidim/conferences/{data_portability_conference_registration_serializer.rb → download_your_data_conference_registration_serializer.rb} +2 -2
- data/app/views/decidim/conferences/admin/conference_copies/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_invites/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_speakers/edit.html.erb +1 -2
- data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_speakers/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_user_roles/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conference_user_roles/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conferences/_form.html.erb +3 -3
- data/app/views/decidim/conferences/admin/conferences/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/conferences/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/diplomas/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/invite_join_conference_mailer/invite.html.erb +3 -3
- data/app/views/decidim/conferences/admin/media_links/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/media_links/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/media_links/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/partners/_form.html.erb +2 -1
- data/app/views/decidim/conferences/admin/partners/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/partners/index.html.erb +3 -2
- data/app/views/decidim/conferences/admin/partners/new.html.erb +0 -1
- data/app/views/decidim/conferences/admin/registration_types/edit.html.erb +0 -1
- data/app/views/decidim/conferences/admin/registration_types/index.html.erb +0 -1
- data/app/views/decidim/conferences/admin/registration_types/new.html.erb +0 -1
- data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/show.html.erb +2 -2
- data/app/views/devise/mailer/join_conference.html.erb +2 -2
- data/app/views/devise/mailer/join_conference.text.erb +2 -2
- data/app/views/layouts/decidim/_conference_hero.html.erb +1 -1
- data/app/views/layouts/decidim/_conferences_nav.html.erb +1 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +15 -2
- data/config/locales/bg.yml +1 -0
- data/config/locales/ca.yml +10 -13
- data/config/locales/cs.yml +26 -29
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +15 -18
- data/config/locales/el.yml +12 -13
- data/config/locales/en.yml +7 -11
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +9 -12
- data/config/locales/es-PY.yml +12 -15
- data/config/locales/es.yml +10 -13
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +188 -193
- data/config/locales/fi-plain.yml +9 -12
- data/config/locales/fi.yml +18 -21
- data/config/locales/fr-CA.yml +6 -9
- data/config/locales/fr.yml +9 -12
- data/config/locales/ga-IE.yml +4 -0
- data/config/locales/gl.yml +15 -1
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +14 -66
- data/config/locales/id-ID.yml +18 -1
- data/config/locales/is-IS.yml +2 -1
- data/config/locales/it.yml +18 -4
- data/config/locales/ja.yml +9 -10
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +11 -3
- data/config/locales/lt.yml +1 -623
- data/config/locales/lv.yml +16 -1
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +19 -5
- data/config/locales/no.yml +14 -2
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +9 -14
- data/config/locales/pt-BR.yml +15 -4
- data/config/locales/pt.yml +14 -2
- data/config/locales/ro-RO.yml +17 -15
- data/config/locales/ru.yml +1 -0
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +16 -1
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +15 -10
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +20 -4
- data/config/locales/uk.yml +1 -0
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +18 -1
- data/config/locales/zh-TW.yml +1 -607
- data/lib/decidim/conferences/admin_engine.rb +1 -0
- data/lib/decidim/conferences/participatory_space.rb +8 -8
- data/lib/decidim/conferences/test/factories.rb +1 -5
- data/lib/decidim/conferences/version.rb +1 -1
- metadata +18 -25
- data/config/environment.rb +0 -3
- data/config/locales/fa-IR.yml +0 -1
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/kaa.yml +0 -20
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
- data/config/locales/sq-AL.yml +0 -1
- data/config/locales/th-TH.yml +0 -1
@@ -11,18 +11,16 @@ module Decidim
|
|
11
11
|
|
12
12
|
helper_method :conference
|
13
13
|
|
14
|
-
alias conference current_participatory_space
|
15
|
-
|
16
14
|
def index
|
17
|
-
enforce_permission_to
|
15
|
+
enforce_permission_to :read_conference_registrations, :conference, conference: conference
|
18
16
|
|
19
|
-
@conference_registrations = paginate(
|
17
|
+
@conference_registrations = paginate(Decidim::Conferences::ConferenceRegistration.where(conference: conference))
|
20
18
|
end
|
21
19
|
|
22
20
|
def export
|
23
|
-
enforce_permission_to
|
21
|
+
enforce_permission_to :export_conference_registrations, :conference, conference: conference
|
24
22
|
|
25
|
-
ExportConferenceRegistrations.call(
|
23
|
+
ExportConferenceRegistrations.call(conference, params[:format], current_user) do
|
26
24
|
on(:ok) do |export_data|
|
27
25
|
send_data export_data.read, type: "text/#{export_data.extension}", filename: export_data.filename("conference_registrations")
|
28
26
|
end
|
@@ -30,7 +28,7 @@ module Decidim
|
|
30
28
|
end
|
31
29
|
|
32
30
|
def confirm
|
33
|
-
enforce_permission_to
|
31
|
+
enforce_permission_to :confirm, :conference_registration, conference_registration: conference_registration
|
34
32
|
|
35
33
|
ConfirmConferenceRegistration.call(conference_registration, current_user) do
|
36
34
|
on(:ok) do
|
@@ -47,10 +45,14 @@ module Decidim
|
|
47
45
|
|
48
46
|
private
|
49
47
|
|
48
|
+
def conference
|
49
|
+
@conference ||= Decidim::Conference.find_by(slug: params[:conference_slug])
|
50
|
+
end
|
51
|
+
|
50
52
|
def conference_registration
|
51
53
|
return if params[:id].blank?
|
52
54
|
|
53
|
-
@conference_registration ||=
|
55
|
+
@conference_registration ||= conference.conference_registrations.find_by(id: params[:id])
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
@@ -6,11 +6,10 @@ module Decidim
|
|
6
6
|
# Controller that allows managing conference speakers.
|
7
7
|
#
|
8
8
|
class ConferenceSpeakersController < Decidim::Conferences::Admin::ApplicationController
|
9
|
+
helper Decidim::Conferences::Admin::ConferenceSpeakersHelper
|
9
10
|
include Concerns::ConferenceAdmin
|
10
11
|
include Decidim::Paginable
|
11
12
|
|
12
|
-
helper_method :conference_speaker, :meetings_selected
|
13
|
-
|
14
13
|
def index
|
15
14
|
enforce_permission_to :index, :conference_speaker
|
16
15
|
|
@@ -42,15 +41,17 @@ module Decidim
|
|
42
41
|
end
|
43
42
|
|
44
43
|
def edit
|
45
|
-
|
46
|
-
|
44
|
+
@item = collection.find(params[:id])
|
45
|
+
enforce_permission_to :update, :conference_speaker, speaker: @item
|
46
|
+
@form = form(ConferenceSpeakerForm).from_model(@item)
|
47
47
|
end
|
48
48
|
|
49
49
|
def update
|
50
|
-
|
50
|
+
@conference_speaker = collection.find(params[:id])
|
51
|
+
enforce_permission_to :update, :conference_speaker, speaker: @conference_speaker
|
51
52
|
@form = form(ConferenceSpeakerForm).from_params(params)
|
52
53
|
|
53
|
-
UpdateConferenceSpeaker.call(@form, conference_speaker) do
|
54
|
+
UpdateConferenceSpeaker.call(@form, @conference_speaker) do
|
54
55
|
on(:ok) do
|
55
56
|
flash[:notice] = I18n.t("conference_speakers.update.success", scope: "decidim.admin")
|
56
57
|
redirect_to conference_speakers_path(current_conference)
|
@@ -64,9 +65,10 @@ module Decidim
|
|
64
65
|
end
|
65
66
|
|
66
67
|
def destroy
|
67
|
-
|
68
|
+
@conference_speaker = collection.find(params[:id])
|
69
|
+
enforce_permission_to :destroy, :conference_speaker, speaker: @conference_speaker
|
68
70
|
|
69
|
-
DestroyConferenceSpeaker.call(conference_speaker, current_user) do
|
71
|
+
DestroyConferenceSpeaker.call(@conference_speaker, current_user) do
|
70
72
|
on(:ok) do
|
71
73
|
flash[:notice] = I18n.t("conference_speakers.destroy.success", scope: "decidim.admin")
|
72
74
|
redirect_to conference_speakers_path(current_conference)
|
@@ -76,16 +78,8 @@ module Decidim
|
|
76
78
|
|
77
79
|
private
|
78
80
|
|
79
|
-
def meetings_selected
|
80
|
-
@meetings_selected ||= @conference_speaker.conference_meetings.pluck(:id) if @conference_speaker.present?
|
81
|
-
end
|
82
|
-
|
83
|
-
def conference_speaker
|
84
|
-
@conference_speaker ||= collection.find(params[:id])
|
85
|
-
end
|
86
|
-
|
87
81
|
def collection
|
88
|
-
@collection ||= current_conference
|
82
|
+
@collection ||= Decidim::ConferenceSpeaker.where(conference: current_conference)
|
89
83
|
end
|
90
84
|
end
|
91
85
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# This controller allows to send reminders.
|
7
|
+
# It is targeted for customizations for reminder things that lives under
|
8
|
+
# a conference.
|
9
|
+
class RemindersController < Decidim::Admin::RemindersController
|
10
|
+
include Concerns::ConferenceAdmin
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -26,9 +26,9 @@ module Decidim
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def meetings
|
29
|
-
return unless meeting_component
|
29
|
+
return unless meeting_component.published? || !meeting_component.presence
|
30
30
|
|
31
|
-
@meetings ||= Decidim::Meetings::Meeting.where(component: meeting_component).
|
31
|
+
@meetings ||= Decidim::Meetings::Meeting.where(component: meeting_component).visible_for(current_user).order(:start_time)
|
32
32
|
end
|
33
33
|
|
34
34
|
def meeting_days
|
@@ -4,8 +4,6 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# Exposes the registration resource so users can join and leave conferences.
|
6
6
|
class ConferenceRegistrationsController < Decidim::Conferences::ApplicationController
|
7
|
-
before_action :ensure_signed_in
|
8
|
-
|
9
7
|
def create
|
10
8
|
enforce_permission_to :join, :conference, conference: conference
|
11
9
|
|
@@ -56,22 +54,8 @@ module Decidim
|
|
56
54
|
|
57
55
|
private
|
58
56
|
|
59
|
-
def ensure_signed_in
|
60
|
-
return if user_signed_in?
|
61
|
-
|
62
|
-
case action_name
|
63
|
-
when "create"
|
64
|
-
flash[:alert] = t("conference_registrations.create.unauthorized", scope: "decidim.conferences")
|
65
|
-
when "decline_invitation"
|
66
|
-
flash[:alert] = t("conference_registrations.decline_invitation.unauthorized", scope: "decidim.conferences")
|
67
|
-
else
|
68
|
-
raise Decidim::ActionForbidden
|
69
|
-
end
|
70
|
-
redirect_to(user_has_no_permission_referer || user_has_no_permission_path)
|
71
|
-
end
|
72
|
-
|
73
57
|
def conference
|
74
|
-
@conference ||= Conference.find_by(slug: params[:conference_slug]
|
58
|
+
@conference ||= Conference.find_by(slug: params[:conference_slug])
|
75
59
|
end
|
76
60
|
|
77
61
|
def registration_type
|
@@ -81,7 +65,6 @@ module Decidim
|
|
81
65
|
def redirect_after_path
|
82
66
|
referer = request.headers["Referer"]
|
83
67
|
return redirect_to(conference_path(conference)) if referer =~ /invitation_token/
|
84
|
-
return redirect_to(conference_path(conference)) if referer =~ %r{users/sign_in}
|
85
68
|
|
86
69
|
redirect_back fallback_location: conference_path(conference)
|
87
70
|
end
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
helper_method :collection, :promoted_conferences, :conferences, :stats
|
19
19
|
|
20
20
|
def index
|
21
|
-
|
21
|
+
redirect_to "/404" if published_conferences.none?
|
22
22
|
|
23
23
|
enforce_permission_to :list, :conference
|
24
24
|
end
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
attribute :existing_user, Boolean, default: false
|
15
15
|
|
16
16
|
validates :name, presence: true, unless: proc { |object| object.existing_user }
|
17
|
-
validates :email, presence: true,
|
17
|
+
validates :email, presence: true, "valid_email_2/email": { disposable: true }, unless: proc { |object| object.existing_user }
|
18
18
|
validates :user, presence: true, if: proc { |object| object.existing_user }
|
19
19
|
|
20
20
|
def user
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# Helpers related to the Conferences Speakers admin layout.
|
7
|
+
module ConferenceSpeakersHelper
|
8
|
+
def meetings_selected
|
9
|
+
@meetings_selected ||= @conference_speaker.conference_meetings.pluck(:id) if @conference_speaker.present?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -35,8 +35,8 @@ module Decidim
|
|
35
35
|
def add_diploma_attachment
|
36
36
|
diploma = WickedPdf.new.pdf_from_string(
|
37
37
|
render_to_string(pdf: "conference-diploma",
|
38
|
-
template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user
|
39
|
-
layout: "decidim/diploma
|
38
|
+
template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user",
|
39
|
+
layout: "decidim/diploma"),
|
40
40
|
orientation: "Landscape"
|
41
41
|
)
|
42
42
|
|
@@ -19,6 +19,7 @@ module Decidim
|
|
19
19
|
include Decidim::Searchable
|
20
20
|
include Decidim::HasUploadValidations
|
21
21
|
include Decidim::TranslatableResource
|
22
|
+
include Decidim::FilterableResource
|
22
23
|
|
23
24
|
translatable_fields :title, :slogan, :short_description, :description, :objectives, :registration_terms
|
24
25
|
|
@@ -140,8 +141,6 @@ module Decidim
|
|
140
141
|
end
|
141
142
|
|
142
143
|
# Allow ransacker to search for a key in a hstore column (`title`.`en`)
|
143
|
-
|
144
|
-
Arel::Nodes::InfixOperation.new("->>", parent.table[:title], Arel::Nodes.build_quoted(I18n.locale.to_s))
|
145
|
-
end
|
144
|
+
ransacker_i18n :title
|
146
145
|
end
|
147
146
|
end
|
@@ -6,7 +6,7 @@ module Decidim
|
|
6
6
|
class ConferenceInvite < ApplicationRecord
|
7
7
|
include Decidim::Traceable
|
8
8
|
include Decidim::Loggable
|
9
|
-
include Decidim::
|
9
|
+
include Decidim::DownloadYourData
|
10
10
|
|
11
11
|
belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
|
12
12
|
belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
|
@@ -15,7 +15,7 @@ module Decidim
|
|
15
15
|
validates :user, uniqueness: { scope: :conference }
|
16
16
|
|
17
17
|
def self.export_serializer
|
18
|
-
Decidim::Conferences::
|
18
|
+
Decidim::Conferences::DownloadYourDataConferenceInviteSerializer
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.log_presenter_class_for(_log)
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# The data store for a Registration in the Decidim::Conferences component.
|
6
6
|
class ConferenceRegistration < ApplicationRecord
|
7
|
-
include Decidim::
|
7
|
+
include Decidim::DownloadYourData
|
8
8
|
|
9
9
|
belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
|
10
10
|
belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.export_serializer
|
22
|
-
Decidim::Conferences::
|
22
|
+
Decidim::Conferences::DownloadYourDataConferenceRegistrationSerializer
|
23
23
|
end
|
24
24
|
|
25
25
|
def confirmed?
|
@@ -46,11 +46,9 @@ module Decidim
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def user
|
49
|
-
@user ||=
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
end
|
49
|
+
@user ||= if (user = __getobj__.user.presence)
|
50
|
+
Decidim::UserPresenter.new(user)
|
51
|
+
end
|
54
52
|
end
|
55
53
|
end
|
56
54
|
end
|
@@ -4,9 +4,12 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# A presenter to render statistics in the homepage.
|
6
6
|
class ConferenceStatsPresenter < Decidim::StatsPresenter
|
7
|
-
attribute :conference, Decidim::Conference
|
8
7
|
include IconHelper
|
9
8
|
|
9
|
+
def conference
|
10
|
+
__getobj__.fetch(:conference)
|
11
|
+
end
|
12
|
+
|
10
13
|
# Public: Render a collection of primary stats.
|
11
14
|
def highlighted
|
12
15
|
highlighted_stats = component_stats(priority: StatsRegistry::HIGH_PRIORITY)
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
6
|
# A class used to find the admins for an conference or an organization conferences.
|
7
|
-
class AdminUsers <
|
7
|
+
class AdminUsers < Decidim::Query
|
8
8
|
# Syntactic sugar to initialize the class and return the queried objects.
|
9
9
|
#
|
10
10
|
# conference - an conference that needs to find its conference admins
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
6
|
# A class used to find the ConferenceInvites by their status status.
|
7
|
-
class ConferenceInvites <
|
7
|
+
class ConferenceInvites < Decidim::Query
|
8
8
|
# Syntactic sugar to initialize the class and return the queried objects.
|
9
9
|
#
|
10
10
|
# conference_invites - the initial Invites relation that needs to be filtered.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
6
|
# A class used to find the ConferenceSpeakers's by the search.
|
7
|
-
class ConferenceSpeakers <
|
7
|
+
class ConferenceSpeakers < Decidim::Query
|
8
8
|
# Syntactic sugar to initialize the class and return the queried objects.
|
9
9
|
#
|
10
10
|
# conference_speakers - the initial ConferenceSpeaker relation that needs to be filtered.
|
@@ -3,14 +3,14 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
# This query class filters meetings for component and day
|
6
|
-
class ConferenceProgramMeetings <
|
6
|
+
class ConferenceProgramMeetings < Decidim::Query
|
7
7
|
def initialize(component, user = nil)
|
8
8
|
@component = component
|
9
9
|
@user = user
|
10
10
|
end
|
11
11
|
|
12
12
|
def query
|
13
|
-
Decidim::Meetings::Meeting.where(component: @component).
|
13
|
+
Decidim::Meetings::Meeting.where(component: @component).visible_for(@user)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
# This query class filters meetings for component and day
|
6
|
-
class ConferenceProgramMeetingsByDay <
|
6
|
+
class ConferenceProgramMeetingsByDay < Decidim::Query
|
7
7
|
def initialize(component, day, user = nil)
|
8
8
|
@component = component
|
9
9
|
@day = day
|
@@ -11,9 +11,9 @@ module Decidim
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def query
|
14
|
-
|
14
|
+
Decidim::Query.merge(
|
15
15
|
ConferenceProgramMeetings.new(@component, @user)
|
16
|
-
).query.where(start_time: @day.
|
16
|
+
).query.where(start_time: @day.all_day).order(start_time: :asc)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# A class used to find the Conferences that the given user has
|
6
6
|
# the specific role privilege.
|
7
|
-
class ConferencesWithUserRole <
|
7
|
+
class ConferencesWithUserRole < Decidim::Query
|
8
8
|
# Syntactic sugar to initialize the class and return the queried objects.
|
9
9
|
#
|
10
10
|
# user - a User that needs to find which conferences can manage
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
# This query class filters all conferences given an organization.
|
6
|
-
class OrganizationConferences <
|
6
|
+
class OrganizationConferences < Decidim::Query
|
7
7
|
def initialize(organization)
|
8
8
|
@organization = organization
|
9
9
|
end
|
@@ -4,17 +4,17 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# This query class filters public conferences given an organization in a
|
6
6
|
# meaningful prioritized order.
|
7
|
-
class OrganizationPrioritizedConferences <
|
7
|
+
class OrganizationPrioritizedConferences < Decidim::Query
|
8
8
|
def initialize(organization, user = nil)
|
9
9
|
@organization = organization
|
10
10
|
@user = user
|
11
11
|
end
|
12
12
|
|
13
13
|
def query
|
14
|
-
|
14
|
+
Decidim::Query.merge(
|
15
15
|
OrganizationPublishedConferences.new(@organization, @user),
|
16
16
|
PrioritizedConferences.new
|
17
|
-
).query
|
17
|
+
).query.with_attached_hero_image
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -3,18 +3,18 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
# This query class filters published conferences given an organization.
|
6
|
-
class OrganizationPublishedConferences <
|
6
|
+
class OrganizationPublishedConferences < Decidim::Query
|
7
7
|
def initialize(organization, user = nil)
|
8
8
|
@organization = organization
|
9
9
|
@user = user
|
10
10
|
end
|
11
11
|
|
12
12
|
def query
|
13
|
-
|
13
|
+
Decidim::Query.merge(
|
14
14
|
OrganizationConferences.new(@organization),
|
15
15
|
VisibleConferences.new(@user),
|
16
16
|
PublishedConferences.new
|
17
|
-
).query
|
17
|
+
).query
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
# This query orders conferences by importance, prioritizing promoted
|
6
6
|
# conferences.
|
7
|
-
class PrioritizedConferences <
|
7
|
+
class PrioritizedConferences < Decidim::Query
|
8
8
|
def query
|
9
9
|
Decidim::Conference.order(promoted: :desc)
|
10
10
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
|
-
class
|
6
|
-
# Serializes a conference invite for data
|
5
|
+
class DownloadYourDataConferenceInviteSerializer < Decidim::Exporters::Serializer
|
6
|
+
# Serializes a conference invite for download your data
|
7
7
|
def serialize
|
8
8
|
{
|
9
9
|
id: resource.id,
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
|
-
class
|
6
|
-
# Serializes a registration for data
|
5
|
+
class DownloadYourDataConferenceRegistrationSerializer < Decidim::Exporters::Serializer
|
6
|
+
# Serializes a registration for download your data
|
7
7
|
def serialize
|
8
8
|
{
|
9
9
|
id: resource.id,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
<% add_decidim_page_title(t("conference_copies.new.title", scope: "decidim.admin")) %>
|
2
1
|
<%= decidim_form_for(@form, url: conference_copies_path(current_conference), method: :post, html: { class: "form copy_conference" }) do |f| %>
|
3
2
|
<%= render partial: "form", object: f, locals: { title: t("conference_copies.new.title", scope: "decidim.admin"), select: t("conference_copies.new.select", scope: "decidim.admin") } %>
|
4
3
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
<%= decidim_form_for(@form, url: conference_speaker_path(conference_speaker.conference, conference_speaker), html: { class: "form edit_conference_speaker" }) do |f| %>
|
1
|
+
<%= decidim_form_for(@form, url: conference_speaker_path(@item.conference, @item), html: { class: "form edit_conference_speaker" }) do |f| %>
|
3
2
|
<%= render partial: "form", object: f, locals: { title: t("conference_speakers.edit.title", scope: "decidim.admin") } %>
|
4
3
|
|
5
4
|
<div class="button--double form-general-submit">
|
@@ -1,4 +1,3 @@
|
|
1
|
-
<% add_decidim_page_title(t("conference_speakers.new.title", scope: "decidim.admin")) %>
|
2
1
|
<%= decidim_form_for(@form, html: { class: "form new_conference_speaker" }) do |f| %>
|
3
2
|
<%= render partial: "form", object: f, locals: { title: t("conference_speakers.new.title", scope: "decidim.admin") } %>
|
4
3
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
<% add_decidim_page_title(t("conference_user_roles.edit.title", scope: "decidim.admin")) %>
|
2
1
|
<%= decidim_form_for(@form, url: conference_user_role_path(@user_role.conference, @user_role), html: { class: "form edit_conference_user_roles" }) do |f| %>
|
3
2
|
<%= render partial: "form", object: f, locals: { title: t("conference_user_roles.edit.title", scope: "decidim.admin") } %>
|
4
3
|
|