decidim-conferences 0.30.2 → 0.31.0.rc1
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/app/cells/decidim/conferences/content_blocks/highlighted_conferences_settings_form/show.erb +3 -1
- data/app/commands/decidim/conferences/admin/create_conference.rb +1 -1
- data/app/commands/decidim/conferences/admin/{copy_conference.rb → duplicate_conference.rb} +15 -16
- data/app/commands/decidim/conferences/admin/update_conference.rb +2 -2
- data/app/controllers/decidim/conferences/admin/conference_duplicates_controller.rb +35 -0
- data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +4 -4
- data/app/controllers/decidim/conferences/admin/conferences_controller.rb +3 -3
- data/app/controllers/decidim/conferences/admin/diplomas_controller.rb +1 -1
- data/app/controllers/decidim/conferences/admin/media_links_controller.rb +2 -2
- data/app/controllers/decidim/conferences/admin/partners_controller.rb +2 -2
- data/app/controllers/decidim/conferences/admin/registration_types_controller.rb +2 -2
- data/app/forms/decidim/conferences/admin/{conference_copy_form.rb → conference_duplicate_form.rb} +3 -3
- data/app/forms/decidim/conferences/admin/conference_form.rb +0 -4
- data/app/helpers/decidim/conferences/conference_helper.rb +1 -0
- data/app/jobs/decidim/conferences/upcoming_conference_notification_job.rb +1 -1
- data/app/models/decidim/conference.rb +0 -4
- data/app/models/decidim/conferences/registration_type.rb +4 -0
- data/app/packs/entrypoints/decidim_conferences_admin.js +0 -1
- data/app/packs/src/decidim/conferences/admin/conference_invite_form.js +1 -1
- data/app/packs/src/decidim/conferences/admin/conference_speakers.js +1 -1
- data/app/packs/src/decidim/conferences/admin/conferences.js +1 -1
- data/app/packs/stylesheets/decidim/conferences/conferences.scss +5 -5
- data/app/permissions/decidim/conferences/permissions.rb +4 -4
- data/app/presenters/decidim/conference_speaker_presenter.rb +0 -4
- data/app/presenters/decidim/conferences/admin_log/conference_presenter.rb +0 -1
- data/app/presenters/decidim/conferences/conference_stats_presenter.rb +1 -3
- data/app/queries/decidim/conferences/admin/conference_speakers.rb +2 -2
- data/app/queries/decidim/conferences/conferences_stats_followers_count.rb +14 -0
- data/app/queries/decidim/conferences/conferences_stats_participants_count.rb +14 -0
- data/app/views/decidim/conferences/admin/{conference_copies → conference_duplicates}/_form.html.erb +3 -3
- data/app/views/decidim/conferences/admin/conference_duplicates/new.html.erb +19 -0
- data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +34 -20
- data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +51 -22
- data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +44 -17
- data/app/views/decidim/conferences/admin/conferences/_actions.html.erb +108 -33
- data/app/views/decidim/conferences/admin/conferences/_conference_row.html.erb +4 -4
- data/app/views/decidim/conferences/admin/conferences/_conferences_thead.html.erb +2 -2
- data/app/views/decidim/conferences/admin/conferences/_form.html.erb +115 -40
- data/app/views/decidim/conferences/admin/conferences/edit.html.erb +0 -8
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +2 -2
- data/app/views/decidim/conferences/admin/conferences/manage_trash.html.erb +2 -1
- data/app/views/decidim/conferences/admin/media_links/index.html.erb +32 -13
- data/app/views/decidim/conferences/admin/partners/index.html.erb +33 -14
- data/app/views/decidim/conferences/admin/registration_types/index.html.erb +56 -21
- data/app/views/decidim/conferences/conference_program/show.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/_conference_hero.html.erb +0 -5
- data/app/views/decidim/conferences/conferences/show.html.erb +1 -1
- data/app/views/layouts/decidim/diploma.html.erb +2 -2
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +1 -10
- data/config/locales/bg.yml +1 -13
- data/config/locales/bs-BA.yml +0 -5
- data/config/locales/ca-IT.yml +24 -12
- data/config/locales/ca.yml +24 -12
- data/config/locales/cs.yml +23 -11
- data/config/locales/de.yml +25 -13
- data/config/locales/el.yml +1 -10
- data/config/locales/en.yml +24 -12
- data/config/locales/es-MX.yml +24 -12
- data/config/locales/es-PY.yml +24 -12
- data/config/locales/es.yml +24 -12
- data/config/locales/eu.yml +24 -12
- data/config/locales/fi-plain.yml +23 -11
- data/config/locales/fi.yml +23 -11
- data/config/locales/fr-CA.yml +24 -15
- data/config/locales/fr.yml +24 -15
- data/config/locales/ga-IE.yml +2 -6
- data/config/locales/gl.yml +1 -10
- data/config/locales/hu.yml +1 -10
- data/config/locales/id-ID.yml +1 -9
- data/config/locales/it.yml +1 -10
- data/config/locales/ja.yml +25 -13
- data/config/locales/lb.yml +1 -7
- data/config/locales/lt.yml +1 -10
- data/config/locales/lv.yml +1 -10
- data/config/locales/nl.yml +1 -10
- data/config/locales/no.yml +1 -10
- data/config/locales/pl.yml +1 -13
- data/config/locales/pt-BR.yml +1 -13
- data/config/locales/pt.yml +1 -10
- data/config/locales/ro-RO.yml +3 -10
- data/config/locales/sk.yml +1 -10
- data/config/locales/sl.yml +0 -5
- data/config/locales/sr-CS.yml +0 -5
- data/config/locales/sv.yml +16 -13
- data/config/locales/tr-TR.yml +1 -10
- data/config/locales/zh-CN.yml +1 -10
- data/config/locales/zh-TW.yml +1 -10
- data/db/migrate/20250605094623_remove_hashtag_column_conferences.rb +7 -0
- data/lib/decidim/api/conference_registration_type_type.rb +30 -0
- data/lib/decidim/api/conference_speaker_type.rb +12 -0
- data/lib/decidim/api/conference_type.rb +15 -3
- data/lib/decidim/conferences/admin_engine.rb +1 -1
- data/lib/decidim/conferences/api.rb +1 -0
- data/lib/decidim/conferences/conference_diploma_pdf.rb +1 -1
- data/lib/decidim/conferences/engine.rb +5 -3
- data/lib/decidim/conferences/participatory_space.rb +14 -0
- data/lib/decidim/conferences/seeds.rb +5 -6
- data/lib/decidim/conferences/test/factories.rb +2 -2
- data/lib/decidim/conferences/version.rb +1 -1
- metadata +19 -15
- data/app/controllers/decidim/conferences/admin/conference_copies_controller.rb +0 -35
- data/app/views/decidim/conferences/admin/conference_copies/new.html.erb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b887cd8971831b59eee1f63a2101059c0ea980b297c5b3776cc74ab309bfd84
|
4
|
+
data.tar.gz: 6bb90bfa32c0b365910fd1404910992355cc55778cf27c9678c8d382401a458d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366dee830593889471931933b1c4ebdda1f324b3f819d34a46ffc814671d5743fde99b6461cc3743dd65aff2d51282612d5fd83f1266d7c6a31046252d2eafb0
|
7
|
+
data.tar.gz: a061b1609f621df28be8e29f69e3491037637a0fbec22d4cd369d006d6520ec3ebe60507c7543d5515eedc29b85f040f3a2459f2e66edfcfb46dd6e40c8e35bd
|
@@ -8,7 +8,7 @@ module Decidim
|
|
8
8
|
class CreateConference < Decidim::Commands::CreateResource
|
9
9
|
fetch_file_attributes :hero_image, :banner_image
|
10
10
|
|
11
|
-
fetch_form_attributes :organization, :title, :slogan, :slug, :weight, :
|
11
|
+
fetch_form_attributes :organization, :title, :slogan, :slug, :weight, :description,
|
12
12
|
:short_description, :objectives, :location, :taxonomizations, :start_date, :end_date,
|
13
13
|
:promoted, :show_statistics, :registrations_enabled, :available_slots, :registration_terms
|
14
14
|
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
|
-
# A command with all the business logic when
|
6
|
+
# A command with all the business logic when duplicating a new participatory
|
7
7
|
# conference in the system.
|
8
|
-
class
|
8
|
+
class DuplicateConference < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# form - A form object with the params.
|
@@ -25,25 +25,24 @@ module Decidim
|
|
25
25
|
return broadcast(:invalid) if form.invalid?
|
26
26
|
|
27
27
|
Conference.transaction do
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
duplicate_conference
|
29
|
+
duplicate_conference_attachments
|
30
|
+
duplicate_conference_components if @form.duplicate_components?
|
31
31
|
end
|
32
32
|
|
33
|
-
broadcast(:ok, @
|
33
|
+
broadcast(:ok, @duplicated_conference)
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
38
|
attr_reader :form
|
39
39
|
|
40
|
-
def
|
41
|
-
@
|
40
|
+
def duplicate_conference
|
41
|
+
@duplicated_conference = Conference.create!(
|
42
42
|
organization: @conference.organization,
|
43
43
|
title: form.title,
|
44
44
|
slogan: @conference.slogan,
|
45
45
|
slug: form.slug,
|
46
|
-
hashtag: @conference.hashtag,
|
47
46
|
description: @conference.description,
|
48
47
|
short_description: @conference.short_description,
|
49
48
|
location: @conference.location,
|
@@ -55,20 +54,20 @@ module Decidim
|
|
55
54
|
)
|
56
55
|
end
|
57
56
|
|
58
|
-
def
|
57
|
+
def duplicate_conference_attachments
|
59
58
|
[:hero_image, :banner_image].each do |attribute|
|
60
59
|
next unless @conference.attached_uploader(attribute).attached?
|
61
60
|
|
62
|
-
@
|
61
|
+
@duplicated_conference.send(attribute).attach(@conference.send(attribute).blob)
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
|
-
def
|
65
|
+
def duplicate_conference_components
|
67
66
|
@conference.components.each do |component|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
component.manifest.run_hooks(:
|
67
|
+
component_duplicated = component.dup
|
68
|
+
component_duplicated.participatory_space = @duplicated_conference
|
69
|
+
component_duplicated.save
|
70
|
+
component.manifest.run_hooks(:duplicate, new_component: component_duplicated, old_component: component)
|
72
71
|
end
|
73
72
|
end
|
74
73
|
end
|
@@ -8,7 +8,7 @@ module Decidim
|
|
8
8
|
class UpdateConference < Decidim::Commands::UpdateResource
|
9
9
|
fetch_file_attributes :hero_image, :banner_image
|
10
10
|
|
11
|
-
fetch_form_attributes :title, :slogan, :slug, :weight, :
|
11
|
+
fetch_form_attributes :title, :slogan, :slug, :weight, :description, :short_description,
|
12
12
|
:objectives, :location, :start_date, :end_date, :promoted, :show_statistics,
|
13
13
|
:taxonomizations, :registrations_enabled
|
14
14
|
|
@@ -75,7 +75,7 @@ module Decidim
|
|
75
75
|
checksum = Decidim::Conferences::UpcomingConferenceNotificationJob.generate_checksum(resource)
|
76
76
|
|
77
77
|
Decidim::Conferences::UpcomingConferenceNotificationJob
|
78
|
-
.set(wait_until: (resource.start_date - 2.days).
|
78
|
+
.set(wait_until: (resource.start_date - 2.days).to_time)
|
79
79
|
.perform_later(resource.id, checksum)
|
80
80
|
end
|
81
81
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing conferences.
|
7
|
+
#
|
8
|
+
class ConferenceDuplicatesController < Decidim::Conferences::Admin::ApplicationController
|
9
|
+
include Concerns::ConferenceAdmin
|
10
|
+
|
11
|
+
def new
|
12
|
+
enforce_permission_to :create, :conference
|
13
|
+
@form = form(ConferenceDuplicateForm).from_model(current_conference)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
enforce_permission_to :create, :conference
|
18
|
+
@form = form(ConferenceDuplicateForm).from_params(params)
|
19
|
+
|
20
|
+
DuplicateConference.call(@form, current_conference) do
|
21
|
+
on(:ok) do
|
22
|
+
flash[:notice] = I18n.t("conferences_duplicates.create.success", scope: "decidim.admin")
|
23
|
+
redirect_to conferences_path
|
24
|
+
end
|
25
|
+
|
26
|
+
on(:invalid) do
|
27
|
+
flash.now[:alert] = I18n.t("conferences_duplicates.create.error", scope: "decidim.admin")
|
28
|
+
render :new, status: :unprocessable_entity
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -36,7 +36,7 @@ module Decidim
|
|
36
36
|
|
37
37
|
on(:invalid) do
|
38
38
|
flash[:alert] = I18n.t("conference_speakers.create.error", scope: "decidim.admin")
|
39
|
-
render :new
|
39
|
+
render :new, status: :unprocessable_entity
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -58,7 +58,7 @@ module Decidim
|
|
58
58
|
|
59
59
|
on(:invalid) do
|
60
60
|
flash.now[:alert] = I18n.t("conference_speakers.update.error", scope: "decidim.admin")
|
61
|
-
render :edit
|
61
|
+
render :edit, status: :unprocessable_entity
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -85,7 +85,7 @@ module Decidim
|
|
85
85
|
|
86
86
|
on(:invalid) do
|
87
87
|
flash.now[:alert] = I18n.t("conference_speakers.publish.invalid", scope: "decidim.admin")
|
88
|
-
render action: "index"
|
88
|
+
render action: "index", status: :unprocessable_entity
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -101,7 +101,7 @@ module Decidim
|
|
101
101
|
|
102
102
|
on(:invalid) do
|
103
103
|
flash.now[:alert] = I18n.t("conference_speakers.unpublish.invalid", scope: "decidim.admin")
|
104
|
-
render action: "index"
|
104
|
+
render action: "index", status: :unprocessable_entity
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
@@ -35,7 +35,7 @@ module Decidim
|
|
35
35
|
|
36
36
|
on(:invalid) do
|
37
37
|
flash.now[:alert] = I18n.t("conferences.create.error", scope: "decidim.admin")
|
38
|
-
render :new
|
38
|
+
render :new, status: :unprocessable_entity
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -61,12 +61,12 @@ module Decidim
|
|
61
61
|
|
62
62
|
on(:invalid) do
|
63
63
|
flash.now[:alert] = I18n.t("conferences.update.error", scope: "decidim.admin")
|
64
|
-
render :edit, layout: "decidim/admin/conference"
|
64
|
+
render :edit, layout: "decidim/admin/conference", status: :unprocessable_entity
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
69
|
+
def duplicate
|
70
70
|
enforce_permission_to :create, :conference
|
71
71
|
end
|
72
72
|
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
|
32
32
|
on(:invalid) do
|
33
33
|
flash[:alert] = I18n.t("media_links.create.error", scope: "decidim.admin")
|
34
|
-
render :new
|
34
|
+
render :new, status: :unprocessable_entity
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -55,7 +55,7 @@ module Decidim
|
|
55
55
|
|
56
56
|
on(:invalid) do
|
57
57
|
flash.now[:alert] = I18n.t("media_links.update.error", scope: "decidim.admin")
|
58
|
-
render :edit
|
58
|
+
render :edit, status: :unprocessable_entity
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -32,7 +32,7 @@ module Decidim
|
|
32
32
|
|
33
33
|
on(:invalid) do
|
34
34
|
flash[:alert] = I18n.t("partners.create.error", scope: "decidim.admin")
|
35
|
-
render :new
|
35
|
+
render :new, status: :unprocessable_entity
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
|
57
57
|
on(:invalid) do
|
58
58
|
flash.now[:alert] = I18n.t("partners.update.error", scope: "decidim.admin")
|
59
|
-
render :edit
|
59
|
+
render :edit, status: :unprocessable_entity
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -35,7 +35,7 @@ module Decidim
|
|
35
35
|
|
36
36
|
on(:invalid) do
|
37
37
|
flash.now[:alert] = I18n.t("registration_types.create.error", scope: "decidim.admin")
|
38
|
-
render :new
|
38
|
+
render :new, status: :unprocessable_entity
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -59,7 +59,7 @@ module Decidim
|
|
59
59
|
|
60
60
|
on(:invalid) do
|
61
61
|
flash.now[:alert] = I18n.t("registration_types.update.error", scope: "decidim.admin")
|
62
|
-
render :edit
|
62
|
+
render :edit, status: :unprocessable_entity
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/app/forms/decidim/conferences/admin/{conference_copy_form.rb → conference_duplicate_form.rb}
RENAMED
@@ -3,10 +3,10 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
|
-
# A form object used to
|
6
|
+
# A form object used to duplicate a conferences from the admin
|
7
7
|
# dashboard.
|
8
8
|
#
|
9
|
-
class
|
9
|
+
class ConferenceDuplicateForm < Form
|
10
10
|
include TranslatableAttributes
|
11
11
|
|
12
12
|
translatable_attribute :title, String
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
mimic :conference
|
15
15
|
|
16
16
|
attribute :slug, String
|
17
|
-
attribute :
|
17
|
+
attribute :duplicate_components, Boolean
|
18
18
|
|
19
19
|
validates :slug, presence: true, format: { with: Decidim::Conference.slug_format }
|
20
20
|
validates :title, translatable_presence: true
|
@@ -22,7 +22,6 @@ module Decidim
|
|
22
22
|
|
23
23
|
attribute :slug, String
|
24
24
|
attribute :weight, Integer, default: 0
|
25
|
-
attribute :hashtag, String
|
26
25
|
attribute :promoted, Boolean
|
27
26
|
attribute :hero_image
|
28
27
|
attribute :remove_hero_image, Boolean, default: false
|
@@ -51,9 +50,6 @@ module Decidim
|
|
51
50
|
validates :banner_image, passthru: { to: Decidim::Conference }
|
52
51
|
validate :available_slots_greater_than_or_equal_to_registrations_count, if: ->(form) { form.registrations_enabled? && form.available_slots.try(:positive?) }
|
53
52
|
|
54
|
-
validates :start_date, presence: true, date: { before_or_equal_to: :end_date }
|
55
|
-
validates :end_date, presence: true, date: { after_or_equal_to: :start_date }
|
56
|
-
|
57
53
|
alias organization current_organization
|
58
54
|
|
59
55
|
def participatory_space_manifest
|
@@ -10,6 +10,7 @@ module Decidim
|
|
10
10
|
# Renders the dates of a conference
|
11
11
|
#
|
12
12
|
def render_date(conference)
|
13
|
+
return if conference.start_date.nil? || conference.end_date.nil?
|
13
14
|
return l(conference.start_date, format: :decidim_with_month_name_short) if conference.start_date == conference.end_date
|
14
15
|
|
15
16
|
"#{l(conference.start_date, format: :decidim_with_month_name_short)} - #{l(conference.end_date, format: :decidim_with_month_name_short)}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import createFieldDependentInputs from "src/decidim/admin/field_dependent_inputs.component"
|
2
2
|
|
3
|
-
|
3
|
+
document.addEventListener("turbo:load", () => {
|
4
4
|
const $attendeeType = $('[name="conference_registration_invite[existing_user]"');
|
5
5
|
|
6
6
|
createFieldDependentInputs({
|
@@ -1,5 +1,5 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
@
|
4
|
-
@
|
5
|
-
@
|
1
|
+
@use "stylesheets/decidim/conferences/conference";
|
2
|
+
@use "stylesheets/decidim/conferences/speaker";
|
3
|
+
@use "stylesheets/decidim/conferences/registration";
|
4
|
+
@use "stylesheets/decidim/conferences/program";
|
5
|
+
@use "stylesheets/decidim/conferences/media";
|
@@ -51,7 +51,7 @@ module Decidim
|
|
51
51
|
|
52
52
|
moderator_action?
|
53
53
|
collaborator_action?
|
54
|
-
|
54
|
+
evaluator_action?
|
55
55
|
conference_admin_action?
|
56
56
|
|
57
57
|
permission_action
|
@@ -248,9 +248,9 @@ module Decidim
|
|
248
248
|
allow! if permission_action.action == :read || permission_action.action == :preview
|
249
249
|
end
|
250
250
|
|
251
|
-
#
|
252
|
-
def
|
253
|
-
return unless can_manage_conference?(role: :
|
251
|
+
# Evaluators can only read components
|
252
|
+
def evaluator_action?
|
253
|
+
return unless can_manage_conference?(role: :evaluator)
|
254
254
|
|
255
255
|
allow! if permission_action.action == :read && permission_action.subject == :component
|
256
256
|
allow! if permission_action.action == :export && permission_action.subject == :component_data
|
@@ -8,7 +8,7 @@ module Decidim
|
|
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.
|
11
|
-
# query - query to filter user
|
11
|
+
# query - query to filter user names
|
12
12
|
def self.for(conference_speakers, query = nil)
|
13
13
|
new(conference_speakers, query).query
|
14
14
|
end
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
# Initializes the class.
|
17
17
|
#
|
18
18
|
# conference_speakers - the ConferenceSpeaker relation that need to be filtered
|
19
|
-
# query - query to filter user
|
19
|
+
# query - query to filter user names
|
20
20
|
def initialize(conference_speakers, query = nil)
|
21
21
|
@conference_speakers = conference_speakers
|
22
22
|
@query = query
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This class counts all Followers of a conference
|
6
|
+
class ConferencesStatsFollowersCount < Decidim::StatsFollowersCount
|
7
|
+
def self.for(participatory_space)
|
8
|
+
return 0 unless participatory_space.is_a?(Decidim::Conferences)
|
9
|
+
|
10
|
+
new(participatory_space).query
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This class counts unique Participants on a conference
|
6
|
+
class ConferencesStatsParticipantsCount < Decidim::StatsParticipantsCount
|
7
|
+
def self.for(participatory_space)
|
8
|
+
return 0 unless participatory_space.is_a?(Decidim::Conferences)
|
9
|
+
|
10
|
+
new(participatory_space).query
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/app/views/decidim/conferences/admin/{conference_copies → conference_duplicates}/_form.html.erb
RENAMED
@@ -6,18 +6,18 @@
|
|
6
6
|
<div class="row column">
|
7
7
|
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
8
8
|
</div>
|
9
|
-
<div class="row column slug">
|
9
|
+
<div class="row column" data-controller="slug">
|
10
10
|
<%= form.text_field :slug, help_text: t(".slug_help_html", url: decidim_form_slug_url(:conferences, form.object.slug)) %>
|
11
11
|
</div>
|
12
12
|
<div class="row column">
|
13
13
|
<div class="card">
|
14
14
|
<div class="card-divider">
|
15
|
-
<legend><%= t("
|
15
|
+
<legend><%= t("conference_duplicates.new.select", scope: "decidim.admin") %></legend>
|
16
16
|
</div>
|
17
17
|
<div class="card-section">
|
18
18
|
<div class="row">
|
19
19
|
<div class="row column">
|
20
|
-
<%= form.check_box :
|
20
|
+
<%= form.check_box :duplicate_components %>
|
21
21
|
</div>
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% add_decidim_page_title(t("conference_duplicates.new.title", scope: "decidim.admin")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t("conference_duplicates.new.title", scope: "decidim.admin") %>
|
6
|
+
</h1>
|
7
|
+
</div>
|
8
|
+
<div class="item__edit item__edit-1col">
|
9
|
+
<div class="item__edit-form">
|
10
|
+
<%= decidim_form_for(@form, url: conference_duplicates_path(current_conference), method: :post, html: { class: "form form-defaults duplicate_conference" }) do |f| %>
|
11
|
+
<%= render partial: "form", object: f %>
|
12
|
+
<div class="item__edit-sticky">
|
13
|
+
<div class="item__edit-sticky-container">
|
14
|
+
<%= f.submit t("conference_duplicates.new.duplicate", scope: "decidim.admin"), class: "button button__sm button__secondary" %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|