From 05dc29feed8f7ac285fffeea9e687a53d9d7da87 Mon Sep 17 00:00:00 2001
From: Alex Shulgin <ash@commandprompt.com>
Date: Thu, 11 Aug 2011 10:48:16 +0300
Subject: [PATCH 2/2] Fixed clickable checkbox labels (clear id attr on the hidden field.)

---
 app/helpers/custom_fields_helper.rb |    2 +-
 app/helpers/settings_helper.rb      |    4 ++--
 app/views/activities/index.html.erb |    2 +-
 app/views/versions/index.html.erb   |    2 +-
 app/views/workflows/edit.rhtml      |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 3028cd4..962214d 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -44,7 +44,7 @@ module CustomFieldsHelper
     when "text"
       text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
     when "bool"
-      hidden_field_tag(field_name, '0') + check_box_tag(field_name, '1', custom_value.true?, :id => field_id)
+      hidden_field_tag(field_name, '0', :id => nil) + check_box_tag(field_name, '1', custom_value.true?, :id => field_id)
     when "list"
       blank_option = custom_field.is_required? ?
                        (custom_field.default_value.blank? ? "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" : '') : 
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index e72895e..081e85a 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -43,7 +43,7 @@ module SettingsHelper
     setting_values = [] unless setting_values.is_a?(Array)
 
     setting_label(setting, options) +
-      hidden_field_tag("settings[#{setting}][]", '') +
+      hidden_field_tag("settings[#{setting}][]", '', :id => nil) +
       choices.collect do |choice|
         text, value = (choice.is_a?(Array) ? choice : [choice, choice])
         content_tag(
@@ -70,7 +70,7 @@ module SettingsHelper
 
   def setting_check_box(setting, options={})
     setting_label(setting, options) +
-      hidden_field_tag("settings[#{setting}]", 0) +
+      hidden_field_tag("settings[#{setting}]", 0, :id => nil) +
         check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
   end
 
diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb
index a2748cc..fd4b13f 100644
--- a/app/views/activities/index.html.erb
+++ b/app/views/activities/index.html.erb
@@ -48,7 +48,7 @@
 <br />
 <% end %></p>
 <% if @project && @project.descendants.active.any? %>
-	  <%= hidden_field_tag 'with_subprojects', 0 %>
+	  <%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
     <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
 <% end %>
 <%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index d0c5dca..cbb3f80 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -37,7 +37,7 @@
 <br />
 <label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label>
 <% if @project.descendants.active.any? %>
-	<%= hidden_field_tag 'with_subprojects', 0 %>
+	<%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
   <br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
 <% end %>
 <p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
diff --git a/app/views/workflows/edit.rhtml b/app/views/workflows/edit.rhtml
index 575500f..07040df 100644
--- a/app/views/workflows/edit.rhtml
+++ b/app/views/workflows/edit.rhtml
@@ -12,7 +12,7 @@
   <label><%=l(:label_tracker)%>:</label>
 	<%= select_tag 'tracker_id', options_from_collection_for_select(@trackers, "id", "name", @tracker && @tracker.id) %>
   
-  <%= hidden_field_tag 'used_statuses_only', '0' %>
+  <%= hidden_field_tag 'used_statuses_only', '0', :id => nil %>
   <label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label>
 </p>
 <p>
-- 
1.7.4.1

