_person_form.rhtml
3.71 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
<% @person ||= @profile %>
<%= required f.text_field(:name) %>
<% optional_field(@person, 'nickname') do %>
<%= f.text_field(:nickname, :maxlength => 16, :size => 30) %>
<div>
<small><%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %></small>
</div>
<% end %>
<%= optional_field(@person, 'description', f.text_area(:description, :rows => 5)) %>
<%= optional_field(@person, 'preferred_domain', select_preferred_domain(:profile_data)) %>
<%= optional_field(@person, 'contact_information', f.text_field(:contact_information)) %>
<%= optional_field(@person, 'contact_phone', labelled_form_field(_('Home phone'), text_field(:profile_data, :contact_phone))) %>
<%= optional_field(@person, 'cell_phone', f.text_field(:cell_phone)) %>
<%= optional_field(@person, 'comercial_phone', f.text_field(:comercial_phone)) %>
<%= optional_field(@person, 'sex', f.radio_group(:profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ])) %>
<%= optional_field(@person, 'birth_date', labelled_form_field(_('Birth date'), '<div class="select-birth-date">' + pick_date(:profile_data, :birth_date, {:start_year => (Date.today.year - 100), :end_year => (Date.today.year - 5)}) + '</div>')) %>
<%= optional_field(@person, 'nationality', f.text_field(:nationality)) %>
<%= optional_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
<%= optional_field(@person, 'state', f.text_field(:state)) %>
<%= optional_field(@person, 'city', f.text_field(:city)) %>
<%= optional_field(@person, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
<%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>
<% optional_field(@person, 'schooling') do %>
<div class="formfieldline">
<label class='formlabel' for='profile_data_schooling'><%= _('Schooling') %></label>
<div class="formfield type-select">
<%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %>
<%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %>
</div>
</div>
<% end %>
<script type='text/javascript'>
function toggle_text_field(id, span_id) {
if ($(id).value == "Others") {
$(span_id).show(); return false;
} else {
$(span_id).hide(); return false;
}
}
</script>
<%= optional_field(@person, 'formation', select_area(_('Education'), 'profile_data', 'formation', {:class => 'type-select-full-line'})) %>
<span id='profile_data_custom_formation_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.formation) %> >
<%= optional_field(@person, 'custom_formation', f.text_field(:custom_formation)) %>
</span>
<%= observe_field 'profile_data_formation', :function =>'toggle_text_field("profile_data_formation", "profile_data_custom_formation_span")' %>
<%= optional_field(@person, 'area_of_study', select_area(_('Area of study'), 'profile_data', 'area_of_study', {:class => 'type-select-full-line'})) %>
<span id='profile_data_custom_area_of_study_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.area_of_study) %> >
<%= optional_field(@person, 'custom_area_of_study', f.text_field(:custom_area_of_study)) %>
</span>
<%= observe_field 'profile_data_area_of_study', :function =>'toggle_text_field("profile_data_area_of_study", "profile_data_custom_area_of_study_span")' %>
<%= optional_field(@person, 'professional_activity', f.text_field(:professional_activity)) %>
<%= optional_field(@person, 'organization', f.text_field(:organization)) %>
<%= optional_field(@person, 'organization_website', f.text_field(:organization_website)) %>