mirror of
				https://github.com/fspc/BikeShed-1.git
				synced 2025-11-03 17:15:34 -05:00 
			
		
		
		
	BS3: add bike.
This commit is contained in:
		
							parent
							
								
									1106e08098
								
							
						
					
					
						commit
						58bc6b1a83
					
				@ -1,62 +1,73 @@
 | 
				
			|||||||
= top_menu link_to_dashboard
 | 
					= top_menu link_to_dashboard
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%h2 Add Bike
 | 
					%h1 Add Bike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%p
 | 
					.row
 | 
				
			||||||
  .control-group
 | 
					  .col-xs-12.col-sm-6.col-lg-4
 | 
				
			||||||
    .controls
 | 
					    %fieldset
 | 
				
			||||||
      %input{id: "shop_id", placeholder: "Shop ID", type: "number", min:0, class: "input-lg" }
 | 
					      .form-group
 | 
				
			||||||
 | 
					        = number_field_tag '', '', id: 'shop_id', placeholder: 'Shop ID', min: 0, class: 'form-control'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      = select_tag(:bike_brand_id, options_for_select(@brands))
 | 
					        = select_tag :bike_brand_id, options_for_select(@brands), class: 'form-control'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      %input{id: "model", placeholder: "Model", type: "text", class: "input-lg" }
 | 
					        = text_field_tag '', '', id: 'model', placeholder: 'Model', class: 'form-control'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      %input{id: "serial_number", placeholder: "Serial Number", type: "text", class: "input-lg" }
 | 
					        = text_field_tag '', '', id: 'serial_number', placeholder: 'Serial Number', class: 'form-control'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      .btn-group{ "data-toggle" => "buttons-radio"}
 | 
					        .btn-group{"data-toggle": 'buttons'}
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					          %label.btn.btn-default
 | 
				
			||||||
          %input{ type: "radio", name: "bike_style", value: 3} RD
 | 
					            = radio_button_tag 'bike_style', 3
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					            RD
 | 
				
			||||||
          %input{ type: "radio", name: "bike_style", value: 1} MTN
 | 
					          %label.btn.btn-default
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					            = radio_button_tag 'bike_style', 1
 | 
				
			||||||
          %input{ type: "radio", name: "bike_style", value: 2} HYB
 | 
					            MTN
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					          %label.btn.btn-default
 | 
				
			||||||
          %input{ type: "radio", name: "bike_style", value: 4} OTHER
 | 
					            = radio_button_tag 'bike_style', 2
 | 
				
			||||||
    %input{ id: "bike_style_id", type: "hidden"}
 | 
					            HYB
 | 
				
			||||||
 | 
					          %label.btn.btn-default
 | 
				
			||||||
 | 
					            = radio_button_tag 'bike_style', 4
 | 
				
			||||||
 | 
					            OTHER
 | 
				
			||||||
 | 
					        = hidden_field_tag '', '', id: 'bike_style_id'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      = select_tag(:bike_wheel_size_id, options_for_select(@wheel_sizes), id: :bike_wheel_size_id)
 | 
					        = select_tag :bike_wheel_size_id, options_for_select(@wheel_sizes), id: :bike_wheel_size_id, class: 'form-control'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      .btn-group{ "data-toggle" => "buttons-radio"}
 | 
					        .btn-group{ "data-toggle": 'buttons'}
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					          %label.btn.btn-default
 | 
				
			||||||
          %input{ type: "radio", name: "bike_condition", value: 2} Poor
 | 
					            = radio_button_tag 'bike_condition', 2
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					            Poor
 | 
				
			||||||
          %input{ type: "radio", name: "bike_condition", value: 3} Fair
 | 
					          %label.btn.btn-default
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					            = radio_button_tag 'bike_condition', 3
 | 
				
			||||||
          %input{ type: "radio", name: "bike_condition", value: 4} Good
 | 
					            Fair
 | 
				
			||||||
        %label{ class: "btn btn-default"}
 | 
					          %label.btn.btn-default
 | 
				
			||||||
          %input{ type: "radio", name: "bike_condition", value: 5} Excellent
 | 
					            = radio_button_tag 'bike_condition', 4
 | 
				
			||||||
    %input{ id: "bike_condition_id", type: "hidden"}
 | 
					            Good
 | 
				
			||||||
 | 
					          %label.btn.btn-default
 | 
				
			||||||
 | 
					            = radio_button_tag 'bike_condition', 5
 | 
				
			||||||
 | 
					            Excellent
 | 
				
			||||||
 | 
					        = hidden_field_tag '', '', id: 'bike_condition_id'
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
  .control-group
 | 
					
 | 
				
			||||||
    .controls
 | 
					      .form-group
 | 
				
			||||||
      %input{id: "seat_tube_height", placeholder: "Seat Tube (cm)", type: "number", min: 0, max: 100, class: "input-lg" }
 | 
					        .input-group
 | 
				
			||||||
 | 
					          = number_field_tag '', '', id: 'seat_tube_height', placeholder: 'Seat Tube', min: 0, max: 100, class: "form-control"
 | 
				
			||||||
 | 
					          .input-group-addon cm
 | 
				
			||||||
        .help-block
 | 
					        .help-block
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      -# Commenting this out until description is added to Bike
 | 
					      -# Commenting this out until description is added to Bike
 | 
				
			||||||
    %p
 | 
					        /.form-group
 | 
				
			||||||
          %input{id: "bike_description", placeholder: "Short description", type: "text", class: "input-lg" }
 | 
					          %input{id: "bike_description", placeholder: "Short description", type: "text", class: "input-lg" }
 | 
				
			||||||
  .control-group
 | 
					 | 
				
			||||||
    .controls
 | 
					 | 
				
			||||||
      %input{id: "add_bike_submit", value: "Add Bike", type: "button", class: "btn btn-lg btn-block btn-primary", "data-url" => "#{api_create_bike_path}"}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .form-group
 | 
				
			||||||
 | 
					        = button_tag 'Add Bike', id: 'add_bike_submit', class: 'btn btn-primary', "data-url": "#{api_create_bike_path}"
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user