lk | adds explanatory text to waiting list & disables mark_as_sold button for sold bikes, and removes unused columns

This commit is contained in:
Louis Knapp
2016-07-30 20:58:56 -05:00
parent cc3f684e01
commit 9c53f81672
10 changed files with 27 additions and 118 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
class BikesController < ApplicationController
before_action :set_bike, only: [:show, :edit, :update, :destroy]
before_action :set_bike, only: [:edit, :update, :destroy]
before_action :authenticate_user!
def index
+4
View File
@@ -25,6 +25,10 @@ class Bike < ActiveRecord::Base
]
end
def sold?
date_sold.present?
end
def name
self.color + " " + self.brand + ' ' + self.model + " (" + self.log_number.to_s + ")"
end
+1 -1
View File
@@ -3,7 +3,7 @@
.col-sm-6
%h1 Edit bike
.col-sm-3.col-sm-offset-3
=button_to "Mark as sold", {action: "mark_as_sold", id: @bike.id}, method: :patch, class: "btn btn-default"
=button_to "Mark as sold", {action: "mark_as_sold", id: @bike.id}, method: :patch, class: "btn btn-default", disabled: @bike.sold?
= render 'edit_form'
.bottom-nav-links
- if @previous_bike
-7
View File
@@ -1,7 +0,0 @@
.container
%p#notice= notice
= form_for(@bike) do |f|
= render 'fields', f: f, disabled: true
= link_to 'Edit', edit_bike_path(@bike)
|
= link_to 'Back', bikes_path
+1
View File
@@ -3,6 +3,7 @@
= link_to ' + New Client', new_client_path, class: "btn btn-default"
.row
%h1 Client Waiting List
%p The waiting list shows clients who have not been voided or picked up their bike. Only clients with an application date are shown.
%table.table.table-striped.table-bordered.table-hover
%thead