mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-08 14:42:44 +00:00
render different reports in partials
This commit is contained in:
parent
0a8aa07078
commit
89d78e5401
@ -8,7 +8,7 @@ module DiscourseRewind
|
|||||||
option :date
|
option :date
|
||||||
|
|
||||||
def call
|
def call
|
||||||
reading_time = UserVisit.where(user: user).where(visited_at: date).sum(:time_read)
|
reading_time = UserVisit.where(user_id: user.id).where(visited_at: date).sum(:time_read)
|
||||||
|
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
@ -41,7 +41,7 @@ module DiscourseRewind
|
|||||||
"And Then There Were None" => 16_200,
|
"And Then There Were None" => 16_200,
|
||||||
"The Alchemist" => 10_800,
|
"The Alchemist" => 10_800,
|
||||||
"The Hitchhiker's Guide to the Galaxy" => 12_600,
|
"The Hitchhiker's Guide to the Galaxy" => 12_600,
|
||||||
}
|
}.symbolize_keys
|
||||||
end
|
end
|
||||||
|
|
||||||
def best_book_fit(reading_time)
|
def best_book_fit(reading_time)
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
POSTING CALENDAR
|
@ -0,0 +1 @@
|
|||||||
|
READING TIME
|
@ -16,14 +16,7 @@
|
|||||||
<div class="rewind__wrapper">
|
<div class="rewind__wrapper">
|
||||||
<div class="rewind">
|
<div class="rewind">
|
||||||
<%- @reports.each do |report| %>
|
<%- @reports.each do |report| %>
|
||||||
<div class="rewind__report">
|
<%= render report[:identifier] %>
|
||||||
<div class="rewind__report__header">
|
|
||||||
<%= report[:identifier] %>
|
|
||||||
</div>
|
|
||||||
<div class="rewind__report__body">
|
|
||||||
<%= report[:data][:count] %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%- end %>
|
<%- end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user