Sha256: e2c3a12da2073aca444cfec67c0a6e9bd43aa01ad9e69f10a62c2f1f9b4eb094

Contents?: true

Size: 1006 Bytes

Versions: 19

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Controller that allows managing the appearance of the organization.
    class OrganizationAppearanceController < Decidim::Admin::ApplicationController
      layout "decidim/admin/settings"

      def edit
        authorize! :update, current_organization
        @form = form(OrganizationAppearanceForm).from_model(current_organization)
      end

      def update
        authorize! :update, current_organization
        @form = form(OrganizationAppearanceForm).from_params(params)

        UpdateOrganizationAppearance.call(current_organization, @form) do
          on(:ok) do
            flash[:notice] = I18n.t("organization.update.success", scope: "decidim.admin")
            redirect_to edit_organization_appearance_path
          end

          on(:invalid) do
            flash.now[:alert] = I18n.t("organization.update.error", scope: "decidim.admin")
            render :edit
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-admin-0.11.2 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.11.1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.11.0.pre1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.10.1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.10.0 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.9.3 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.9.2 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.9.1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.9.0 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.8.4 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.8.3 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.8.2 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.8.1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.8.0 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.7.4 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.7.3 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.7.2 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.7.1 app/controllers/decidim/admin/organization_appearance_controller.rb
decidim-admin-0.7.0 app/controllers/decidim/admin/organization_appearance_controller.rb