.row .col-sm-12 .box .box-header.dark-background .box-content = form_for [:admin, @registration], html: { class: 'form form-horizontal'} do |f| = form_group(@registration, :user_id) do %label.col-md-2.control-label{for: :user_id} User .col-md-5 = f.collection_select :user_id, User.all, :id, :email, { prompt: true }, class: 'form-control' = form_group(@registration, :reseller_id) do %label.col-md-2.control-label{for: :reseller_id} Reseller .col-md-5 = f.collection_select :reseller_id, User.resellers, :id, :company_and_active_status, { prompt: true }, class: 'form-control' = form_group(@registration, :product_id) do %label.col-md-2.control-label{for: :product_id} Product .col-md-5 = f.collection_select :product_id, Product.all, :id, :name, { prompt: true }, class: 'form-control' .product-variations = form_group(@registration, :variation_id) do %label.col-md-2.control-label{for: :variation_id} Variation .col-md-5 = f.collection_select :variation_id, [], :id, :name, { prompt: true }, class: 'form-control' .product-options = f.hidden_field :options_array, multiple: true, value: nil - unless @registration.new_record? = form_group(@registration, :options_array) do %label.col-md-2.control-label{for: :options_array} Options .col-md-10 - @registration.product.options_array.each do |opt| %label.checkbox-inline = f.check_box :options_array, { multiple: true }, opt, nil = opt = form_group(@registration, :serial_number) do %label.col-md-2.control-label{for: :serial_number} Serial Number .col-md-5 = f.text_field :serial_number, class: 'form-control' = form_group(@registration, :powerdriver_challenge) do %label.col-md-2.control-label{for: :powerdriver_challenge} Product Code .col-md-5 = f.text_field :powerdriver_challenge, class: 'form-control' = form_group(@registration, :reseller_warranty_code) do %label.col-md-2.control-label{for: :reseller_warranty_code} Warranty Code .col-md-5 = f.text_field :reseller_warranty_code, class: 'form-control' = form_group(@registration, :date_of_purchase) do %label.col-md-2.control-label{for: :date_of_purchase} Date of Purchase .col-md-5.datepicker.input-group = f.text_field :date_of_purchase, class: 'form-control', data: { format: 'yyyy-MM-dd' } %span.input-group-addon %span.icon-calendar{ data: { 'date-icon' => 'icon-calendar', 'time-icon' => 'icon-time' } } = form_group(@registration, :active) do %label.col-md-2.control-label{for: :active} Active .col-md-5 .checkbox = f.check_box :active, {}, '1', '0' = form_group(@registration, :registration_reason) do %label.col-md-2.control-label{for: :registration_reason} Registration Reason .col-md-5 = f.collection_select :registration_reason, ProductRegistration::REASONS, :first, :last, { prompt: true }, class: 'form-control' = form_group(@registration, :notes) do %label.col-md-2.control-label{for: :notes} Notes .col-md-5 = f.text_area :notes, class: 'form-control' .form-actions.form-actions-padding-sm .row .col-md-10.col-md-offset-2 = f.submit "Save", class: 'btn btn-primary' :javascript window.registration = #{@registration.to_json}; window.registration.options = window.registration.product_options.split(',');