= editing_mode
= simple_form_for @person, :html => {:multipart => true} do |f|
= f.error_notification
.form-group
= f.input :given_name, as: :string, label: 'First name'
.form-group
= f.input :surname, as: :string, required: false
.form-group
#memberships
%h2.line-above Roles
= f.fields_for :memberships do |membership_f|
= render partial: 'membership_fields', locals: { membership_f: membership_f }
= link_to 'Add new role', add_membership_people_path(id: @person.to_param), id: 'add_membership'
.form-group
%h2.line-above Contact details
%label.form-label-bold{ for: :person_location } Location of work
%p.form-hint= info_text('location_hint')
= f.input :location, as: :string, label: false
.phone_numbers{ style: ('display:none' if @person.no_phone)}
.form-group
= f.input :primary_phone_number, as: :string
.form-group
= f.input :secondary_phone_number, as: :string, label: 'Any other phone number'
.form-checkbox
= f.input :no_phone, as: :boolean, label: 'No phone number'
.form-group
= f.input :email, as: :string, label: 'Email address'
.form-group
%h3.line-above
%label{ for: :person_description } Notes
%p.form-hint= info_text('notes_field_hint')
= f.input :description, label: false, input_html: { class: 'wider' }
.form-group
%h3 Working days
.form-checkbox
- Peoplefinder::Person::DAYS_WORKED.each do |day|
= f.input day, as: :boolean, label: day_name(day)
.form-group
%h3.line-above Photograph
%p.form-hint= info_text('photo_upload_hint')
%p.form-hint= info_text('photo_size_hint')
= f.input :image, as: :file, label: false
= image_tag @person.image.medium, class: 'preview'
%p
- if @person.image?
= link_to 'Crop image', edit_person_image_path(@person)
.form-group
= f.button :submit
.cancel
= link_to 'Cancel', @person.new_record? ? :back : @person