Class: Decidim::Conferences::Admin::ConferenceRegistrationsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Decidim::Conferences::Admin::Concerns::ConferenceAdmin, Paginable
Defined in:
app/controllers/decidim/conferences/admin/conference_registrations_controller.rb

Overview

Controller that allows to manage the conference users registrations.

Instance Method Summary collapse

Instance Method Details

#confirmObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/decidim/conferences/admin/conference_registrations_controller.rb', line 34

def confirm
  enforce_permission_to(:confirm, :conference_registration, conference_registration:)

  ConfirmConferenceRegistration.call(conference_registration, current_user) do
    on(:ok) do
      flash[:notice] = I18n.t("conference_registration.confirm.success", scope: "decidim.admin")
    end

    on(:invalid) do
      flash[:alert] = I18n.t("conference_registration.confirm.error", scope: "decidim.admin")
    end

    redirect_back(fallback_location: conference_conference_registrations_path)
  end
end

#exportObject



24
25
26
27
28
29
30
31
32
# File 'app/controllers/decidim/conferences/admin/conference_registrations_controller.rb', line 24

def export
  enforce_permission_to(:export_conference_registrations, :conference, conference: current_participatory_space)

  ExportConferenceRegistrations.call(current_participatory_space, params[:format], current_user) do
    on(:ok) do |export_data|
      send_data export_data.read, type: "text/#{export_data.extension}", filename: export_data.filename("conference_registrations")
    end
  end
end

#indexObject



18
19
20
21
22
# File 'app/controllers/decidim/conferences/admin/conference_registrations_controller.rb', line 18

def index
  enforce_permission_to(:read_conference_registrations, :conference, conference: current_participatory_space)

  @conference_registrations = paginate(current_participatory_space.conference_registrations)
end