Browse Source

Louis | Adds page for available freecyclery bikes

master
Loos 10 years ago
parent
commit
9fad8ded1b
  1. 3
      app/controllers/freecyclery_controller.rb
  2. 4
      app/models/bike.rb
  3. 15
      app/views/freecyclery/available_bikes.html.haml
  4. 10
      app/views/static_pages/home.html.haml
  5. 1
      config/routes.rb
  6. 27
      notes.txt

3
app/controllers/freecyclery_controller.rb

@ -9,5 +9,8 @@ class FreecycleryController < ApplicationController
@bikes_for_pickup = Bike.bikes_ready_for_pickup @bikes_for_pickup = Bike.bikes_ready_for_pickup
end end
def available_bikes
@available_bikes = Bike.available_for_freecyclery
end
end end

4
app/models/bike.rb

@ -23,4 +23,8 @@ class Bike < ActiveRecord::Base
Bike.all.select{|bike| bike.ready_for_pickup?} Bike.all.select{|bike| bike.ready_for_pickup?}
end end
def self.available_for_freecyclery
Bike.all.select{|bike| bike.completion_date && (bike.purpose == "Freecyclery") && !bike.client }
end
end end

15
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

10
app/views/static_pages/home.html.haml

@ -1,14 +1,20 @@
.container .container
%h1 Bike &amp; Client Tracker %h1 Bike &amp; Client Tracker
%br %br
= link_to "View All Bikes", bikes_path %h2 Bikes
%br %br
= link_to "Freecyclery Clients", clients_path = link_to "View All Bikes", bikes_path
%br %br
= link_to "Print Sale Bike Labels", print_select_bikes_path = link_to "Print Sale Bike Labels", print_select_bikes_path
%br %br
%h2 Freecyclery
%br
= link_to "Freecyclery Clients", clients_path
%br
= link_to "Freecyclery Agencies", agencies_path = link_to "Freecyclery Agencies", agencies_path
%br %br
= link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path = link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path
%br %br
= link_to "Freecyclery Closed Applications", closed_applications_path = link_to "Freecyclery Closed Applications", closed_applications_path
%br
= link_to "Available Bikes", available_bikes_path

1
config/routes.rb

@ -15,5 +15,6 @@ Bikedb::Application.routes.draw do
get 'closed_applications' => 'freecyclery#closed_applications' get 'closed_applications' => 'freecyclery#closed_applications'
get 'ready_for_pickup' => 'freecyclery#ready_for_pickup' get 'ready_for_pickup' => 'freecyclery#ready_for_pickup'
get 'available_bikes' => 'freecyclery#available_bikes'
end end

27
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
Loading…
Cancel
Save