Module: Decidim::Elections::Admin::TrusteesParticipatorySpacesHelper
- Includes:
- PaginateHelper
- Defined in:
- app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb
Overview
Custom helpers for trustees admin.
Instance Method Summary collapse
- #considered_icon_action_for(trustee) ⇒ Object
- #considered_label_action_for(trustee) ⇒ Object
- #trustee_current_participatory_space(trustee) ⇒ Object
Instance Method Details
#considered_icon_action_for(trustee) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 15 def considered_icon_action_for(trustee) if trustee_current_participatory_space(trustee).considered "close-line" else "check-line" end end |
#considered_label_action_for(trustee) ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 23 def considered_label_action_for(trustee) if trustee_current_participatory_space(trustee).considered t("trustees_participatory_spaces.actions.disable", scope: "decidim.elections.admin") else t("trustees_participatory_spaces.actions.enable", scope: "decidim.elections.admin") end end |
#trustee_current_participatory_space(trustee) ⇒ Object
11 12 13 |
# File 'app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 11 def trustee_current_participatory_space(trustee) trustee.trustees_participatory_spaces.find_by(participatory_space: current_participatory_space) end |