-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathstats.html.erb
48 lines (43 loc) · 2.16 KB
/
stats.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<br>
<div class="col-lg-8">
<% if @tags.empty? %>
<h4>Uh oh, your search for <%= @tag_name %> returned no results</h4>
<h6> <%= link_to "See statistics for all contents", stats_path %> </h6>
<% else %>
<h4>Tag statistics for <%= @tag_name %> </h4>
<hr>
<h6> <%= link_to "See statistics for all contents", stats_path %> </h6>
<%= form_tag request.url, method: :get do %>
<h6>Choose a range to show a graph of statistics within that period</h6>
<br>
<div class="col-md-6">
<label>Starting</label>
<input data-provide="datepicker" data-date="<%= DateTime.now.strftime("%d-%m-%Y") %>" data-date-format="dd-mm-yyyy" value="<%= @start.strftime("%d-%m-%Y") %>" tabindex="1" class="form-control input-lg" type="text" name="start" placeholder=" Select start date">
</div>
 
<div class="col-md-6">
<label>Ending</label>
<input data-provide="datepicker" data-date="<%= DateTime.now.strftime("%d-%m-%Y") %>" data-date-format="dd-mm-yyyy" value="<%= @end.strftime("%d-%m-%Y") %>" tabindex="1" class="form-control input-lg" type="text" name="end" placeholder=" Select end date">
</div>
</div>
</div>
<br>
<div class="col-lg-8">
<%= submit_tag "Go", class: 'btn btn-default' %>
<% end %>
</div>
<% if @questions.nonzero? %>
<br><br>
<h4 align="center">Questions Answered vs. Unanswered</h4>
<div align="right" id="questAns"> </div>
<% end %>
<%= render 'stats/barchart' %>
<br><br><br>
<div class="graph">
<p> <b><%= params[:id].capitalize%></b> graph from <b><%= (@start).to_formatted_s(:long)%></b> to <b><%= @end.to_formatted_s(:long)%></b> </p>
<br>
<%= render partial: "tag/graph", locals: { wikis: @tag_wikis, notes: @tag_notes, questions: @tag_questions, comments: @tag_comments } %>
<br>
<p><i>This graph shows the number of followers who began subscribing within a given time period; this is not a cumulative graph of subscriptions. Note also: if someone 'unfollows,' the record is deleted, and we can't see it anymore, so we cannot currently measure a decline in followers over time.</i></p>
<% end %>
</div>