app/views/manage/questionnaires/_form.html.haml in hackathon_manager-0.1.0 vs app/views/manage/questionnaires/_form.html.haml in hackathon_manager-0.2.0

- old
+ new

@@ -1,6 +1,6 @@ -%div{class:'form-container'} +.form-container = simple_form_for @questionnaire, url: url_for(action: @questionnaire.new_record? ? "create" : "update", controller: "questionnaires"), html: { "data-validate" => "form" } do |f| - if f.error_notification.present? = f.error_notification @@ -8,11 +8,13 @@ #disclaimer %p= flash[:notice] .form-inputs %fieldset - %legend Provided by My MLH + - if @questionnaire&.user&.provider == 'mlh' + %legend Provided by My MLH + %br = f.input :first_name, placeholder: "Joe", input_html: { "data-validate" => "presence" }, label: "First Name", autofocus: true = f.input :last_name, placeholder: "Smith", input_html: { "data-validate" => "presence" }, label: "Last Name" = f.input :email, placeholder: "joe@example.com", input_html: { "data-validate" => "presence email", value: @questionnaire.user.try(:email) }, required: true = f.input :phone, placeholder: "(123) 456-7890", input_html: { "data-validate" => "presence" } = f.input :date_of_birth, start_year: Date.today.year - 18, end_year: Date.today.year - 90, order: [:month, :day, :year], input_html: { "data-validate" => "presence" } @@ -24,10 +26,11 @@ = f.input :gender, placeholder: "Female, Male, Non-Binary, Prefer not to say, other", input_html: { "data-validate" => "presence" } = f.input :dietary_restrictions, placeholder: "Allergies, medical assistance, etc. (optional)", label: "Health Restrictions" = f.input :special_needs, placeholder: "Any special needs or requests (optional)", label: "Special needs" .form-inputs + %br = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" } = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" } = f.input :resume, as: :deletable_attachment, hint: "Must be < 2MB", input_html: { "data-validate" => "file-max-size file-content-type", "data-validate-file-max-size" => "2097152", "data-validate-file-content-type" => "application/pdf" }, label: "Resume (PDF)" @@ -48,7 +51,7 @@ %p Please read the %a{href:"/assets/BrickHack_ReleaseAgreement.pdf", target:"_blank"} BrickHack Agreement = f.input :agreement_accepted, as: :formatted_boolean, label: "I accept the BrickHack Agreement", input_html: { "data-validate" => "presence" } - %div{class:'center'} + .center = f.button :submit, value: ( @questionnaire.new_record? ? 'Create' : 'Save' )