Module: Decidim::Admin::AdminTermsHelper

Defined in:
app/helpers/decidim/admin/admin_terms_helper.rb

Overview

This module includes helpers to show admin terms of service

Instance Method Summary collapse

Instance Method Details

#admin_terms_of_service_bodyObject



7
8
9
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 7

def admin_terms_of_service_body
  decidim_sanitize_admin(translated_attribute(current_organization.admin_terms_of_service_body)).html_safe
end

#announcement_bodyObject



11
12
13
14
15
16
17
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 11

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

#button_to_accept_admin_termsObject



19
20
21
22
23
24
25
26
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 19

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

#button_to_refuse_admin_termsObject



28
29
30
31
32
33
34
35
36
37
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 28

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