Sha256: 01708d8052d3e117ec21efa2be4c6ffb27dd73082a624f5df323c5559bf349c6

Contents?: true

Size: 1.01 KB

Versions: 73

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    module Admin
      # Controller that allows managing conferences.
      #
      class ConferenceCopiesController < Decidim::Conferences::Admin::ApplicationController
        include Concerns::ConferenceAdmin

        def new
          enforce_permission_to :create, :conference
          @form = form(ConferenceCopyForm).from_model(current_conference)
        end

        def create
          enforce_permission_to :create, :conference
          @form = form(ConferenceCopyForm).from_params(params)

          CopyConference.call(@form, current_conference) do
            on(:ok) do
              flash[:notice] = I18n.t("conferences_copies.create.success", scope: "decidim.admin")
              redirect_to conferences_path
            end

            on(:invalid) do
              flash.now[:alert] = I18n.t("conferences_copies.create.error", scope: "decidim.admin")
              render :new
            end
          end
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
decidim-conferences-0.20.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.20.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.19.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.18.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.19.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.17.2 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.18.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.17.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.16.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.17.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.16.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.15.2 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.15.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb