Module: PuppetclassesAndEnvironmentsHelper

Included in:
EnvironmentsHelper, PuppetclassesHelper
Defined in:
app/helpers/puppetclasses_and_environments_helper.rb

Instance Method Summary collapse

Instance Method Details

#class_update_text(pcs, env) ⇒ Object


2
3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/puppetclasses_and_environments_helper.rb', line 2

def class_update_text pcs, env
  if pcs.empty?
    _("Empty environment")
  elsif pcs == ["_destroy_"]
    _("Deleted environment")
  elsif pcs.delete "_destroy_"
    _("Deleted environment %{env} and %{pcs}") % { :env => env, :pcs => pcs.to_sentence }
  else
    pretty_print(pcs.is_a?(Hash) ? pcs.keys : pcs)
  end
end

#import_proxy_select(hash) ⇒ Object


14
15
16
17
18
19
20
# File 'app/helpers/puppetclasses_and_environments_helper.rb', line 14

def import_proxy_select hash
  select_action_button( _('Import'),
    SmartProxy.puppet_proxies.map do |proxy|
      display_link_if_authorized(_("Import from %s") % proxy.name, hash.merge(:proxy => proxy), :class=>'btn')
    end.flatten
  )
end