diff --git a/database/query.sql b/database/query.sql index 681baca..c721c1e 100644 --- a/database/query.sql +++ b/database/query.sql @@ -314,22 +314,22 @@ SELECT CAST(SUM(total_words_read) AS INTEGER) AS total_words_read, CAST(SUM(total_time_seconds) AS INTEGER) AS total_seconds, - ROUND(CAST(SUM(total_words_read) AS REAL) / (SUM(total_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(total_words_read) AS REAL) / (SUM(total_time_seconds) / 60.0), 0.0), 2) AS total_wpm, CAST(SUM(yearly_words_read) AS INTEGER) AS yearly_words_read, CAST(SUM(yearly_time_seconds) AS INTEGER) AS yearly_seconds, - ROUND(CAST(SUM(yearly_words_read) AS REAL) / (SUM(yearly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(yearly_words_read) AS REAL) / (SUM(yearly_time_seconds) / 60.0), 0.0), 2) AS yearly_wpm, CAST(SUM(monthly_words_read) AS INTEGER) AS monthly_words_read, CAST(SUM(monthly_time_seconds) AS INTEGER) AS monthly_seconds, - ROUND(CAST(SUM(monthly_words_read) AS REAL) / (SUM(monthly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(monthly_words_read) AS REAL) / (SUM(monthly_time_seconds) / 60.0), 0.0), 2) AS monthly_wpm, CAST(SUM(weekly_words_read) AS INTEGER) AS weekly_words_read, CAST(SUM(weekly_time_seconds) AS INTEGER) AS weekly_seconds, - ROUND(CAST(SUM(weekly_words_read) AS REAL) / (SUM(weekly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(weekly_words_read) AS REAL) / (SUM(weekly_time_seconds) / 60.0), 0.0), 2) AS weekly_wpm FROM document_user_statistics diff --git a/database/query.sql.go b/database/query.sql.go index c341da3..a2da4fb 100644 --- a/database/query.sql.go +++ b/database/query.sql.go @@ -977,22 +977,22 @@ SELECT CAST(SUM(total_words_read) AS INTEGER) AS total_words_read, CAST(SUM(total_time_seconds) AS INTEGER) AS total_seconds, - ROUND(CAST(SUM(total_words_read) AS REAL) / (SUM(total_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(total_words_read) AS REAL) / (SUM(total_time_seconds) / 60.0), 0.0), 2) AS total_wpm, CAST(SUM(yearly_words_read) AS INTEGER) AS yearly_words_read, CAST(SUM(yearly_time_seconds) AS INTEGER) AS yearly_seconds, - ROUND(CAST(SUM(yearly_words_read) AS REAL) / (SUM(yearly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(yearly_words_read) AS REAL) / (SUM(yearly_time_seconds) / 60.0), 0.0), 2) AS yearly_wpm, CAST(SUM(monthly_words_read) AS INTEGER) AS monthly_words_read, CAST(SUM(monthly_time_seconds) AS INTEGER) AS monthly_seconds, - ROUND(CAST(SUM(monthly_words_read) AS REAL) / (SUM(monthly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(monthly_words_read) AS REAL) / (SUM(monthly_time_seconds) / 60.0), 0.0), 2) AS monthly_wpm, CAST(SUM(weekly_words_read) AS INTEGER) AS weekly_words_read, CAST(SUM(weekly_time_seconds) AS INTEGER) AS weekly_seconds, - ROUND(CAST(SUM(weekly_words_read) AS REAL) / (SUM(weekly_time_seconds) / 60.0), 2) + ROUND(COALESCE(CAST(SUM(weekly_words_read) AS REAL) / (SUM(weekly_time_seconds) / 60.0), 0.0), 2) AS weekly_wpm FROM document_user_statistics diff --git a/templates/pages/home.html b/templates/pages/home.html index 4971e98..7bba5c4 100644 --- a/templates/pages/home.html +++ b/templates/pages/home.html @@ -1,6 +1,8 @@ -{{template "base" .}} {{define "title"}}Home{{end}} {{define "header"}} -Home -{{end}} {{define "content"}} +{{template "base" .}} +{{define "title"}}Home{{end}} +{{define "header"}}Home{{end}} + +{{define "content"}}
@@ -211,19 +191,19 @@ Current Daily Streak {{ end }}
- {{ if eq $item.Window "WEEK" }} Best Weekly Streak {{ else }} - Best Daily Streak {{ end }} + {{ if eq $item.Window "WEEK" }} + Best Weekly Streak + {{ else }} + Best Daily Streak + {{ end }}