X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/34c44145a77003ac4fcabd0b865f039bc24f97f4..171c0354e74b4fdd73e25ea05f5b2d23c0d1642f:/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml diff --git a/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml b/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml new file mode 100644 index 0000000..dfbb94e --- /dev/null +++ b/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml @@ -0,0 +1,67 @@ +
+<% +unique_max_total = @month_hits.inject(0) {|m,a| a[1].to_i > m ? a[1].to_i : m } +hits_max_total = @month_hits.inject(0) {|m,a| a[2].to_i > m ? a[2].to_i : m } +%> + + + +<% +@month_hits.each do |month_hits| +unique_height = 0 +hits_height = 0 +if unique_max_total > 0 + unique_height = ((month_hits[1].to_f/unique_max_total)*100).round + unique_height = 1 if unique_height < 1 +end +if hits_max_total > 0 + hits_height = ((month_hits[2].to_f/hits_max_total)*100).round + hits_height = 1 if hits_height < 1 +end +%> + +<%end%> + +
+ Unique
+ Hits +
+ + + + + + + +
+ + +
+ <%=month_hits[0]%> +
+
+ +

+ + + + + + + + +<%i=1; @month_hits.each do |month_hits| %> + + + + + + +<% i+=1; end %> + + + + + + +
MonthHitsPercentageUnique Visits
<%= month_hits[0] %><%= month_hits[2] %><%= sprintf("%000.2f",(month_hits[2].to_f/@year_hits)*100) %>%<%= month_hits[1] %>
Totals:<%=@year_hits%><%=@year_uniq%>
\ No newline at end of file