Permalink
Browse files

reverse order of reports

  • Loading branch information...
1 parent 890e216 commit f71761e01e1bcd0f95dea36032bf2351039d17ff @dbc-apprentice dbc-apprentice committed Nov 17, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −0 Gemfile
  2. +2 −0 Gemfile.lock
  3. +3 −3 app/views/reports/index.html.haml
View
1 Gemfile
@@ -11,6 +11,7 @@ gem 'haml-rails'
gem 'devise'
gem 'client_side_validations'
gem 'jquery-ui-rails'
+gem 'will_paginate'
group :assets do
gem 'sass-rails', '~> 3.2.3'
View
2 Gemfile.lock
@@ -197,6 +197,7 @@ GEM
multi_json (~> 1.0, >= 1.0.2)
warden (1.2.1)
rack (>= 1.0)
+ will_paginate (3.0.3)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -229,3 +230,4 @@ DEPENDENCIES
thin
twitter-bootstrap-rails
uglifier (>= 1.0.3)
+ will_paginate
View
6 app/views/reports/index.html.haml
@@ -6,17 +6,17 @@
%tr
%th Date
%tbody
- - report_date = @start_date
+ - report_date = Time.zone.now.to_date
- page_no = 1
- - while report_date != Time.zone.now.to_date + 1
+ - while report_date != @start_date
%tr
- if (report_date.strftime("%A") != "Saturday") and (report_date.strftime("%A") != "Sunday")
%th
= report_date.strftime("%A, %b %d, %Y")
%th
%span.label.label-success
=link_to "Export Report", sessions_path(date: report_date, format: "csv")
- - report_date += 1
+ - report_date -= 1
- page_no += 1

0 comments on commit f71761e

Please sign in to comment.