Browse Source

lk | extracts bike types & improves bike list pages

master
Louis Knapp 9 years ago
parent
commit
5b8535a880
  1. 15
      app/models/bike.rb
  2. 2
      app/views/bikes/_fields.html.haml
  3. 2
      app/views/clients/_fields.html.haml
  4. 6
      app/views/freecyclery/available_bikes.html.haml
  5. 6
      app/views/freecyclery/ready_for_pickup.html.haml
  6. 11
      notes.txt

15
app/models/bike.rb

@ -6,6 +6,21 @@ class Bike < ActiveRecord::Base
validates :color, presence: true validates :color, presence: true
validates :serial_number, presence: true validates :serial_number, presence: true
def self.bike_types
[
["BMX", "BMX"],
["Cruiser", "Cruiser"],
["Hybrid", "Hybrid"],
["Kids", "Kids"],
["Mountain", "Mountain"],
["Road", "Road"],
["Touring", "Touring"],
["Track", "Track"],
["Utility", "Utility"],
["Youth", "Youth"]
]
end
def name def name
self.color + " " + self.brand + ' ' + self.model + " (" + self.log_number.to_s + ")" self.color + " " + self.brand + ' ' + self.model + " (" + self.log_number.to_s + ")"
end end

2
app/views/bikes/_fields.html.haml

@ -23,7 +23,7 @@
.form-group .form-group
= f.label "Type:", class: "col-sm-4 control-label" = f.label "Type:", class: "col-sm-4 control-label"
.col-sm-6 .col-sm-6
= f.select :bike_type, [["BMX", "BMX"], ["Cruiser", "Cruiser"], ["Hybrid", "Hybrid"], ["Kids", "Kids"], ["Mountain", "Mountain"], ["Road", "Road"], ["Touring", "Touring"], ["Track", "Track"], ["Utility", "Utility"], ["Youth", "Youth"]], {}, class: "selectpicker", disabled: disabled = f.select :bike_type, Bike.bike_types, {}, class: "selectpicker", disabled: disabled
.form-group .form-group
= f.label "Color:", class: "col-sm-4 control-label" = f.label "Color:", class: "col-sm-4 control-label"

2
app/views/clients/_fields.html.haml

@ -38,7 +38,7 @@
.form-group .form-group
= f.label "Type of Bike Requested:", class: "col-sm-2 control-label" = f.label "Type of Bike Requested:", class: "col-sm-2 control-label"
.col-sm-10 .col-sm-10
= f.select :bike_type_requested, [["BMX", "BMX"], ["Cruiser", "Cruiser"], ["Hybrid", "Hybrid"], ["Kids", "Kids"], ["Mountain", "Mountain"], ["Road", "Road"], ["Touring", "Touring"], ["Track", "Track"], ["Utility", "Utility"], ["Youth", "Youth"]], {include_blank: "No Preference"}, class: "selectpicker", disabled: disabled = f.select :bike_type_requested, Bike.bike_types, {include_blank: "No Preference"}, class: "selectpicker", disabled: disabled
.form-group .form-group
= f.label "Will Pay 25$ for Lock & Helmet:", class: "col-sm-2 control-label" = f.label "Will Pay 25$ for Lock & Helmet:", class: "col-sm-2 control-label"

6
app/views/freecyclery/available_bikes.html.haml

@ -5,11 +5,9 @@
%table.table.table-striped.table-bordered.table-hover %table.table.table-striped.table-bordered.table-hover
%thead %thead
%tr %tr
%th Brand %th Bike
%th Model
%tbody %tbody
- @available_bikes.each do |bike| - @available_bikes.each do |bike|
%tr %tr
%td= bike.brand %td= bike.name
%td= bike.model

6
app/views/freecyclery/ready_for_pickup.html.haml

@ -5,15 +5,13 @@
%table.table.table-striped.table-bordered.table-hover %table.table.table-striped.table-bordered.table-hover
%thead %thead
%tr %tr
%th Brand %th Bike
%th Model
%th Client %th Client
%th %th
%tbody %tbody
- @bikes_for_pickup.each do |bike| - @bikes_for_pickup.each do |bike|
%tr %tr
%td= bike.brand %td= bike.name
%td= bike.model
%td= bike.client.name %td= bike.client.name
%td= button_to "Mark as picked up", {controller: "bikes", action: "mark_picked_up", id: bike.id}, method: :patch, class: "btn btn-default" %td= button_to "Mark as picked up", {controller: "bikes", action: "mark_picked_up", id: bike.id}, method: :patch, class: "btn btn-default"

11
notes.txt

@ -1,9 +1,16 @@
print sales labels should not show freecyclery bikes when bike gets picked up, remove it from freecyclery bike list
when visiting user page check if they have a bike and add it to
the list
show log number next to bikes (color model make lognumber) available freecyclery bikes list should have all the infos - size,
make, model, color, etc
make sure you can mark bike completion dates
bikes ready for pickup should also include color & log number
clients should not be on waiting list after they get assigned a bike
print sales labels should not show freecyclery bikes
search for bike based on log # search for bike based on log #
convert to bootstrap-less or something convert to bootstrap-less or something

Loading…
Cancel
Save