mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Show real stats on home page
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
class HomeController < BaseController
|
||||
layout 'darkswarm'
|
||||
before_filter :load_active_distributors
|
||||
|
||||
|
||||
def index
|
||||
@num_hubs = Enterprise.is_hub.count
|
||||
@num_producers = Enterprise.is_primary_producer.count
|
||||
@num_users = Spree::User.joins(:orders).count('DISTINCT spree_users.*')
|
||||
@num_orders = Spree::Order.complete.count
|
||||
end
|
||||
|
||||
def about_us
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -5,25 +5,23 @@
|
||||
%p.text-big Thanks for making the Open Food Network possible. Our vision is a better food system, and we're proud of what we're achieving together.
|
||||
%br
|
||||
%br
|
||||
// Todo: make these variables live from OFN data.
|
||||
// Todo: investigate state / postcode / location stat. Easy / hard?
|
||||
.stat1
|
||||
%h4
|
||||
%strong 4
|
||||
states represented
|
||||
.stat1
|
||||
%h4
|
||||
%strong 126
|
||||
-# .stat1
|
||||
-# %h4
|
||||
-# %strong 44444
|
||||
-# states represented
|
||||
.stat2
|
||||
%h4
|
||||
%strong= number_with_delimiter @num_hubs
|
||||
food shops
|
||||
.stat3
|
||||
%h4
|
||||
%strong 345
|
||||
%h4
|
||||
%strong= number_with_delimiter @num_producers
|
||||
food producers
|
||||
.stat4
|
||||
%h4
|
||||
%strong 2,201
|
||||
%h4
|
||||
%strong= number_with_delimiter @num_users
|
||||
happy food shoppers
|
||||
.stat5
|
||||
%h4
|
||||
%strong 3,902
|
||||
orders made
|
||||
%h4
|
||||
%strong= number_with_delimiter @num_orders
|
||||
orders made
|
||||
|
||||
Reference in New Issue
Block a user