Sha256: 0985625c94482b5e5023475cca9296e0762783ab60e36df05ececd75ad6223d2

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This module includes helpers to show admin terms of service
    module AdminTermsHelper
      def admin_terms_of_service_body
        decidim_sanitize_admin(translated_attribute(current_organization.admin_terms_of_service_body)).html_safe
      end

      def announcement_body
        if current_user.admin_terms_accepted?
          t("accept.success", scope: "decidim.admin.admin_terms_of_service")
        else
          t("required_review.callout", scope: "decidim.admin.admin_terms_of_service")
        end
      end

      def button_to_accept_admin_terms
        button_to(
          t("decidim.admin.admin_terms_of_service.actions.accept"),
          admin_terms_accept_path,
          class: "button button__sm button__secondary success",
          method: :put
        )
      end

      def button_to_refuse_admin_terms
        link_to(
          t("decidim.admin.admin_terms_of_service.actions.refuse"),
          decidim.root_path,
          class: "button button__sm button__secondary clear",
          data: {
            confirm: t("actions.are_you_sure", scope: "decidim.admin.admin_terms_of_service")
          }
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.28.4 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.29.0 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.28.3 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.29.0.rc4 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.29.0.rc3 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.29.0.rc2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.29.0.rc1 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.28.2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.28.1 app/helpers/decidim/admin/admin_terms_helper.rb