commit 159a7a62755e8a1a2831e27918c0145cca4cacb4
Author: Ohad Levy <ohadlevy@gmail.com>
Date:   Thu Jul 12 17:41:26 2012 +0300

    [UI] - convert all bulk operations into buttons

diff --git a/app/helpers/hosts_helper.rb b/app/helpers/hosts_helper.rb
index d4899ea84..dccdd4d2c 100644
--- a/app/helpers/hosts_helper.rb
+++ b/app/helpers/hosts_helper.rb
@@ -73,19 +73,22 @@ module HostsHelper
 
   def multiple_actions_select
     actions = [
-      ['Select Actions', ''],
-      ['Change Group', select_multiple_hostgroup_hosts_path],
-      ['Change Environment', select_multiple_environment_hosts_path],
-      ['Edit Parameters', multiple_parameters_hosts_path],
-      ['Delete Hosts', multiple_destroy_hosts_path],
-      ['Disable Notifications', multiple_disable_hosts_path],
-      ['Enable Notifications', multiple_enable_hosts_path],
+      ['Change Group', select_multiple_hostgroup_hosts_path, 'pencil'],
+      ['Change Environment', select_multiple_environment_hosts_path, 'chevron-right'],
+      ['Edit Parameters', multiple_parameters_hosts_path, 'edit'],
+      ['Delete Hosts', multiple_destroy_hosts_path, 'trash'],
+      ['Disable Notifications', multiple_disable_hosts_path, 'eye-close'],
+      ['Enable Notifications', multiple_enable_hosts_path, 'bullhorn'],
     ]
-    actions.insert(1, ['Build Hosts', multiple_build_hosts_path]) if SETTINGS[:unattended]
-    actions <<  ['Run Puppet', multiple_puppetrun_hosts_path] if Setting[:puppetrun]
+    actions.insert(1, ['Build Hosts', multiple_build_hosts_path, 'fast-forward']) if SETTINGS[:unattended]
+    actions <<  ['Run Puppet', multiple_puppetrun_hosts_path, 'play'] if Setting[:puppetrun]
+
+    content_tag :span, :id => 'submit_multiple', :class => 'fl' do
+      actions.map do |action|
+        link_to(icon_text(action[2]), action[1], :title => action[0])
+      end.join(' ').html_safe
+    end
 
-    select_tag "Multiple Actions", options_for_select(actions), :id => "Submit_multiple",
-      :class => "medium", :title => "Perform Actions on multiple hosts"
   end
 
   def date ts=nil
diff --git a/app/views/hosts/multiple_parameters.html.erb b/app/views/hosts/multiple_parameters.html.erb
index 5d8e6462f..48c2c7426 100644
--- a/app/views/hosts/multiple_parameters.html.erb
+++ b/app/views/hosts/multiple_parameters.html.erb
@@ -6,12 +6,7 @@
 <% else -%>
   <%= form_tag update_multiple_parameters_hosts_path({:host_ids => params[:host_ids]}) do %>
     <% for param in @parameters %>
-      <div class="clearfix">
-        <%= label_tag :name, param.name %>
-        <div class=input>
-          <%= text_field :name, param.name, :class => "input-xxlarge" %>
-        </div>
-      </div>
+      <%= text_field :name, param.name, :class => "input-xxlarge", :placeholder => param.name %>
     <% end %>
   <% end %>
 <% end %>
diff --git a/public/javascripts/host_checkbox.js b/public/javascripts/host_checkbox.js
index fa3b84a01..a0b74c094 100644
--- a/public/javascripts/host_checkbox.js
+++ b/public/javascripts/host_checkbox.js
@@ -39,12 +39,12 @@ function readFromCookie() {
 }
 
 function toggle_actions() {
-  var dropdown = $("#Submit_multiple");
+  var dropdown = $("#submit_multiple a");
   if ($.foremanSelectedHosts.length == 0) {
-    dropdown.addClass("disabled");
-    dropdown.attr('disabled', 'disabled')
+    dropdown.addClass("disabled hide");
+    dropdown.attr('disabled', 'disabled');
   } else {
-    dropdown.removeClass("disabled");
+    dropdown.removeClass("disabled hide");
     dropdown.removeAttr('disabled');
   }
 }
@@ -102,12 +102,19 @@ function toggle_multiple_ok_button(elem){
 
 // updates the form URL based on the action selection
 $(function() {
-  $('#Submit_multiple').change(function(){
-    if ($.foremanSelectedHosts.length == 0 || $(this).val()==''){ return false }
-    var title =  $('#Submit_multiple option:selected').text() + " - The following hosts are about to be changed";
+  $('#submit_multiple a').click(function(){
+    if ($.foremanSelectedHosts.length == 0) { return false }
+    var title = $(this).attr('data-original-title') + ' - The following hosts are about to be changed';
+    var url = $(this).attr('href') + "?" + $.param({host_ids: $.foremanSelectedHosts});
     $('#confirmation-modal .modal-header h3').text(title);
     $('#confirmation-modal .modal-body').empty().append("<img class='modal-loading' src='/images/spinner.gif'>");
     $('#confirmation-modal').modal({show: "true", backdrop: "static"});
+    $("#confirmation-modal .modal-body").load(url + " #content",
+        function(response, status, xhr) {
+          $("#loading").hide();
+          $('#submit_multiple').val('');
+        });
+    return false;
   });
 
   $('#confirmation-modal .btn-primary').click(function(){
@@ -119,14 +126,6 @@ $(function() {
     $('#confirmation-modal').modal('hide');
   });
 
-  $("#confirmation-modal").bind('shown', function () {
-    var url = $('#Submit_multiple').val() + "?" + $.param({host_ids: $.foremanSelectedHosts});
-    $("#confirmation-modal .modal-body").load(url + " #content",
-                                              function(response, status, xhr) {
-                                                $("#loading").hide();
-                                                $('#Submit_multiple').val('');
-                                              });
-  });
 });
 
 function update_counter(id) {
diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css
index e34b84f61..abb8c2360 100644
--- a/public/stylesheets/style.css
+++ b/public/stylesheets/style.css
@@ -310,7 +310,6 @@ select{padding: initial;}
 }
 
 table .span0{float:none;width:20px;margin-left:0;}
-#Submit_multiple{ margin-bottom: 0px !important;}
 
 .inputs-list{
 margin-left:0;margin-bottom:18px;list-style:none;display: inline;
