Commit a4d55f5c48b990e09ea425e87b18e9954a2f4049

Authored by Antonio Terceiro
1 parent 7e84ddcd

Fix field checkboxes

The hidden fields must come before the check boxes
app/views/features/_manage_community_fields.rhtml
@@ -14,16 +14,16 @@ @@ -14,16 +14,16 @@
14 <td><label for="community_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> 14 <td><label for="community_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td>
15 15
16 <td> 16 <td>
17 - <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %>  
18 <%= hidden_field_tag "community_fields[#{field}][active]", false %> 17 <%= hidden_field_tag "community_fields[#{field}][active]", false %>
  18 + <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %>
19 </td> 19 </td>
20 <td> 20 <td>
21 - <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %>  
22 <%= hidden_field_tag "community_fields[#{field}][required]", false %> 21 <%= hidden_field_tag "community_fields[#{field}][required]", false %>
  22 + <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %>
23 </td> 23 </td>
24 <td> 24 <td>
25 - <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %>  
26 <%= hidden_field_tag "community_fields[#{field}][signup]", false %> 25 <%= hidden_field_tag "community_fields[#{field}][signup]", false %>
  26 + <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %>
27 </td> 27 </td>
28 28
29 </tr> 29 </tr>
app/views/features/_manage_enterprise_fields.rhtml
@@ -14,16 +14,16 @@ @@ -14,16 +14,16 @@
14 14
15 <td><label for="enterprise_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> 15 <td><label for="enterprise_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td>
16 <td> 16 <td>
17 - <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %>  
18 <%= hidden_field_tag "enterprise_fields[#{field}][active]", false %> 17 <%= hidden_field_tag "enterprise_fields[#{field}][active]", false %>
  18 + <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %>
19 </td> 19 </td>
20 <td> 20 <td>
21 - <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %>  
22 <%= hidden_field_tag "enterprise_fields[#{field}][required]", false %> 21 <%= hidden_field_tag "enterprise_fields[#{field}][required]", false %>
  22 + <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %>
23 </td> 23 </td>
24 <td> 24 <td>
25 - <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %>  
26 <%= hidden_field_tag "enterprise_fields[#{field}][signup]", false %> 25 <%= hidden_field_tag "enterprise_fields[#{field}][signup]", false %>
  26 + <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %>
27 </td> 27 </td>
28 28
29 </tr> 29 </tr>
app/views/features/_manage_person_fields.rhtml
@@ -13,16 +13,16 @@ @@ -13,16 +13,16 @@
13 <tr> 13 <tr>
14 <td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> 14 <td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td>
15 <td> 15 <td>
16 - <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %>  
17 <%= hidden_field_tag "person_fields[#{field}][active]", false %> 16 <%= hidden_field_tag "person_fields[#{field}][active]", false %>
  17 + <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %>
18 </td> 18 </td>
19 <td> 19 <td>
20 - <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %>  
21 <%= hidden_field_tag "person_fields[#{field}][required]", false %> 20 <%= hidden_field_tag "person_fields[#{field}][required]", false %>
  21 + <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %>
22 </td> 22 </td>
23 <td> 23 <td>
24 - <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %>  
25 <%= hidden_field_tag "person_fields[#{field}][signup]", false %> 24 <%= hidden_field_tag "person_fields[#{field}][signup]", false %>
  25 + <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %>
26 </td> 26 </td>
27 </tr> 27 </tr>
28 <% end %> 28 <% end %>