Module: Decidim::Accountability::ApplicationHelper
- Includes:
- Comments::CommentsHelper, MapHelper, PaginateHelper
- Included in:
- HighlightedResultsForComponentCell, ProjectCell, ResultHistoryCell, ResultLCell, StatusCell
- Defined in:
- app/helpers/decidim/accountability/application_helper.rb
Overview
Custom helpers, scoped to the accountability engine.
Instance Method Summary collapse
- #apply_accountability_pack_tags ⇒ Object
- #component_name ⇒ Object
- #display_percentage(number) ⇒ Object
Instance Method Details
#apply_accountability_pack_tags ⇒ Object
22 23 24 25 |
# File 'app/helpers/decidim/accountability/application_helper.rb', line 22 def append_stylesheet_pack_tag("decidim_accountability", media: "all") append_javascript_pack_tag("decidim_accountability") end |
#component_name ⇒ Object
18 19 20 |
# File 'app/helpers/decidim/accountability/application_helper.rb', line 18 def component_name (defined?(current_component) && translated_attribute(current_component&.name).presence) || t("decidim.components.accountability.name") end |
#display_percentage(number) ⇒ Object
12 13 14 15 16 |
# File 'app/helpers/decidim/accountability/application_helper.rb', line 12 def display_percentage(number) return if number.blank? number_to_percentage(number, precision: 1, strip_insignificant_zeros: true, locale: I18n.locale) end |