Sha256: d579d2fee7305b58630e6b0d6562eb3bdafb95bae01bc8eea1510ddf5c310b3f

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

module DiscoversHelper

  def disc_report_column(record)
    record.last_report? ? (_("%s ago") % time_ago_in_words(record.last_report.getlocal)) : ""
  end

  def discovers_title_actions(host)
    title_actions(
      button_group(
        link_to(_("Provision"), hash_for_edit_discover_path(:id => host), :class => 'btn-primary')
      ),
      button_group(
        link_to(_("Refresh facts"), hash_for_refresh_facts_discover_path(:id => host))
      ),
      button_group(
        link_to(_("Delete"), hash_for_discover_path(:id => host),
                :class => "btn btn-danger", :confirm => _('Are you sure?'), :method => :delete)
      )
    )
  end

  def multiple_discovers_actions_select
    actions = [[_('Delete hosts'), multiple_destroy_discovers_path]]
    actions <<  [_('Assign Organization'), select_multiple_organization_discovers_path] if SETTINGS[:organizations_enabled]
    actions <<  [_('Assign Location'), select_multiple_location_discovers_path] if SETTINGS[:locations_enabled]

    select_action_button( _("Select Action"), {:id => 'submit_multiple'},
      actions.map do |action|
        link_to(action[0] , action[1], :'data-dialog-title' => _("%s - The following hosts are about to be changed") % action[0])
      end.flatten
    )

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_discovery-1.3.0.rc2 app/helpers/discovers_helper.rb
foreman_discovery-1.3.0.rc1 app/helpers/discovers_helper.rb