Sha256: dc72416899d449ea10e7e23b32ef1e7ece4087149fa2480a9b1a0513057558e0
Contents?: true
Size: 655 Bytes
Versions: 14
Compression:
Stored size: 655 Bytes
Contents
# frozen_string_literal: true module Decidim # This cell renders an announcement # the `model` is spected to be a Hash with two keys: # `announcement` is mandatory, its the message to show # `callout_class` is optional, the css class modifier # # { # announcement: { ... }, # callout_class: "warning" # } # class AnnouncementCell < Decidim::ViewModel include Decidim::SanitizeHelper def show return unless announcement.presence render :show end private def callout_class model[:callout_class] ||= "secondary" end def announcement model[:announcement] end end end
Version data entries
14 entries across 14 versions & 1 rubygems