Browse Source

WIP - begin adding reports

master
Loos 10 years ago
parent
commit
f7de4ea77a
  1. 8
      app/controllers/reports_controller.rb
  2. 5
      app/models/reports.rb
  3. 10
      app/models/user.rb
  4. 1
      app/views/reports/bikes_sold_per_year.html.haml
  5. 3
      app/views/static_pages/home.html.haml
  6. 1
      config/routes.rb
  7. 1
      notes.txt

8
app/controllers/reports_controller.rb

@ -0,0 +1,8 @@
class ReportsController < ApplicationController
before_action :authenticate_user!
def bikes_sold_per_year
@bikes_sold_per_year = Report.bikes_sold_per_year
end
end

5
app/models/reports.rb

@ -0,0 +1,5 @@
class Report
def self.bikes_sold_per_year
"KITTIES"
end
end

10
app/models/user.rb

@ -1,6 +1,10 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# :confirmable, :lockable, :timeoutable, :omniauthable, :registerable,
devise :database_authenticatable,
:recoverable,
:rememberable,
:trackable,
:validatable
end

1
app/views/reports/bikes_sold_per_year.html.haml

@ -0,0 +1 @@
= @bikes_sold_per_year

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

@ -18,3 +18,6 @@
= link_to "Freecyclery Closed Applications", closed_applications_path
%br
= link_to "Available Bikes", available_bikes_path
%h2 Reports
%br
= link_to "Bikes Sold Per Year", bikes_sold_per_year_path

1
config/routes.rb

@ -19,4 +19,5 @@ Bikedb::Application.routes.draw do
get 'ready_for_pickup' => 'freecyclery#ready_for_pickup'
get 'available_bikes' => 'freecyclery#available_bikes'
get 'bikes_sold_per_year' => 'reports#bikes_sold_per_year'
end

1
notes.txt

@ -14,7 +14,6 @@ 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

Loading…
Cancel
Save