=f.alert_message "Please fix the errors below." %div{class: 'row glass-look'} .col-md-8.col-md-offset-2 .panel.panel-primary .panel-heading .panel-title %h2 Your Details .panel-body .row .col-md-6 %fieldset %legend Email & Name = f.check_box :permit_emails = f.email_field :email -if f.object.new_record? && cannot?(:maintain,User) = f.password_field :password = f.password_field :password_confirmation -if can? :maintain, User =f.check_box :email_is_valid = f.select :title,User::TITLES,include_blank: true - [:first_name,:middle_name,:surname].each do |fld| = f.text_field fld -if can?(:maintain,User) = f.select :member_type,User::TYPES = f.select :member_status,User::STATUSES = f.collection_check_boxes :role_ids, Role.all,:id,:name .col-md-6 %fieldset %legend Address = f.check_box :permit_direct_mails -[:addr1,:addr2,:addr3,:town,:county,:postcode].each do |fld| = f.text_field fld .form-group %label{class: 'control-label',for: 'user_country'} Country = f.country_select :country,['United Kingdom','France','Germany','Spain','Greece','Italy'],{},{class: 'form-control'} -if f.object.new_record? %div{class: 'row glass-look'} .col-md-8.col-md-offset-2 .panel.panel-primary .panel-heading .panel-title %h2 Data protection confirmation .panel-body = f.check_box :accepted_t_and_c,label: 'I agree that the personal details given on this form will be held on computer systems and will be used only for the administration of Fusion the Open University Physics and Astronomy Society' -if can?(:maintain,User) %div{class: 'row glass-look'} .col-md-12 -if f.object.subscriptions.count == 0 # we had a problem where new records would get 2 subscriptions if there was an error on first form submit - f.object.subscriptions.build .row .col-md-4 -bs_panel('Subscription','primary') do = f.fields_for :subscriptions do |fs| = fs.select :subs_type,Subscription::TYPES,label: 'Type' = fs.date_select :start_date = fs.select :subs_years,Subscription::CURRENT_PERIODS,label: 'Years' = fs.select :amount_paid,Subscription::CURRENT_FEES,label: 'Amount' -else = render 'subscriptions' .row.glass-look .col-md-4.col-md-offset-4 = f.submit 'Press this to submit the form to and save your changes', class: 'btn-lg btn-success center-block'