Sha256: 516bdeb8db401ac6ef1c5f9984e7bdc7437778e2c4c52805e21dbb80bbf17fe1

Contents?: true

Size: 733 Bytes

Versions: 9

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    # This cell renders a checkmark with a text.
    class ProjectVotedHintCell < BaseCell
      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-line", 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

9 entries across 9 versions & 1 rubygems

Version Path
decidim-budgets-0.30.0.rc2 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.30.0.rc1 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.2 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.1 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.0 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.0.rc4 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.0.rc3 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.0.rc2 app/cells/decidim/budgets/project_voted_hint_cell.rb
decidim-budgets-0.29.0.rc1 app/cells/decidim/budgets/project_voted_hint_cell.rb