<%= ts("Statistics") %>
<%= ts('Navigation and Sorting') %>
<%= render "stats/navigation" %>
<% @years.each do |year| %>
-
<% if @current_year == year %>
<%= year %>
<% else %>
<%= link_to year, current_path_with(year: year) %>
<% end %>
<% end %>
<%= ts("Totals") %>
<% { user_subscriptions: ts("User Subscriptions:"),
kudos: ts("Kudos:"),
comment_thread_count: ts("Comment Threads:"),
bookmarks: ts("Bookmarks:"),
subscriptions: ts("Subscriptions:"),
word_count: ts("Word Count:") }.each do |stat, stat_text| %>
<% stat == :word_count ? html_class = "words" : html_class = stat.to_s.humanize.downcase %>
- <%= stat_text %>
- <%= number_with_delimiter(@totals[stat]) %>
<% end %>
- <%= ts("Hits:") %>
- <%= number_with_delimiter(@totals[:hits]) %>
<%= render_chart(@chart, 'stat_chart') %>
<%= ts('View Sorting and Actions') %>
<%= ts('Sort By') %>
- <%= sort_link ts("Date"), "date" %>
- <%= sort_link ts('Hits'), "hits", {:desc_default => true} %>
- <%= sort_link ts('Kudos'), "kudos.count", {:desc_default => true} %>
- <%= sort_link ts('Comment Threads'), "comment_thread_count", {:desc_default => true} %>
- <%= sort_link ts('Bookmarks'), "bookmarks.count", {:desc_default => true} %>
- <%= sort_link ts('Subscriptions'), "subscriptions.count", {:desc_default => true} %>
- <%= sort_link ts('Word Count'), "word_count", {:desc_default => true} %>
- <%= span_if_current ts("Fandoms View"), current_path_with(flat_view: nil), params[:flat_view].blank? %>
- <%= span_if_current ts("Flat View"), current_path_with(flat_view: true) %>
<%= ts('Listing Statistics') %>
<% @works.keys.sort.each do |fandom| %>
-
<%= fandom %>
<% @works[fandom].each do |work| %>
-
-
<%= link_to work.title, work_path(:id => work.id) %>
<% if params[:flat_view] %>(<%= work.fandom_string %>)<% end %>
(<%= ts("%{wordcount} words", wordcount: number_with_delimiter(work.word_count)) %>)
-
<% if (work_subscriber_count = Subscription.where(:subscribable_id => work.id, :subscribable_type => 'Work').count) > 0 %>
- <%= ts("Subscriptions:") %>
- <%= number_with_delimiter(work_subscriber_count) %>
<% end %>
- <%= ts("Hits:") %>
- <%= number_with_delimiter(work.hits) %>
<% # dt ts("Downloads:") /dt dd work.downloads /dd %>
- <%= ts("Kudos:") %>
- <%= number_with_delimiter(work.kudos.count) %>
- <%= ts("Bookmarks:") %>
- <%= number_with_delimiter(work.bookmarks.count) %>
<% end %>
<% end %>