mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 08:31:39 -04:00
Louis | Adds page for available freecyclery bikes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
.container
|
||||
%h1 Bike & Client Tracker
|
||||
%br
|
||||
%h2 Bikes
|
||||
%br
|
||||
= link_to "View All Bikes", bikes_path
|
||||
%br
|
||||
= link_to "Freecyclery Clients", clients_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
|
||||
|
||||
Reference in New Issue
Block a user