Module: Decidim::Admin::AdminTermsHelper
- Defined in:
- app/helpers/decidim/admin/admin_terms_helper.rb
Overview
This module includes helpers to show Admin Terms of Use
Instance Method Summary collapse
- #admin_terms_announcement_args ⇒ Object
- #admin_terms_of_use_body ⇒ Object
- #announcement_body ⇒ Object
- #button_to_accept_admin_terms ⇒ Object
- #button_to_refuse_admin_terms ⇒ Object
Instance Method Details
#admin_terms_announcement_args ⇒ Object
11 12 13 14 15 16 |
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 11 def admin_terms_announcement_args { callout_class: current_user.admin_terms_accepted? ? "success" : "warning", announcement: announcement_body } end |
#admin_terms_of_use_body ⇒ Object
7 8 9 |
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 7 def admin_terms_of_use_body current_organization.admin_terms_of_use_body.symbolize_keys[I18n.locale].html_safe end |
#announcement_body ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 18 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 |
#button_to_accept_admin_terms ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 26 def ( t("decidim.admin.admin_terms_of_use.actions.accept"), admin_terms_accept_path, class: "button success", method: :put ) end |
#button_to_refuse_admin_terms ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'app/helpers/decidim/admin/admin_terms_helper.rb', line 35 def 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 |