Sha256: f81e40fdf3aea57994ddfc5ce5078779db4fd148b70132a4bfd2c807ff67c52f

Contents?: true

Size: 736 Bytes

Versions: 13

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    class AuthorizationSignModalsController < Decidim::Initiatives::ApplicationController
      include Decidim::Initiatives::NeedsInitiative

      helper_method :authorizations, :authorize_action_path
      layout false

      def show
        render template: "decidim/authorization_modals/show"
      end

      def authorize_action_path(handler_name)
        authorizations.status_for(handler_name).current_path(redirect_url: URI(request.referer).path)
      end

      private

      def authorizations
        @authorizations ||= action_authorized_to("vote", resource: current_initiative, permissions_holder: current_initiative.type)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-initiatives-0.29.1 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.4 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.29.0 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.3 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.29.0.rc4 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.29.0.rc3 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.29.0.rc2 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.29.0.rc1 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.2 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.1 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.0 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.0.rc5 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb
decidim-initiatives-0.28.0.rc4 app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb