Module: Decidim::Elections::Admin::TrusteesParticipatorySpacesHelper

Defined in:
decidim-elections/app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb

Overview

Custom helpers for trustees admin.

Instance Method Summary collapse

Instance Method Details

#considered_icon_action_for(trustee) ⇒ Object


13
14
15
16
17
18
19
# File 'decidim-elections/app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 13

def considered_icon_action_for(trustee)
  if trustee_current_participatory_space(trustee).considered
    "x"
  else
    "check"
  end
end

#considered_label_action_for(trustee) ⇒ Object


21
22
23
24
25
26
27
# File 'decidim-elections/app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 21

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


9
10
11
# File 'decidim-elections/app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb', line 9

def trustee_current_participatory_space(trustee)
  trustee.trustees_participatory_spaces.find_by(participatory_space: current_participatory_space)
end