Browse Source

Louis | Add new parts, work done, and date sold to bikes

master
Loos 10 years ago
parent
commit
693ca3c760
  1. 1
      app/assets/stylesheets/print_select.css.scss
  2. 3
      app/controllers/bikes_controller.rb
  3. 18
      app/views/bikes/_fields.html.haml
  4. 3
      app/views/bikes/print_labels.html.haml
  5. 7
      db/migrate/20140918211228_add_new_parts_work_done_and_date_sold_to_bikes.rb
  6. 5
      db/schema.rb

1
app/assets/stylesheets/print_select.css.scss

@ -1,6 +1,7 @@
.print-select{
.print-label{
width: 400px;
height: 600px;
padding: 10px;
margin: 10px;
display: inline-block;

3
app/controllers/bikes_controller.rb

@ -69,6 +69,9 @@ class BikesController < ApplicationController
:price,
:top_tube_size,
:seat_tube_size,
:new_parts,
:work_done,
:date_sold,
:created_at,
:updated_at)
end

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

@ -55,6 +55,18 @@
.col-sm-10
= f.text_area :notes, class: "form-control", disabled: disabled
.form-group
= f.label "Work Done:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_area :work_done, class: "form-control", disabled: disabled
.form-group
= f.label "New Parts:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_area :new_parts, class: "form-control", disabled: disabled
.form-group
= f.label "Tag Info", class: "col-sm-2 control-label"
.col-sm-10
@ -70,6 +82,12 @@
.col-sm-10
= f.text_field :completion_date, class: "form-control datepicker", disabled: disabled
.form-group
= f.label "Date Sold:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :date_sold, class: "form-control datepicker", disabled: disabled
.form-group
= f.label "Price", class: "col-sm-2 control-label"
.col-sm-10

3
app/views/bikes/print_labels.html.haml

@ -1,6 +1,5 @@
.print-select
- @bikes.each do |bike|
.print-label
%h2=bike.price
%h2=bike.name
%h2=bike.price + ' ' + bike.name
%br

7
db/migrate/20140918211228_add_new_parts_work_done_and_date_sold_to_bikes.rb

@ -0,0 +1,7 @@
class AddNewPartsWorkDoneAndDateSoldToBikes < ActiveRecord::Migration
def change
add_column :bikes, :new_parts, :text
add_column :bikes, :work_done, :text
add_column :bikes, :date_sold, :date
end
end

5
db/schema.rb

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140917020156) do
ActiveRecord::Schema.define(version: 20140918211228) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -35,6 +35,9 @@ ActiveRecord::Schema.define(version: 20140917020156) do
t.integer "log_number"
t.text "purpose"
t.text "mechanic"
t.text "new_parts"
t.text "work_done"
t.date "date_sold"
end
create_table "clients", force: true do |t|

Loading…
Cancel
Save