_manage_person_fields.html.erb
2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<%= labelled_form_for(:environment, :url => {:action => 'manage_person_fields'}) do |f| %>
<table id='person_fields_conf'>
<tr>
<th><%= _('Field') %></th>
<th><%= _('Active') %></th>
<th><%= _('Required') %></th>
<th><%= _('Display on signup?') %></th>
</tr>
<tr class='manage-fields-batch-actions'>
<td>
<%= _("Check/Uncheck All")%>
</td>
<td>
<input type="checkbox" id="person_active" />
</td>
<td>
<input type="checkbox" id="person_required" />
</td>
<td>
<input type="checkbox" id="person_signup" />
</td>
</tr>
<% @person_fields.each do |field| %>
<tr>
<td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td>
<td>
<%= hidden_field_tag "person_fields[#{field}][active]", false %>
<%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "active_action(this, 'person_fields[#{field}][required]', 'person_fields[#{field}][signup]')" %>
</td>
<td>
<%= hidden_field_tag "person_fields[#{field}][required]", false %>
<%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "required_action('person_fields[#{field}][active]','person_fields[#{field}][required]', 'person_fields[#{field}][signup]')" %>
</td>
<td>
<%= hidden_field_tag "person_fields[#{field}][signup]", false %>
<%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "signup_action('person_fields[#{field}][active]','person_fields[#{field}][required]', 'person_fields[#{field}][signup]')" %>
</td>
</tr>
<% end %>
</table>
<script type='text/javascript'>// <!--
var trs = jQuery('#person_fields_conf tr');
var tr, td2;
for ( var i=2; tr=trs[i]; i++ ) {
if ( td2 = tr.getElementsByTagName('td')[1] ) {
td2.getElementsByTagName('input')[1].onclick();
}
}
// -->
</script>
<div>
<%= button_bar do %>
<%= submit_button('save', _('Save changes'), :id=>"save_person_fields") %>
<%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
<% end %>
</div>
<br>
<% end %>
<%= render :partial => "manage_custom_fields", :locals => {:customized_type => Person} %>