Module: ForemanWreckingball::StatusesHelper

Defined in:
app/helpers/foreman_wreckingball/statuses_helper.rb

Instance Method Summary collapse

Instance Method Details

#status_actions(host_association, owned_only, supports_remediate) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/foreman_wreckingball/statuses_helper.rb', line 5

def status_actions(host_association, owned_only, supports_remediate)
  actions = []
  actions << display_link_if_authorized(_('Refresh'),
                                        hash_for_refresh_status_dashboard_hosts_path,
                                        title: _('Refresh Data'),
                                        method: :put)
  if supports_remediate
    actions << display_link_if_authorized(_('Remediate All'),
                                          hash_for_schedule_remediate_hosts_path,
                                          'data-host-association': host_association,
                                          'data-owned-only': owned_only,
                                          onClick: 'show_modal(this); return false;')
  end
  actions.reject(&:blank?)
end