|
1 | 1 | <% provide(:title, "Monthly Statistics") %>
|
2 | 2 |
|
3 |
| -<% (2016..Time.zone.now.year).to_a.reverse.each do |year_num| %> |
4 |
| - <div class="stat_table_container"> |
5 |
| - <table class="table table-striped table-responsive stat_box"> |
6 |
| - <tbody> |
7 |
| - <div class="bg-info small_box_header"> |
8 |
| - <h2><strong><%= year_num %></strong></h2> |
9 |
| - </div> |
10 |
| - <tr class="info table-row center"> |
11 |
| - <td><strong>Month</strong></td> |
12 |
| - <td><strong># of WRAP sessions</strong></td> |
13 |
| - <td> |
14 |
| - <strong> |
15 |
| - # of unduplicated members who attended a WRAP session |
16 |
| - </strong> |
17 |
| - </td> |
18 |
| - <td><strong># of WRAP plans opened</strong></td> |
19 |
| - <td><strong># of WRAP plans completed</strong></td> |
20 |
| - <td> |
21 |
| - <strong> |
22 |
| - # of unduplicated members who attended a non-WRAP session |
23 |
| - </strong> |
24 |
| - </td> |
25 |
| - <td><strong># of non-WRAP sessions</strong></td> |
26 |
| - </tr> |
27 |
| - <% (monthly_stats.minimum(:month)..monthly_stats.maximum(:month)) |
28 |
| - .each do |month_num| %> |
29 |
| - <% current_monthly_stat = monthly_stats.where( |
30 |
| - "month = ? AND year = ?", month_num, year_num).first %> |
31 |
| - <%= render partial: "monthly_stat_row", |
32 |
| - locals: {current_monthly_stat: current_monthly_stat} %> |
33 |
| - <% end %> |
34 |
| - </tbody> |
35 |
| - </table> |
36 |
| - </div> |
| 3 | +<% if monthly_stats.count == 0 %> |
| 4 | + <h5> |
| 5 | + Sorry, there are no statistics available yet. Statistics for each month will |
| 6 | + be automatically posted here on the first day of the following month. |
| 7 | + </h5> |
| 8 | +<% else %> |
| 9 | + <h5> |
| 10 | + Statistics for each month will be automatically posted here on the first day |
| 11 | + of the following month. |
| 12 | + </h5> |
| 13 | + <% (2016..Time.zone.now.year).to_a.reverse.each do |year_num| %> |
| 14 | + <div class="stat_table_container"> |
| 15 | + <div class="bg-info small_box_header"> |
| 16 | + <h2><strong><%= year_num %></strong></h2> |
| 17 | + </div> |
| 18 | + <table class="table table-striped table-responsive stat_box"> |
| 19 | + <thead> |
| 20 | + <tr class="info table-row center"> |
| 21 | + <td><strong>Month</strong></td> |
| 22 | + <td><strong># of WRAP sessions</strong></td> |
| 23 | + <td> |
| 24 | + <strong> |
| 25 | + # of unduplicated members who attended a WRAP session |
| 26 | + </strong> |
| 27 | + </td> |
| 28 | + <td><strong># of WRAP plans opened</strong></td> |
| 29 | + <td><strong># of WRAP plans completed</strong></td> |
| 30 | + <td> |
| 31 | + <strong> |
| 32 | + # of unduplicated members who attended a non-WRAP session |
| 33 | + </strong> |
| 34 | + </td> |
| 35 | + <td><strong># of non-WRAP sessions</strong></td> |
| 36 | + </tr> |
| 37 | + </thead> |
| 38 | + <tbody> |
| 39 | + <% (monthly_stats.minimum(:month)..monthly_stats.maximum(:month)) |
| 40 | + .each do |month_num| %> |
| 41 | + <% current_monthly_stat = monthly_stats.where( |
| 42 | + "month = ? AND year = ?", month_num, year_num).first %> |
| 43 | + <%= render partial: "monthly_stat_row", |
| 44 | + locals: {current_monthly_stat: current_monthly_stat} %> |
| 45 | + <% end %> |
| 46 | + </tbody> |
| 47 | + </table> |
| 48 | + </div> |
| 49 | + <% end %> |
37 | 50 | <% end %>
|
0 commit comments