diff --git a/app/controllers/freecyclery_controller.rb b/app/controllers/freecyclery_controller.rb index 294cd84..cd2fb50 100644 --- a/app/controllers/freecyclery_controller.rb +++ b/app/controllers/freecyclery_controller.rb @@ -9,5 +9,8 @@ class FreecycleryController < ApplicationController @bikes_for_pickup = Bike.bikes_ready_for_pickup end + def available_bikes + @available_bikes = Bike.available_for_freecyclery + end end diff --git a/app/models/bike.rb b/app/models/bike.rb index a295c73..c97f0e9 100644 --- a/app/models/bike.rb +++ b/app/models/bike.rb @@ -23,4 +23,8 @@ class Bike < ActiveRecord::Base Bike.all.select{|bike| bike.ready_for_pickup?} end + def self.available_for_freecyclery + Bike.all.select{|bike| bike.completion_date && (bike.purpose == "Freecyclery") && !bike.client } + end + end diff --git a/app/views/freecyclery/available_bikes.html.haml b/app/views/freecyclery/available_bikes.html.haml new file mode 100644 index 0000000..8426423 --- /dev/null +++ b/app/views/freecyclery/available_bikes.html.haml @@ -0,0 +1,15 @@ +.container + %br + + %h1 Available Freecyclery Bikes + %table.table.table-striped.table-bordered.table-hover + %thead + %tr + %th Brand + %th Model + %tbody + - @available_bikes.each do |bike| + %tr + %td= bike.brand + %td= bike.model + diff --git a/app/views/static_pages/home.html.haml b/app/views/static_pages/home.html.haml index 590a7b6..c3e9793 100644 --- a/app/views/static_pages/home.html.haml +++ b/app/views/static_pages/home.html.haml @@ -1,14 +1,20 @@ .container %h1 Bike & Client Tracker %br - = link_to "View All Bikes", bikes_path + %h2 Bikes %br - = link_to "Freecyclery Clients", clients_path + = link_to "View All Bikes", bikes_path %br = link_to "Print Sale Bike Labels", print_select_bikes_path %br + %h2 Freecyclery + %br + = link_to "Freecyclery Clients", clients_path + %br = link_to "Freecyclery Agencies", agencies_path %br = link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path %br = link_to "Freecyclery Closed Applications", closed_applications_path + %br + = link_to "Available Bikes", available_bikes_path diff --git a/config/routes.rb b/config/routes.rb index 6ed96a2..6d19277 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,5 +15,6 @@ Bikedb::Application.routes.draw do get 'closed_applications' => 'freecyclery#closed_applications' get 'ready_for_pickup' => 'freecyclery#ready_for_pickup' + get 'available_bikes' => 'freecyclery#available_bikes' end diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..3c2bc0f --- /dev/null +++ b/notes.txt @@ -0,0 +1,27 @@ +Freecyclery Receipts + Prints two quarter sheet receipts -- one for client, one for Recyclery. Includes: + Client Name, Agency, Bike Log Number (make and model too?), Helmet Needed?, Lock Needed?, Will Pay $25 upon receipt of lock and helmet? + Also blanks for Client Signature, Date Received, and Recyclery Volunteer Initials. + +Reports + Number of bikes sold by year or month. (Bar graph for extra points!) + Number of bikes donated by year or month. (With bar graph!?) + Number of bikes donated according to agency. (Graph?) + Average bike price for year. + +assign a bike from the available freecyclery bikes page +mark as picked up from the ready for pickup page +validations around parameters that break site if incomplete +mark as sold should be disabled after bike is sold + there should be nice feedback indicating that the bike was sold +disable new users +Improve form layouts +make navigation always on the left side of the page +Make customer facing bike index with pitchers +make skizzers marks on the labels page +make great dummy data +refactor index - move unsold bikes to model +make ‚recyclery‘ its own view folder, controller, etc. +add a request-a-feature feature + +