Sha256: 3a8978bc4bfd0cce64ed6828f8d002956fc6e6729439180b07530099445a631d
Contents?: true
Size: 829 Bytes
Versions: 10
Compression:
Stored size: 829 Bytes
Contents
# frozen_string_literal: true require "cell/partial" module Decidim # Topics and their corresponding pages are mapped out to the footer # of the layout. # # Example: # # cell("decidim/footer_topics", nil) # class FooterTopicsCell < Decidim::ViewModel def show return if topics.blank? render end private def topics @topics ||= current_organization.static_page_topics.where(show_in_footer: true).map do |topic| next if topic.pages.empty? { title: decidim_escape_translated(topic.title), path: decidim.page_path(topic.pages.first) } end.compact end def topic_item(page_data, opts = {}) content_tag(:li, **opts.slice(:class)) do link_to page_data[:title], page_data[:path] end end end end
Version data entries
10 entries across 10 versions & 1 rubygems