From 5bfe7365ae56b4fd3815349ae7175aa00f0f2f09 Mon Sep 17 00:00:00 2001 From: Loos Date: Mon, 22 Sep 2014 20:20:06 -0400 Subject: [PATCH] Louis | Adds fields to client --- app/controllers/clients_controller.rb | 8 ++++- app/views/clients/_fields.html.haml | 31 +++++++++++++++++++ .../20140923000417_add_fields_to_client.rb | 10 ++++++ db/schema.rb | 8 ++++- 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20140923000417_add_fields_to_client.rb diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index 5e24234..a234e09 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -61,6 +61,12 @@ class ClientsController < ApplicationController :lock, :completion_date, :bike_id, - :agency_id) + :agency_id, + :notes, + :bike_fixed, + :number_of_calls, + :application_voided, + :pickup_date, + :volunteer_at_pickup) end end diff --git a/app/views/clients/_fields.html.haml b/app/views/clients/_fields.html.haml index d675634..5d315ab 100644 --- a/app/views/clients/_fields.html.haml +++ b/app/views/clients/_fields.html.haml @@ -66,3 +66,34 @@ .col-sm-10 = f.select(:agency_id, Agency.all.collect {|b| [ b.agency_name, b.id ] }, {include_blank: 'None'}) + .form-group + = f.label "Notes:", class: "col-sm-2 control-label" + .col-sm-10 + = f.text_area :notes, class: "form-control", disabled: disabled + .form-group + = f.label "Bike Fixed:", class: "col-sm-2 control-label" + .col-sm-10 + = f.check_box :bike_fixed, disabled: disabled + + .form-group + = f.label "Number of Calls Made:", class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :number_of_calls, class: "form-control", disabled: disabled + + .form-group + = f.label "Application Voided:", class: "col-sm-2 control-label" + .col-sm-10 + = f.check_box :application_voided, disabled: disabled + + .form-group + = f.label "Bike Picked Up On:", class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :pickup_date, class: "form-control datepicker", disabled: disabled + + .form-group + = f.label "Volunteer Present at Pickup:", class: "col-sm-2 control-label" + .col-sm-10 + = f.text_field :volunteer_at_pickup, class: "form-control", disabled: disabled + + + diff --git a/db/migrate/20140923000417_add_fields_to_client.rb b/db/migrate/20140923000417_add_fields_to_client.rb new file mode 100644 index 0000000..fa9e142 --- /dev/null +++ b/db/migrate/20140923000417_add_fields_to_client.rb @@ -0,0 +1,10 @@ +class AddFieldsToClient < ActiveRecord::Migration + def change + add_column(:clients, :notes, :text) + add_column(:clients, :bike_fixed, :boolean) + add_column(:clients, :number_of_calls, :integer) + add_column(:clients, :application_voided, :boolean) + add_column(:clients, :pickup_date, :date) + add_column(:clients, :volunteer_at_pickup, :string) + end +end diff --git a/db/schema.rb b/db/schema.rb index fd08ec2..bb77e35 100644 --- a/db/schema.rb +++ b/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: 20140922233036) do +ActiveRecord::Schema.define(version: 20140923000417) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -67,6 +67,12 @@ ActiveRecord::Schema.define(version: 20140922233036) do t.string "bike_type_requested" t.boolean "will_pay" t.integer "agency_id" + t.text "notes" + t.boolean "bike_fixed" + t.integer "number_of_calls" + t.boolean "application_voided" + t.date "pickup_date" + t.string "volunteer_at_pickup" end add_index "clients", ["agency_id"], name: "index_clients_on_agency_id", using: :btree