Sha256: 7db40246c1df9744cc56379e1ed789d748f3ed7e34dac3e73161061164632a86

Contents?: true

Size: 1.21 KB

Versions: 58

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module Decidim::Amendable
  # This cell renders the action buttons for coauthors to amend the given resource.
  class EmendationActionsCell < Decidim::ViewModel
    include Decidim::LayoutHelper

    delegate :amendment, to: :model

    def current_component
      model.component
    end

    def review_amend_path
      decidim.review_amend_path(amendment)
    end

    def accept_button_classes
      "button success hollow expanded button--icon button--sc"
    end

    def accept_button_label
      content = icon "thumb-up"
      content += t(:button_accept, scope: "decidim.amendments.emendation.actions")
      content
    end

    def reject_amend_path
      decidim.reject_amend_path(amendment)
    end

    def reject_button_classes
      "button alert hollow expanded button--icon button--sc"
    end

    def reject_button_label
      content = icon "thumb-down"
      content += t(:button_reject, scope: "decidim.amendments.emendation.actions")
      content
    end

    def accept_reject_help_text
      content_tag :small do
        t(:help_text, scope: "decidim.amendments.emendation.actions")
      end
    end

    def decidim
      Decidim::Core::Engine.routes.url_helpers
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.8 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.7 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.6 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.10 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.9 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.5 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.8 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.4 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.3 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.7 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.5 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.2 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.1 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.4 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.0 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.3 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.0.rc2 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.27.0.rc1 app/cells/decidim/amendable/emendation_actions_cell.rb
decidim-core-0.26.2 app/cells/decidim/amendable/emendation_actions_cell.rb