Sha256: 946de9ff5733409d6c44515d38f928400f111ae16326885c776e1848da9801db

Contents?: true

Size: 763 Bytes

Versions: 31

Compression:

Stored size: 763 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    # This cell renders a checkmark with a text.
    class ProjectVotedHintCell < BaseCell
      include Decidim::IconHelper

      delegate :voted_for?, :current_order, to: :controller

      def show
        return unless voted_for?(model)

        content_tag :span, safe_join(hint), class: css_class
      end

      private

      def hint
        contents = []
        contents << icon("check", role: "img", "aria-hidden": true)
        contents << " "
        contents << t("decidim.budgets.projects.project.you_voted")
      end

      def css_class
        css = ["text-sm", "text-success"]
        css << options[:class] if options[:class]
        css.join(" ")
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

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