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.29.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.4 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.27.9 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.29.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.3 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.27.8 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.29.0.rc4 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.29.0.rc3 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.29.0.rc2 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.29.0.rc1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.2 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.27.7 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.1 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.27.6 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.26.10 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.26.9 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.0 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.27.5 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.0.rc5 app/controllers/decidim/conferences/admin/conference_copies_controller.rb
decidim-conferences-0.28.0.rc4 app/controllers/decidim/conferences/admin/conference_copies_controller.rb