Sha256: 77060f302e1e8917f37afd1ea894613988b06dfa1d105d22420b3cc3fdf629c4
Contents?: true
Size: 1.28 KB
Versions: 32
Compression:
Stored size: 1.28 KB
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin # Controller that allows managing assembly publications. # class AssemblyPublicationsController < Decidim::Admin::ApplicationController include Concerns::AssemblyAdmin def create authorize! :publish, current_assembly PublishAssembly.call(current_assembly) do on(:ok) do flash[:notice] = I18n.t("assembly_publications.create.success", scope: "decidim.admin") end on(:invalid) do flash.now[:alert] = I18n.t("assembly_publications.create.error", scope: "decidim.admin") end redirect_back(fallback_location: assemblies_path) end end def destroy authorize! :publish, current_assembly UnpublishAssembly.call(current_assembly) do on(:ok) do flash[:notice] = I18n.t("assembly_publications.destroy.success", scope: "decidim.admin") end on(:invalid) do flash.now[:alert] = I18n.t("assembly_publications.destroy.error", scope: "decidim.admin") end redirect_back(fallback_location: assemblies_path) end end end end end end
Version data entries
32 entries across 32 versions & 2 rubygems