Sha256: 3c9d6d12a9bb86db70480b457555e62f234483aec4b1e05acd0ed0d4d6e18ca3

Contents?: true

Size: 733 Bytes

Versions: 47

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  module Proposals
    # This cell renders the tags for a proposal.
    class ProposalTagsCell < Decidim::ViewModel
      include ProposalCellsHelper

      property :category
      property :previous_category
      property :scope
      property :previous_scope

      def show
        render if has_category_or_scopes?
      end

      private

      def show_previous_category?
        options[:show_previous_category].to_s != "false"
      end

      def show_previous_scope?
        options[:show_previous_scope].to_s != "false"
      end

      def has_category_or_scopes?
        category.present? || has_visible_scopes?(model)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

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