Sha256: 6a52264dd33cdbed104239eff0bc2db1048ecaa170b01257ea1c71813f9fd39c
Contents?: true
Size: 762 Bytes
Versions: 7
Compression:
Stored size: 762 Bytes
Contents
# frozen_string_literal: true module Decidim class ParticipatorySpaceDropdownMetadataCell < Decidim::ViewModel include Decidim::TwitterSearchHelper include Decidim::SanitizeHelper private def nav_items_method = nil def nav_items return [] if nav_items_method.blank? return [] if (nav_items = try(nav_items_method, model)).blank? nav_items end def title decidim_html_escape(translated_attribute(model.try(:title) || model.try(:name) || "")) end def hashtag return unless model.respond_to?(:hashtag) @hashtag ||= decidim_html_escape(model.hashtag) if model.hashtag.present? end def id return "#{model.id}-mobile" if options[:mobile] model.id end end end
Version data entries
7 entries across 7 versions & 1 rubygems