stat_board 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,6 +1,8 @@
1
1
  StatBoard
2
2
  =========
3
3
 
4
+ [![Code Climate](https://codeclimate.com/github/vigetlabs/stat_board.png)](https://codeclimate.com/github/vigetlabs/stat_board)
5
+
4
6
  A simple dashboard of records created this week, this month, and all time, mountable as a Rails Engine.
5
7
 
6
8
  <img src="https://raw.github.com/vigetlabs/stat_board/master/screenshot.png" />
@@ -35,6 +37,10 @@ In `config/initializers/stat_board.rb`:
35
37
  StatBoard.username = "user"
36
38
  StatBoard.password = "pass"
37
39
 
40
+ 3. Displaying Data Graphically (true by default)
41
+
42
+ StatBoard.display_graph = true
43
+
38
44
  ## Issues
39
45
 
40
46
  * Models can be specified as strings rather than constants
@@ -2009,7 +2009,7 @@ table {
2009
2009
 
2010
2010
  .table-striped tbody tr:nth-child(odd) td,
2011
2011
  .table-striped tbody tr:nth-child(odd) th {
2012
- background-color: #f9f9f9;
2012
+ background-color: #eee;
2013
2013
  }
2014
2014
 
2015
2015
  .table-hover tbody tr:hover td,
@@ -2,7 +2,7 @@
2
2
  <table class="table table-striped">
3
3
  <thead>
4
4
  <tr>
5
- <th colspan="2"><%= report.name %></th>
5
+ <th colspan="2"><%= report.name(first_day_ever) %></th>
6
6
  </tr>
7
7
  </thead>
8
8
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  new Highcharts.Chart({
10
10
  chart: {
11
- backgroundColor: '#FFEFD5',
11
+ backgroundColor: '#eee',
12
12
  height: 500,
13
13
  renderTo: 'container'
14
14
  },
@@ -3,7 +3,9 @@
3
3
  <%= render :partial => "chart", :collection => @reports, :as => :report %>
4
4
  </div>
5
5
 
6
- <%= render "graph" %>
6
+ <% if StatBoard.display_graph %>
7
+ <%= render "graph" %>
8
+ <% end %>
7
9
 
8
10
  <% else %>
9
11
  Please specify some models by setting <code>StatBoard.models</code>
@@ -1,7 +1,7 @@
1
1
  module StatBoard
2
2
  module Reports
3
3
  class MonthlyReport < Report
4
- def name
4
+ def name(original_date = nil)
5
5
  "Last 30 days"
6
6
  end
7
7
 
@@ -1,8 +1,12 @@
1
1
  module StatBoard
2
2
  module Reports
3
3
  class OverallReport < Report
4
- def name
5
- "Overall"
4
+ def name(original_date = nil)
5
+ if original_date
6
+ "Overall (since #{original_date.strftime("%m-%d-%Y")})"
7
+ else
8
+ "Overall"
9
+ end
6
10
  end
7
11
  end
8
12
  end
@@ -1,7 +1,7 @@
1
1
  module StatBoard
2
2
  module Reports
3
3
  class Report
4
- def name
4
+ def name(original_date = nil)
5
5
  # define in subclass
6
6
  end
7
7
 
@@ -1,7 +1,7 @@
1
1
  module StatBoard
2
2
  module Reports
3
3
  class WeeklyReport < Report
4
- def name
4
+ def name(original_date = nil)
5
5
  "Last 7 days"
6
6
  end
7
7
 
@@ -1,3 +1,3 @@
1
1
  module StatBoard
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/stat_board.rb CHANGED
@@ -5,5 +5,8 @@ require "stat_board/reports/monthly_report"
5
5
  require "stat_board/reports/weekly_report"
6
6
 
7
7
  module StatBoard
8
- mattr_accessor :models, :title, :username, :password
8
+ mattr_accessor :models, :title, :display_graph, :username, :password
9
+
10
+ # Display graph by default. Can be disabled in initializers/stat_board.rb.
11
+ @@display_graph = true
9
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stat_board
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2013-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails