decidim-conferences 0.29.2 → 0.30.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_settings_form/show.erb +1 -1
- data/app/commands/decidim/conferences/admin/copy_conference.rb +2 -12
- data/app/commands/decidim/conferences/admin/create_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/update_conference.rb +1 -1
- data/app/controllers/decidim/conferences/admin/component_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/conferences/admin/concerns/conference_admin.rb +1 -1
- data/app/controllers/decidim/conferences/admin/conference_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/conferences/admin/conferences_controller.rb +17 -4
- data/app/forms/decidim/conferences/admin/conference_copy_form.rb +0 -1
- data/app/forms/decidim/conferences/admin/conference_form.rb +3 -8
- data/app/helpers/decidim/conferences/conference_program_helper.rb +4 -2
- data/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb +1 -11
- data/app/models/decidim/conference.rb +19 -0
- data/app/models/decidim/conferences/conference_invite.rb +10 -0
- data/app/permissions/decidim/conferences/permissions.rb +11 -4
- data/app/presenters/decidim/conferences/admin_log/conference_presenter.rb +1 -1
- data/app/presenters/decidim/conferences/conference_presenter.rb +19 -0
- data/app/serializers/decidim/conferences/conference_serializer.rb +24 -0
- data/app/serializers/decidim/conferences/download_your_data_conference_invite_serializer.rb +3 -4
- data/app/serializers/decidim/conferences/download_your_data_conference_registration_serializer.rb +4 -4
- data/app/serializers/decidim/conferences/open_data_conference_serializer.rb +30 -0
- data/app/views/decidim/conferences/admin/conference_copies/_form.html.erb +0 -3
- data/app/views/decidim/conferences/admin/conferences/_actions.html.erb +35 -0
- data/app/views/decidim/conferences/admin/conferences/_conference_row.html.erb +28 -0
- data/app/views/decidim/conferences/admin/conferences/_conferences_thead.html.erb +8 -0
- data/app/views/decidim/conferences/admin/conferences/_form.html.erb +27 -8
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +14 -52
- data/app/views/decidim/conferences/admin/conferences/manage_trash.html.erb +20 -0
- data/app/views/decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb +3 -1
- data/app/views/decidim/conferences/conference_program/show.html.erb +3 -1
- data/app/views/decidim/conferences/conference_speakers/index.html.erb +4 -1
- data/app/views/decidim/conferences/conferences/index.html.erb +3 -2
- data/app/views/decidim/conferences/conferences/show.html.erb +6 -6
- data/app/views/decidim/conferences/media/index.html.erb +3 -1
- data/app/views/decidim/conferences/registration_types/index.html.erb +3 -1
- data/app/views/layouts/decidim/admin/conference.html.erb +1 -1
- data/config/locales/ar.yml +12 -3
- data/config/locales/bg.yml +0 -3
- data/config/locales/ca.yml +63 -3
- data/config/locales/cs.yml +63 -3
- data/config/locales/de.yml +63 -3
- data/config/locales/el.yml +0 -3
- data/config/locales/en.yml +63 -3
- data/config/locales/es-MX.yml +63 -3
- data/config/locales/es-PY.yml +63 -3
- data/config/locales/es.yml +63 -3
- data/config/locales/eu.yml +63 -3
- data/config/locales/fi-plain.yml +63 -3
- data/config/locales/fi.yml +63 -3
- data/config/locales/fr-CA.yml +22 -3
- data/config/locales/fr.yml +22 -3
- data/config/locales/ga-IE.yml +0 -2
- data/config/locales/gl.yml +0 -3
- data/config/locales/hu.yml +0 -3
- data/config/locales/id-ID.yml +0 -3
- data/config/locales/it.yml +0 -3
- data/config/locales/ja.yml +65 -3
- data/config/locales/lb.yml +0 -3
- data/config/locales/lt.yml +0 -3
- data/config/locales/lv.yml +0 -3
- data/config/locales/nl.yml +0 -3
- data/config/locales/no.yml +0 -3
- data/config/locales/pl.yml +0 -3
- data/config/locales/pt-BR.yml +0 -3
- data/config/locales/pt.yml +0 -3
- data/config/locales/ro-RO.yml +0 -3
- data/config/locales/sk.yml +0 -3
- data/config/locales/sv.yml +65 -3
- data/config/locales/tr-TR.yml +0 -3
- data/config/locales/zh-CN.yml +0 -3
- data/config/locales/zh-TW.yml +0 -3
- data/db/migrate/20210310134942_add_followable_counter_cache_to_conferences.rb +1 -1
- data/db/migrate/20240822161330_add_deleted_at_to_decidim_conferences.rb +8 -0
- data/decidim-conferences.gemspec +1 -2
- data/lib/decidim/api/conference_media_link_type.rb +4 -4
- data/lib/decidim/api/conference_partner_type.rb +4 -4
- data/lib/decidim/api/conference_speaker_type.rb +7 -8
- data/lib/decidim/api/conference_type.rb +17 -19
- data/lib/decidim/conferences/admin_engine.rb +87 -58
- data/lib/decidim/conferences/conference_diploma_pdf.rb +242 -0
- data/lib/decidim/conferences/engine.rb +6 -1
- data/lib/decidim/conferences/menu.rb +23 -9
- data/lib/decidim/conferences/participatory_space.rb +13 -0
- data/lib/decidim/conferences/seeds.rb +134 -115
- data/lib/decidim/conferences/test/factories.rb +10 -9
- data/lib/decidim/conferences/version.rb +1 -1
- data/lib/decidim/conferences.rb +1 -0
- metadata +23 -28
- data/app/controllers/decidim/conferences/admin/categories_controller.rb +0 -13
- data/config/initializers/wicked_pdf.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 746fa4d57c4279940ee0bdf0d91f677f5a97434f3f612b18db5c6bbfe117db84
|
4
|
+
data.tar.gz: 680cc926f12df702e109e15966a3485f8efbc90afff2014fbf77944154a3edd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee47471b85139cbe414644618bd9368f121ed9ff12755b030bab94f83888c7f53def57ee95dbb809492538e322763a8519f1262f2ae4d5960bc1fdaae1afef0
|
7
|
+
data.tar.gz: fe3fecfe9fd53af89356ba02455421d6d8afdd7ed5840db3ead35deae3895276c7b509c4efc237df21338b228b884517d1f327a05ff5357dc4d35afc8cc85f47
|
@@ -27,7 +27,6 @@ module Decidim
|
|
27
27
|
Conference.transaction do
|
28
28
|
copy_conference
|
29
29
|
copy_conference_attachments
|
30
|
-
copy_conference_categories if @form.copy_categories?
|
31
30
|
copy_conference_components if @form.copy_components?
|
32
31
|
end
|
33
32
|
|
@@ -49,11 +48,10 @@ module Decidim
|
|
49
48
|
short_description: @conference.short_description,
|
50
49
|
location: @conference.location,
|
51
50
|
promoted: @conference.promoted,
|
52
|
-
scopes_enabled: @conference.scopes_enabled,
|
53
|
-
scope: @conference.scope,
|
54
51
|
objectives: @conference.objectives,
|
55
52
|
start_date: @conference.start_date,
|
56
|
-
end_date: @conference.end_date
|
53
|
+
end_date: @conference.end_date,
|
54
|
+
taxonomies: @conference.taxonomies
|
57
55
|
)
|
58
56
|
end
|
59
57
|
|
@@ -65,14 +63,6 @@ module Decidim
|
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
68
|
-
def copy_conference_categories
|
69
|
-
@conference.categories.each do |category|
|
70
|
-
category_copied = category.dup
|
71
|
-
category_copied.participatory_space = @copied_conference
|
72
|
-
category_copied.save
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
66
|
def copy_conference_components
|
77
67
|
@conference.components.each do |component|
|
78
68
|
component_copied = component.dup
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
fetch_file_attributes :hero_image, :banner_image
|
10
10
|
|
11
11
|
fetch_form_attributes :organization, :title, :slogan, :slug, :weight, :hashtag, :description,
|
12
|
-
:short_description, :objectives, :location, :
|
12
|
+
:short_description, :objectives, :location, :taxonomizations, :start_date, :end_date,
|
13
13
|
:promoted, :show_statistics, :registrations_enabled, :available_slots, :registration_terms
|
14
14
|
|
15
15
|
private
|
@@ -10,7 +10,7 @@ module Decidim
|
|
10
10
|
|
11
11
|
fetch_form_attributes :title, :slogan, :slug, :weight, :hashtag, :description, :short_description,
|
12
12
|
:objectives, :location, :start_date, :end_date, :promoted, :show_statistics,
|
13
|
-
:
|
13
|
+
:taxonomizations, :registrations_enabled
|
14
14
|
|
15
15
|
private
|
16
16
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# This controller allows sharing unpublished things.
|
7
|
+
# It is targeted for customizations for sharing unpublished things that lives under
|
8
|
+
# an conference.
|
9
|
+
class ComponentShareTokensController < Decidim::Admin::ShareTokensController
|
10
|
+
include Concerns::ConferenceAdmin
|
11
|
+
|
12
|
+
def resource
|
13
|
+
@resource ||= current_participatory_space.components.find(params[:component_id])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
included do
|
21
21
|
include Decidim::Admin::ParticipatorySpaceAdminContext
|
22
22
|
helper_method :current_conference
|
23
|
-
add_breadcrumb_item_from_menu :
|
23
|
+
add_breadcrumb_item_from_menu :conference_admin_menu
|
24
24
|
|
25
25
|
participatory_space_admin_layout
|
26
26
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# This controller allows sharing unpublished things.
|
7
|
+
# It is targeted for customizations for sharing unpublished things that lives under
|
8
|
+
# an conference.
|
9
|
+
class ConferenceShareTokensController < Decidim::Admin::ShareTokensController
|
10
|
+
include Concerns::ConferenceAdmin
|
11
|
+
|
12
|
+
def resource
|
13
|
+
current_conference
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -6,11 +6,12 @@ module Decidim
|
|
6
6
|
# Controller that allows managing conferences.
|
7
7
|
#
|
8
8
|
class ConferencesController < Decidim::Conferences::Admin::ApplicationController
|
9
|
-
include Decidim::Admin::
|
9
|
+
include Decidim::Admin::HasTrashableResources
|
10
|
+
include Decidim::Admin::ParticipatorySpaceAdminContext
|
11
|
+
include Decidim::Conferences::Admin::Filterable
|
10
12
|
|
11
13
|
helper_method :current_conference, :current_participatory_space
|
12
14
|
layout "decidim/admin/conferences"
|
13
|
-
include Decidim::Conferences::Admin::Filterable
|
14
15
|
|
15
16
|
def index
|
16
17
|
enforce_permission_to :read, :conference_list
|
@@ -71,9 +72,21 @@ module Decidim
|
|
71
72
|
|
72
73
|
private
|
73
74
|
|
75
|
+
def trashable_deleted_resource_type
|
76
|
+
:conference
|
77
|
+
end
|
78
|
+
|
79
|
+
def trashable_deleted_resource
|
80
|
+
@trashable_deleted_resource ||= current_conference
|
81
|
+
end
|
82
|
+
|
83
|
+
def trashable_deleted_collection
|
84
|
+
@trashable_deleted_collection = filtered_collection.only_deleted.deleted_at_desc
|
85
|
+
end
|
86
|
+
|
74
87
|
def current_conference
|
75
|
-
@current_conference ||= collection.where(slug: params[:slug]).or(
|
76
|
-
collection.where(id: params[:slug])
|
88
|
+
@current_conference ||= collection.with_deleted.where(slug: params[:slug]).or(
|
89
|
+
collection.with_deleted.where(id: params[:slug])
|
77
90
|
).first
|
78
91
|
end
|
79
92
|
|
@@ -9,6 +9,7 @@ module Decidim
|
|
9
9
|
class ConferenceForm < Form
|
10
10
|
include TranslatableAttributes
|
11
11
|
include Decidim::HasUploadValidations
|
12
|
+
include Decidim::HasTaxonomyFormAttributes
|
12
13
|
|
13
14
|
translatable_attribute :title, String
|
14
15
|
translatable_attribute :slogan, String
|
@@ -23,8 +24,6 @@ module Decidim
|
|
23
24
|
attribute :weight, Integer, default: 0
|
24
25
|
attribute :hashtag, String
|
25
26
|
attribute :promoted, Boolean
|
26
|
-
attribute :scopes_enabled, Boolean
|
27
|
-
attribute :scope_id, Integer
|
28
27
|
attribute :hero_image
|
29
28
|
attribute :remove_hero_image, Boolean, default: false
|
30
29
|
attribute :banner_image
|
@@ -57,12 +56,8 @@ module Decidim
|
|
57
56
|
|
58
57
|
alias organization current_organization
|
59
58
|
|
60
|
-
def
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
def scope
|
65
|
-
@scope ||= current_organization.scopes.find_by(id: scope_id)
|
59
|
+
def participatory_space_manifest
|
60
|
+
:conferences
|
66
61
|
end
|
67
62
|
|
68
63
|
def processes_for_select
|
@@ -11,8 +11,10 @@ module Decidim
|
|
11
11
|
|
12
12
|
meetings_by_time = {}
|
13
13
|
meetings.each do |meeting|
|
14
|
-
|
15
|
-
|
14
|
+
key = { start_time: meeting.start_time, end_time: meeting.end_time }
|
15
|
+
|
16
|
+
meetings_by_time[key] ||= []
|
17
|
+
meetings_by_time[key] << { meeting: }
|
16
18
|
end
|
17
19
|
meetings_by_time
|
18
20
|
end
|
@@ -33,19 +33,9 @@ module Decidim
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def add_diploma_attachment
|
36
|
-
diploma =
|
37
|
-
|
36
|
+
diploma = Decidim::Conferences::ConferenceDiplomaPDF.new(@conference, @user).render
|
38
37
|
attachments["conference-#{@user.nickname.parameterize}-diploma.pdf"] = diploma
|
39
38
|
end
|
40
|
-
|
41
|
-
def pdf_content
|
42
|
-
Premailer.new(
|
43
|
-
render_to_string(pdf: "conference-diploma",
|
44
|
-
template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user",
|
45
|
-
layout: "decidim/diploma"),
|
46
|
-
with_html_string: true
|
47
|
-
).to_inline_css
|
48
|
-
end
|
49
39
|
end
|
50
40
|
end
|
51
41
|
end
|
@@ -10,6 +10,7 @@ module Decidim
|
|
10
10
|
include Decidim::HasAttachmentCollections
|
11
11
|
include Decidim::Participable
|
12
12
|
include Decidim::Publicable
|
13
|
+
include Decidim::Taxonomizable
|
13
14
|
include Decidim::ScopableParticipatorySpace
|
14
15
|
include Decidim::Followable
|
15
16
|
include Decidim::HasReference
|
@@ -20,6 +21,8 @@ module Decidim
|
|
20
21
|
include Decidim::HasUploadValidations
|
21
22
|
include Decidim::TranslatableResource
|
22
23
|
include Decidim::FilterableResource
|
24
|
+
include Decidim::SoftDeletable
|
25
|
+
include Decidim::ShareableWithToken
|
23
26
|
|
24
27
|
translatable_fields :title, :slogan, :short_description, :description, :objectives, :registration_terms
|
25
28
|
|
@@ -146,7 +149,23 @@ module Decidim
|
|
146
149
|
:admin
|
147
150
|
end
|
148
151
|
|
152
|
+
def shareable_url(share_token)
|
153
|
+
EngineRouter.main_proxy(self).conference_url(self, share_token: share_token.token)
|
154
|
+
end
|
155
|
+
|
149
156
|
# Allow ransacker to search for a key in a hstore column (`title`.`en`)
|
150
157
|
ransacker_i18n :title
|
158
|
+
|
159
|
+
def self.ransackable_attributes(auth_object = nil)
|
160
|
+
base = %w(title short_description description id)
|
161
|
+
|
162
|
+
return base unless auth_object&.admin?
|
163
|
+
|
164
|
+
base + %w(published_at)
|
165
|
+
end
|
166
|
+
|
167
|
+
def self.ransackable_associations(_auth_object = nil)
|
168
|
+
%w(taxonomies)
|
169
|
+
end
|
151
170
|
end
|
152
171
|
end
|
@@ -22,6 +22,16 @@ module Decidim
|
|
22
22
|
Decidim::Conferences::AdminLog::InvitePresenter
|
23
23
|
end
|
24
24
|
|
25
|
+
def self.ransackable_attributes(auth_object = nil)
|
26
|
+
return [] unless auth_object&.admin?
|
27
|
+
|
28
|
+
%w(accepted_at rejected_at sent_at)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.ransackable_associations(_auth_object = nil)
|
32
|
+
%w(user)
|
33
|
+
end
|
34
|
+
|
25
35
|
def self.user_collection(user)
|
26
36
|
where(decidim_user_id: user.id)
|
27
37
|
end
|
@@ -127,6 +127,7 @@ module Decidim
|
|
127
127
|
|
128
128
|
return allow! if user&.admin?
|
129
129
|
return allow! if conference.published?
|
130
|
+
return allow! if user_can_preview_space?
|
130
131
|
|
131
132
|
toggle_allow(can_manage_conference?)
|
132
133
|
end
|
@@ -266,7 +267,6 @@ module Decidim
|
|
266
267
|
is_allowed = [
|
267
268
|
:attachment,
|
268
269
|
:attachment_collection,
|
269
|
-
:category,
|
270
270
|
:component,
|
271
271
|
:component_data,
|
272
272
|
:moderation,
|
@@ -276,7 +276,8 @@ module Decidim
|
|
276
276
|
:partner,
|
277
277
|
:media_link,
|
278
278
|
:registration_type,
|
279
|
-
:conference_invite
|
279
|
+
:conference_invite,
|
280
|
+
:share_tokens
|
280
281
|
].include?(permission_action.subject)
|
281
282
|
allow! if is_allowed
|
282
283
|
end
|
@@ -287,7 +288,6 @@ module Decidim
|
|
287
288
|
is_allowed = [
|
288
289
|
:attachment,
|
289
290
|
:attachment_collection,
|
290
|
-
:category,
|
291
291
|
:component,
|
292
292
|
:component_data,
|
293
293
|
:moderation,
|
@@ -299,11 +299,18 @@ module Decidim
|
|
299
299
|
:partner,
|
300
300
|
:registration_type,
|
301
301
|
:read_conference_registrations,
|
302
|
-
:export_conference_registrations
|
302
|
+
:export_conference_registrations,
|
303
|
+
:share_tokens
|
303
304
|
].include?(permission_action.subject)
|
304
305
|
allow! if is_allowed
|
305
306
|
end
|
306
307
|
|
308
|
+
def user_can_preview_space?
|
309
|
+
context[:share_token].present? && Decidim::ShareToken.use!(token_for: conference, token: context[:share_token], user:)
|
310
|
+
rescue ActiveRecord::RecordNotFound, StandardError
|
311
|
+
nil
|
312
|
+
end
|
313
|
+
|
307
314
|
# Checks if the permission_action is to read the admin conferences list or
|
308
315
|
# not.
|
309
316
|
def read_conference_list_permission_action?
|
@@ -41,7 +41,7 @@ module Decidim
|
|
41
41
|
|
42
42
|
def action_string
|
43
43
|
case action
|
44
|
-
when "create", "publish", "unpublish", "update", "update_diploma"
|
44
|
+
when "create", "publish", "unpublish", "update", "update_diploma", "soft_delete", "restore"
|
45
45
|
"decidim.admin_log.conference.#{action}"
|
46
46
|
else
|
47
47
|
super
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
class ConferencePresenter < SimpleDelegator
|
6
|
+
def hero_image_url
|
7
|
+
conference.attached_uploader(:hero_image).url
|
8
|
+
end
|
9
|
+
|
10
|
+
def banner_image_url
|
11
|
+
conference.attached_uploader(:banner_image).url
|
12
|
+
end
|
13
|
+
|
14
|
+
def conference
|
15
|
+
__getobj__
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This class serializes a Conference so it can be exported to CSV, JSON or other formats.
|
6
|
+
class ConferenceSerializer < Decidim::Conferences::OpenDataConferenceSerializer
|
7
|
+
# Public: Exports a hash with the serialized data for this conference.
|
8
|
+
def serialize
|
9
|
+
super.merge(
|
10
|
+
{
|
11
|
+
categories: serialize_categories,
|
12
|
+
taxonomies:,
|
13
|
+
attachments: {
|
14
|
+
attachment_collections: serialize_attachment_collections,
|
15
|
+
files: serialize_attachments
|
16
|
+
},
|
17
|
+
weight: resource.weight,
|
18
|
+
components: serialize_components
|
19
|
+
}
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -10,15 +10,14 @@ module Decidim
|
|
10
10
|
sent_at: resource.sent_at,
|
11
11
|
accepted_at: resource.accepted_at,
|
12
12
|
rejected_at: resource.rejected_at,
|
13
|
-
|
14
|
-
|
15
|
-
email: resource.user.email
|
16
|
-
},
|
13
|
+
created_at: resource.created_at,
|
14
|
+
updated_at: resource.updated_at,
|
17
15
|
registration_type: {
|
18
16
|
title: resource.registration_type.title,
|
19
17
|
price: resource.registration_type.price
|
20
18
|
},
|
21
19
|
conference: {
|
20
|
+
url: Decidim::EngineRouter.main_proxy(resource.conference).conference_url(resource.conference),
|
22
21
|
title: resource.conference.title,
|
23
22
|
reference: resource.conference.reference,
|
24
23
|
slogan: resource.conference.slogan,
|
data/app/serializers/decidim/conferences/download_your_data_conference_registration_serializer.rb
CHANGED
@@ -7,15 +7,15 @@ module Decidim
|
|
7
7
|
def serialize
|
8
8
|
{
|
9
9
|
id: resource.id,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
},
|
10
|
+
created_at: resource.created_at,
|
11
|
+
updated_at: resource.updated_at,
|
12
|
+
confirmed_at: resource.confirmed_at,
|
14
13
|
registration_type: {
|
15
14
|
title: resource.registration_type.title,
|
16
15
|
price: resource.registration_type.price
|
17
16
|
},
|
18
17
|
conference: {
|
18
|
+
url: Decidim::EngineRouter.main_proxy(resource.conference).conference_url(resource.conference),
|
19
19
|
title: resource.conference.title,
|
20
20
|
reference: resource.conference.reference,
|
21
21
|
slogan: resource.conference.slogan,
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This class serializes a Conference so it can be exported to CSV for the Open Data feature.
|
6
|
+
class OpenDataConferenceSerializer < Decidim::Exporters::ParticipatorySpaceSerializer
|
7
|
+
# Public: Exports a hash with the serialized data for this conference.
|
8
|
+
def serialize
|
9
|
+
super.merge(
|
10
|
+
{
|
11
|
+
url: EngineRouter.main_proxy(resource).conference_url(resource),
|
12
|
+
slogan: resource.slogan,
|
13
|
+
remote_hero_image_url: Decidim::Conferences::ConferencePresenter.new(resource).hero_image_url,
|
14
|
+
remote_banner_image_url: Decidim::Conferences::ConferencePresenter.new(resource).banner_image_url,
|
15
|
+
location: resource.location,
|
16
|
+
objectives: resource.objectives,
|
17
|
+
start_date: resource.start_date,
|
18
|
+
end_date: resource.end_date,
|
19
|
+
scopes_enabled: resource.scopes_enabled,
|
20
|
+
decidim_scope_id: resource.decidim_scope_id,
|
21
|
+
scope: {
|
22
|
+
id: resource.scope.try(:id),
|
23
|
+
name: resource.scope.try(:name) || empty_translatable
|
24
|
+
}
|
25
|
+
}
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<% if view == :deleted %>
|
2
|
+
<% if allowed_to? :restore, :conference, trashable_deleted_resource: conference %>
|
3
|
+
<%= icon_link_to "refresh-line", restore_conference_path(conference), t("decidim.admin.actions.restore"), method: :patch, class: "action-icon--restore" %>
|
4
|
+
<% end %>
|
5
|
+
<% else %>
|
6
|
+
<% if allowed_to? :read, :share_tokens, current_participatory_space: conference %>
|
7
|
+
<%= icon_link_to "share-line", decidim_admin_conferences.conference_share_tokens_path(conference), t("actions.share_tokens", scope: "decidim.admin"), class: "action-icon--new" %>
|
8
|
+
<% else %>
|
9
|
+
<span class="action-space icon"></span>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if allowed_to? :update, :conference, conference: conference %>
|
13
|
+
<%= icon_link_to "pencil-line", edit_conference_path(conference), t("decidim.admin.actions.configure"), class: "action-icon--new" %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% if allowed_to? :create, :conference, conference: conference %>
|
17
|
+
<%= icon_link_to "file-copy-line", new_conference_copy_path(conference), t("decidim.admin.actions.duplicate"), class: "action-icon--copy" %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% if allowed_to? :preview, :conference, conference: conference %>
|
21
|
+
<%= icon_link_to "eye-line", decidim_conferences.conference_path(conference), t("decidim.admin.actions.preview"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% if allowed_to? :read, :moderation, conference: conference %>
|
25
|
+
<%= icon_link_to "flag-line", moderations_path(conference), t("decidim.admin.actions.moderate"), class: "action-icon--moderate" %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<% if allowed_to? :soft_delete, :conference, trashable_deleted_resource: conference %>
|
29
|
+
<% if conference.published? %>
|
30
|
+
<%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("decidim.admin.actions.soft_delete") %>
|
31
|
+
<% else %>
|
32
|
+
<%= icon_link_to "delete-bin-line", soft_delete_conference_path(conference), t("decidim.admin.actions.soft_delete"), method: :patch, class: "action-icon--delete", data: { confirm: t("decidim.admin.actions.confirm_delete_conference") } %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<tr>
|
2
|
+
<td>
|
3
|
+
<% if conference.promoted? %>
|
4
|
+
<%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% if allowed_to? :update, :conference, conference: conference %>
|
8
|
+
<%= link_to translated_attribute(conference.title), edit_conference_path(conference) %><br>
|
9
|
+
<% elsif allowed_to? :read, :component, conference: conference %>
|
10
|
+
<%= link_to translated_attribute(conference.title), components_path(conference) %><br>
|
11
|
+
<% else %>
|
12
|
+
<%= translated_attribute(conference.title) %>
|
13
|
+
<% end %>
|
14
|
+
</td>
|
15
|
+
<td>
|
16
|
+
<%= l conference.created_at, format: :short %>
|
17
|
+
</td>
|
18
|
+
<td class="table-list__state">
|
19
|
+
<% if conference.published? %>
|
20
|
+
<span class="label !text-sm success"><%= t("conferences.index.published", scope: "decidim.admin") %></span>
|
21
|
+
<% else %>
|
22
|
+
<span class="label !text-sm alert"><%= t("conferences.index.unpublished", scope: "decidim.admin") %></span>
|
23
|
+
<% end %>
|
24
|
+
</td>
|
25
|
+
<td class="table-list__actions">
|
26
|
+
<%= render partial: "decidim/conferences/admin/conferences/actions", locals: { conference:, view: } %>
|
27
|
+
</td>
|
28
|
+
</tr>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<thead>
|
2
|
+
<tr>
|
3
|
+
<th><%= t("models.conference.fields.title", scope: "decidim.admin") %></th>
|
4
|
+
<th><%= sort_link(query, :created_at, t("models.conference.fields.created_at", scope: "decidim.admin"), default_order: :desc) %></th>
|
5
|
+
<th class="table-list__actions"><%= t("models.conference.fields.published", scope: "decidim.admin") %></th>
|
6
|
+
<th></th>
|
7
|
+
</tr>
|
8
|
+
</thead>
|
@@ -62,14 +62,6 @@
|
|
62
62
|
</div>
|
63
63
|
</div>
|
64
64
|
|
65
|
-
<div class="row column">
|
66
|
-
<%= form.check_box :scopes_enabled %>
|
67
|
-
</div>
|
68
|
-
|
69
|
-
<div class="row column">
|
70
|
-
<%= scopes_select_field form, :scope_id, root: nil %>
|
71
|
-
</div>
|
72
|
-
|
73
65
|
<div class="row column">
|
74
66
|
<%= form.check_box :show_statistics %>
|
75
67
|
</div>
|
@@ -116,5 +108,32 @@
|
|
116
108
|
</div>
|
117
109
|
</div>
|
118
110
|
|
111
|
+
<div class="card" data-component="accordion" id="accordion-taxonomies">
|
112
|
+
<div class="card-divider">
|
113
|
+
<button class="card-divider-button" data-open="true" data-controls="panel-taxonomies" type="button">
|
114
|
+
<%= icon "arrow-right-s-line" %>
|
115
|
+
<h2 class="card-title" id="taxonomies">
|
116
|
+
<%= t("taxonomies", scope: "decidim.conferences.admin.conferences.form") %>
|
117
|
+
</h2>
|
118
|
+
</button>
|
119
|
+
</div>
|
120
|
+
<div id="panel-taxonomies" class="card-section">
|
121
|
+
<% if @form.taxonomy_filters.blank? %>
|
122
|
+
<div class="row column">
|
123
|
+
<p class="text-gray mr-2 mt-4">
|
124
|
+
<%= t("no_taxonomy_filters_found", scope: "decidim.conferences.admin.conferences.form") %>
|
125
|
+
<%= link_to(t("define_taxonomy_filters", scope: "decidim.conferences.admin.conferences.form"), decidim_admin.taxonomies_path, class: "button button__text-secondary") %>
|
126
|
+
</p>
|
127
|
+
</div>
|
128
|
+
<% else %>
|
129
|
+
<% @form.taxonomy_filters.each do |filter| %>
|
130
|
+
<div class="row column">
|
131
|
+
<%= filter_taxonomy_items_select_field form, :taxonomies, filter %>
|
132
|
+
</div>
|
133
|
+
<% end %>
|
134
|
+
<% end %>
|
135
|
+
</div>
|
136
|
+
</div>
|
119
137
|
</div>
|
138
|
+
|
120
139
|
<%= append_javascript_pack_tag "decidim_conferences_admin" %>
|