Sha256: fbd50e59c52f11609f3cec58d7a9378336a1f221473b14b9542b2aa997dcdb1a
Contents?: true
Size: 1.02 KB
Versions: 37
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Decidim # This cell renders specific _partials_ for the `terms_and_conditions` StaticPage # the `model` is the partial to render # - :announcement, the TOS updated announcement when redirected to the TOS page. # - :sticky_form, the Accept updated TOS form in the TOS page. # - :refuse_btn_modal, the Modal with info when refusing the updated TOS. class TosPageCell < Decidim::ViewModel include Decidim::SanitizeHelper include Cell::ViewModel::Partial delegate :current_user, to: :controller, prefix: false def show return if model.nil? return unless current_user return if current_user.tos_accepted? render model end private def announcement { title: t("required_review.title", scope: "decidim.pages.terms_and_conditions"), body: t("required_review.body", scope: "decidim.pages.terms_and_conditions") } end def announcement_options { callout_class: "warning" } end end end
Version data entries
37 entries across 37 versions & 1 rubygems