Sha256: 7e88bbf54dc0a553082216806871a4657da3cc4f094d65166ce12837545da8ba

Contents?: true

Size: 1.1 KB

Versions: 32

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This module includes helpers to show Admin Terms of Use
    module AdminTermsHelper
      def admin_terms_of_use_body
        current_organization.admin_terms_of_use_body.symbolize_keys[I18n.locale].html_safe
      end

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

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

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
decidim-admin-0.26.10 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.9 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.5 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.8 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.4 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.3 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.7 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.5 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.1 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.4 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.0 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.3 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.0.rc2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.27.0.rc1 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.1 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.0 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.0.rc2 app/helpers/decidim/admin/admin_terms_helper.rb
decidim-admin-0.26.0.rc1 app/helpers/decidim/admin/admin_terms_helper.rb