app/views/droom/people/_form.html.haml in droom-0.0.1 vs app/views/droom/people/_form.html.haml in droom-0.2.1
- old
+ new
@@ -1,40 +1,70 @@
-= form_for @person, :html => {:class => 'edit person', :remote => true, :data => {:type => :html}} do |f|
- %table.main.people
- %tr.person
- %td.icon
- %span
- %th.name
- = f.text_field :title, :class => 'title', :placeholder => t(:person_title)
- - if Droom.use_forenames
- = f.text_field :forename, :class => 'forename', :placeholder => t(:person_forename)
- = f.text_field :name, :class => 'name', :placeholder => t(:person_surname)
- - else
- = f.text_field :name, :class => 'name', :placeholder => t(:person_name)
- %br
- - if @person.new_record?
- = f.check_box :invite_on_creation, :class => 'invite'
- = f.label :invite_on_creation
- = f.check_box :admin_user
- = f.label :admin_user
+= form_for @person, :html => {:class => 'edit person'} do |f|
+ .image
+ .upload
+ - @person.build_image_upload unless @person.image_upload
+ = f.fields_for :image_upload do |iuf|
+ .uploadbox{:data => {:action => "upload", :url => cropper.uploads_path(:format => :js, :for => "person"), :scale => 2}}
+ = iuf.file_field :file, :class => 'file_upload', :accept => "image"
+ .img
+ - if @person.image_upload.persisted?
+ = link_to image_tag(@person.image.url(:cropped), :width => 260, :height => 260), cropper.edit_upload_url(@person.image_upload), :data => {:action => "recrop"}, :class => "recrop"
+ = link_to t(:detach_upload), '#', :class => 'detach'
+ .prompt
+ = link_to t(:click_to_upload), cropper.new_upload_url, :class => 'picker'
+ .droppable
+ .note
+ = t :drop_to_upload
+
+ - if Droom.use_forenames?
+ %p.name
+ = f.label :forename
+ %br
+ = f.text_field :forename, :required => true
+ %p.name
+ = f.label :name, "Surname"
+ %br
+ = f.text_field :name, :required => true
+
+ - else
+ %p.name
+ = f.label :name
+ %br
+ = f.text_field :name, :required => true
+
+ .contacts
+ %p.email
+ = f.label :email
+ %br
+ = f.text_field :email, :required => true
- %td.email
- = f.email_field :email, :class => 'email', :placeholder => t(:person_email)
- %td.phone
- = f.text_field :phone, :class => 'phone', :placeholder => t(:person_phone)
- / %td.address
- / = f.text_field :post_line1, :class => 'post_line1', :placeholder => t(:person_post_line1)
- / %br
- / = f.text_field :post_line2, :class => 'post_line2', :placeholder => t(:person_post_line2)
- / %br
- / = f.text_field :post_city, :class => 'post_city', :placeholder => t(:person_post_city)
- / %br
- / = f.text_field :post_region, :class => 'post_region', :placeholder => t(:person_post_region)
- / %br
- / = f.text_field :post_country, :class => 'post_country', :placeholder => t(:person_post_country)
- / %br
- / = f.text_field :post_code, :class => 'post_code', :placeholder => t(:person_post_code)
- %td.buttons
- = f.submit t(:save)
- = t :or
- = link_to t(:cancel), "/", :class => 'cancel'
-
\ No newline at end of file
+ %p.phone
+ = f.label :phone, :class => "optional"
+ %br
+ = f.text_field :phone
+
+ - if Droom.use_separate_mobile_number
+ %p.secondary
+ = f.label :mobile, :class => "optional"
+ %br
+ = f.text_field :mobile
+
+ - if admin?
+ - if @person.new_record?
+ %p.admin
+ = f.check_box :invite_on_creation, :class => 'invite'
+ = f.label :invite_on_creation
+ = f.check_box :admin_user
+ = f.label :admin_user
+
+ / %p.organisation
+ / = f.label :organisation_id, :class => "optional"
+ / %br
+ / = f.select :organisation_id, Droom::Organisation.for_selection
+
+ .buttons
+ - if current_user.is_person?(@person)
+ = f.submit t(:save_your_profile)
+ - else
+ = f.submit t(:save_person)
+ = t :or
+ = link_to t(:cancel), '#', :class => 'cancel'