Module: Decidim::CtaButtonHelper
- Included in:
- Decidim::ContentBlocks::HeroCell
- Defined in:
- app/helpers/decidim/cta_button_helper.rb
Overview
A Helper to render the Call To Action button.
Instance Method Summary collapse
-
#cta_button ⇒ Object
Renders the Call To Action button.
-
#cta_button_path ⇒ Object
Finds the CTA button path to reuse it in other places.
Instance Method Details
#cta_button ⇒ Object
Renders the Call To Action button. Link and text can be configured per organization.
8 9 10 11 12 |
# File 'app/helpers/decidim/cta_button_helper.rb', line 8 def = translated_attribute(current_organization.).presence || t("decidim.pages.home.hero.participate") link_to , , class: "hero-cta button expanded large button--sc", title: t("decidim.pages.home.hero.participate_title") end |
#cta_button_path ⇒ Object
Finds the CTA button path to reuse it in other places.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/decidim/cta_button_helper.rb', line 15 def if current_organization..present? current_organization. elsif Decidim::ParticipatoryProcess.where(organization: current_organization).published.any? decidim_participatory_processes.participatory_processes_path elsif current_user decidim.account_path elsif current_organization.sign_up_enabled? decidim.new_user_registration_path else decidim.new_user_session_path end end |