From 45cef2f4af3fdc751ff8a689f222c12b941be366 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Wed, 24 Jan 2024 21:40:14 -0500 Subject: [PATCH] chore(formatting): djlint templates --- .djlintrc | 14 + api/api.go | 2 +- tailwind.config.js | 2 +- templates/base.html | 306 ---------------- templates/base.tmpl | 279 ++++++++++++++ templates/components/download-progress.html | 40 -- templates/components/download-progress.tmpl | 22 ++ templates/components/leaderboard-card.html | 101 ------ templates/components/leaderboard-card.tmpl | 64 ++++ templates/pages/activity.html | 49 --- templates/pages/activity.tmpl | 44 +++ templates/pages/admin-logs.html | 15 - templates/pages/admin-logs.tmpl | 11 + templates/pages/admin-users.html | 50 --- templates/pages/admin-users.tmpl | 45 +++ templates/pages/admin.html | 190 ---------- templates/pages/admin.tmpl | 129 +++++++ templates/pages/document.html | 382 -------------------- templates/pages/document.tmpl | 299 +++++++++++++++ templates/pages/documents.html | 141 -------- templates/pages/documents.tmpl | 120 ++++++ templates/pages/error.html | 56 --- templates/pages/error.tmpl | 31 ++ templates/pages/home.html | 243 ------------- templates/pages/home.tmpl | 160 ++++++++ templates/pages/login.html | 211 ----------- templates/pages/login.tmpl | 173 +++++++++ templates/pages/progress.html | 49 --- templates/pages/progress.tmpl | 44 +++ templates/pages/search.html | 155 -------- templates/pages/search.tmpl | 109 ++++++ templates/pages/settings.html | 165 --------- templates/pages/settings.tmpl | 124 +++++++ 33 files changed, 1670 insertions(+), 2155 deletions(-) create mode 100644 .djlintrc delete mode 100644 templates/base.html create mode 100644 templates/base.tmpl delete mode 100644 templates/components/download-progress.html create mode 100644 templates/components/download-progress.tmpl delete mode 100644 templates/components/leaderboard-card.html create mode 100644 templates/components/leaderboard-card.tmpl delete mode 100644 templates/pages/activity.html create mode 100644 templates/pages/activity.tmpl delete mode 100644 templates/pages/admin-logs.html create mode 100644 templates/pages/admin-logs.tmpl delete mode 100644 templates/pages/admin-users.html create mode 100644 templates/pages/admin-users.tmpl delete mode 100644 templates/pages/admin.html create mode 100644 templates/pages/admin.tmpl delete mode 100644 templates/pages/document.html create mode 100644 templates/pages/document.tmpl delete mode 100644 templates/pages/documents.html create mode 100644 templates/pages/documents.tmpl delete mode 100644 templates/pages/error.html create mode 100644 templates/pages/error.tmpl delete mode 100644 templates/pages/home.html create mode 100644 templates/pages/home.tmpl delete mode 100644 templates/pages/login.html create mode 100644 templates/pages/login.tmpl delete mode 100644 templates/pages/progress.html create mode 100644 templates/pages/progress.tmpl delete mode 100644 templates/pages/search.html create mode 100644 templates/pages/search.tmpl delete mode 100644 templates/pages/settings.html create mode 100644 templates/pages/settings.tmpl diff --git a/.djlintrc b/.djlintrc new file mode 100644 index 0000000..342e4cd --- /dev/null +++ b/.djlintrc @@ -0,0 +1,14 @@ +{ + "profile": "golang", + "indent": 2, + "close_void_tags": true, + "format_attribute_template_tags": true, + "format_js": true, + "js": { + "indent_size": 2 + }, + "format_css": true, + "css": { + "indent_size": 2 + } +} diff --git a/api/api.go b/api/api.go index e81d73f..ea1cd00 100644 --- a/api/api.go +++ b/api/api.go @@ -191,7 +191,7 @@ func (api *API) generateTemplates() *multitemplate.Renderer { } // Load Base - b, _ := api.Assets.ReadFile("templates/base.html") + b, _ := api.Assets.ReadFile("templates/base.tmpl") baseTemplate := template.Must(template.New("base").Funcs(helperFuncs).Parse(string(b))) // Load SVGs diff --git a/tailwind.config.js b/tailwind.config.js index 2a6461e..06eb819 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,7 +1,7 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - "./templates/**/*.{html,htm,svg}", + "./templates/**/*.{tmpl,html,htm,svg}", "./assets/local/*.{html,htm,svg,js}", "./assets/reader/*.{html,htm,svg,js}", ], diff --git a/templates/base.html b/templates/base.html deleted file mode 100644 index 24ed9b8..0000000 --- a/templates/base.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - AnthoLume - {{block "title" .}}{{end}} - - - - - - - - - - - - -
- -

{{block "header" .}}{{end}}

-
- {{ template "svg/user" (dict "Size" 20) }} - - - -
-
- -
-
- {{block "content" .}}{{end}} -
-
- - diff --git a/templates/base.tmpl b/templates/base.tmpl new file mode 100644 index 0000000..a84e2ab --- /dev/null +++ b/templates/base.tmpl @@ -0,0 +1,279 @@ + + + + + + + + + + AnthoLume - {{ block "title" . }}{{ end }} + + + + + + + + + +
+
+ + + + + +
+

{{ block "header" . }}{{ end }}

+
+ {{ template "svg/user" (dict "Size" 20) }} + + + +
+
+
+
{{ block "content" . }}{{ end }}
+
+ + diff --git a/templates/components/download-progress.html b/templates/components/download-progress.html deleted file mode 100644 index ffbd847..0000000 --- a/templates/components/download-progress.html +++ /dev/null @@ -1,40 +0,0 @@ -
- - {{ if and (ne .Progress 100) (not .Error) }} - {{ template "svg/loading" (dict "Size" 16) }} - {{ end }} - - {{ .Message }} - -
-
- - {{ if .Error }} -
-

ERROR

- {{ else }} -
-

- {{ .Progress }}% -

- {{ end }} - -
- - {{ .ButtonText }} -
-
diff --git a/templates/components/download-progress.tmpl b/templates/components/download-progress.tmpl new file mode 100644 index 0000000..23fca57 --- /dev/null +++ b/templates/components/download-progress.tmpl @@ -0,0 +1,22 @@ +
+ + {{ if and (ne .Progress 100) (not .Error) }} + {{ template "svg/loading" (dict "Size" 16) }} + {{ end }} + {{ .Message }} + +
+
+ {{ if .Error }} +
+

ERROR

+ {{ else }} +
+

{{ .Progress }}%

+ {{ end }} +
+ {{ .ButtonText }} +
+
diff --git a/templates/components/leaderboard-card.html b/templates/components/leaderboard-card.html deleted file mode 100644 index 793950c..0000000 --- a/templates/components/leaderboard-card.html +++ /dev/null @@ -1,101 +0,0 @@ -
-
-
-
-

- {{ .Name }} Leaderboard -

-
- - - - -
-
-
- - - - - - - {{ range $key, $data := .Data }} - - -
diff --git a/templates/components/leaderboard-card.tmpl b/templates/components/leaderboard-card.tmpl new file mode 100644 index 0000000..5b43185 --- /dev/null +++ b/templates/components/leaderboard-card.tmpl @@ -0,0 +1,64 @@ +
+
+
+
+

+ {{ .Name }} Leaderboard +

+
+ + + + +
+
+
+ + + + + {{ range $key, $data := .Data }} + + +
diff --git a/templates/pages/activity.html b/templates/pages/activity.html deleted file mode 100644 index dbe0009..0000000 --- a/templates/pages/activity.html +++ /dev/null @@ -1,49 +0,0 @@ -{{template "base" .}} {{define "title"}}Activity{{end}} {{define "header"}} -Activity -{{end}} {{define "content"}} -
-
- - - - - - - - - - - {{ if not .Data }} - - - - {{ end }} - {{range $activity := .Data }} - - - - - - - {{end}} - -
- Document - - Time - - Duration - - Percent -
No Results
- {{ $activity.Author }} - {{ $activity.Title }}

-
-

{{ $activity.StartTime }}

-
-

{{ $activity.Duration }}

-
-

{{ $activity.EndPercentage }}%

-
-
-
-{{end}} diff --git a/templates/pages/activity.tmpl b/templates/pages/activity.tmpl new file mode 100644 index 0000000..eac9de5 --- /dev/null +++ b/templates/pages/activity.tmpl @@ -0,0 +1,44 @@ +{{ template "base" . }} +{{ define "title" }}Activity{{ end }} +{{ define "header" }}Activity{{ end }} +{{ define "content" }} +
+
+ + + + + + + + + + + {{ if not .Data }} + + + + {{ end }} + {{ range $activity := .Data }} + + + + + + + {{ end }} + +
DocumentTimeDurationPercent
No Results
+ {{ $activity.Author }} - {{ $activity.Title }} +

+
+
+

{{ $activity.StartTime }}

+
+

{{ $activity.Duration }}

+
+

{{ $activity.EndPercentage }}%

+
+
+
+{{ end }} diff --git a/templates/pages/admin-logs.html b/templates/pages/admin-logs.html deleted file mode 100644 index d8a013d..0000000 --- a/templates/pages/admin-logs.html +++ /dev/null @@ -1,15 +0,0 @@ -{{template "base" .}} {{define "title"}}Admin - Logs{{end}} {{define -"header"}} -Admin - Logs -{{end}} {{define "content"}} - -
- {{range $log := .Data }} - {{ $log }} - {{end}} -
- -{{end}} diff --git a/templates/pages/admin-logs.tmpl b/templates/pages/admin-logs.tmpl new file mode 100644 index 0000000..4a6ccb6 --- /dev/null +++ b/templates/pages/admin-logs.tmpl @@ -0,0 +1,11 @@ +{{ template "base" . }} +{{ define "title" }}Admin - Logs{{ end }} +{{ define "header" }}Admin - Logs{{ end }} +{{ define "content" }} +
+ {{ range $log := .Data }} + {{ $log }} + {{ end }} +
+{{ end }} diff --git a/templates/pages/admin-users.html b/templates/pages/admin-users.html deleted file mode 100644 index 7051ee1..0000000 --- a/templates/pages/admin-users.html +++ /dev/null @@ -1,50 +0,0 @@ -{{template "base" .}} {{define "title"}}Admin - Users{{end}} {{define "header"}} -Admin - Users -{{end}} {{define "content"}} -
-
- - - - - - - - - - - {{ if not .Data }} - - - - {{ end }} - {{range $user := .Data }} - - - - - - - {{end}} - -
- {{ template "svg/add" }} - - User - - Permissions - - Created -
No Results
- {{ template "svg/delete" }} - -

{{ $user.ID }}

-
- admin - user - -

{{ $user.CreatedAt }}

-
-
-
-{{end}} diff --git a/templates/pages/admin-users.tmpl b/templates/pages/admin-users.tmpl new file mode 100644 index 0000000..a74a747 --- /dev/null +++ b/templates/pages/admin-users.tmpl @@ -0,0 +1,45 @@ +{{ template "base" . }} +{{ define "title" }}Admin - Users{{ end }} +{{ define "header" }}Admin - Users{{ end }} +{{ define "content" }} +
+
+ + + + + + + + + + + {{ if not .Data }} + + + + {{ end }} + {{ range $user := .Data }} + + + + + + + {{ end }} + +
+ {{ template "svg/add" }} + User + Permissions + Created
No Results
{{ template "svg/delete" }} +

{{ $user.ID }}

+
+ admin + user + +

{{ $user.CreatedAt }}

+
+
+
+{{ end }} diff --git a/templates/pages/admin.html b/templates/pages/admin.html deleted file mode 100644 index 969e632..0000000 --- a/templates/pages/admin.html +++ /dev/null @@ -1,190 +0,0 @@ -{{template "base" .}} {{define "title"}}Admin - General{{end}} {{define -"header"}} -Admin - General -{{end}} {{define "content"}} -
-
-
- {{ template "svg/user" (dict "Size" 60) }} -

{{ .Authorization.UserName }}

-
-
- -
-
-

Import Documents

-
- -
-
- - {{ template "svg/import" (dict "Size" 15) }} - - -
-
-
- - -
-
- - -
-
-
- -
- {{ if .PasswordErrorMessage }} - {{ .PasswordErrorMessage }} - {{ else if .PasswordMessage }} - {{ .PasswordMessage }} - {{ end }} -
- -
-

Backup & Restore

-
-
- -
-
- - -
-
- - -
-
- -
-
- -
- -
- -
-
- {{ if .PasswordErrorMessage }} - {{ .PasswordErrorMessage }} - {{ else if .PasswordMessage }} - {{ .PasswordMessage }} - {{ end }} -
- -
-

Tasks

- - - - - - - - - - - - -
-

Metadata Matching

-
-
- - -
-
-

Cache Tables

-
-
- - -
-
-
-
-
-{{end}} diff --git a/templates/pages/admin.tmpl b/templates/pages/admin.tmpl new file mode 100644 index 0000000..1826b32 --- /dev/null +++ b/templates/pages/admin.tmpl @@ -0,0 +1,129 @@ +{{ template "base" . }} +{{ define "title" }}Admin - General{{ end }} +{{ define "header" }}Admin - General{{ end }} +{{ define "content" }} +
+
+
+ {{ template "svg/user" (dict "Size" 60) }} +

{{ .Authorization.UserName }}

+
+
+
+
+

Import Documents

+
+ +
+
+ + {{ template "svg/import" (dict "Size" 15) }} + + +
+
+
+ + +
+
+ + +
+
+
+ +
+ {{ if .PasswordErrorMessage }} + {{ .PasswordErrorMessage }} + {{ else if .PasswordMessage }} + {{ .PasswordMessage }} + {{ end }} +
+
+

Backup & Restore

+
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ +
+ +
+ +
+
+ {{ if .PasswordErrorMessage }} + {{ .PasswordErrorMessage }} + {{ else if .PasswordMessage }} + {{ .PasswordMessage }} + {{ end }} +
+
+

Tasks

+ + + + + + + + + + + +
+

Metadata Matching

+
+
+ + +
+
+

Cache Tables

+
+
+ + +
+
+
+
+
+{{ end }} diff --git a/templates/pages/document.html b/templates/pages/document.html deleted file mode 100644 index 151b56d..0000000 --- a/templates/pages/document.html +++ /dev/null @@ -1,382 +0,0 @@ -{{template "base" . }} - -{{define "title"}}Documents{{end}} - -{{define "header"}} -Documents -{{end}} - -{{define "content"}} -
- -
-
- - - {{ if .Data.Filepath }} - Read - {{ end }} - -
-
-
-

ISBN-10:

-

- {{ or .Data.Isbn10 "N/A" }} -

-
-
-

ISBN-13:

-

- {{ or .Data.Isbn13 "N/A" }} -

-
-
-
- -
-
- - -
-
- - -
-
-
- - -
-
- -
-
-
- {{ template "svg/activity" (dict "Size" 28) }} -
- - -
-
- - - - -
-
-
- {{ if .Data.Filepath }} - {{ template "svg/download" (dict "Size" 28) }} - {{ else }} - {{ template "svg/download" (dict "Size" 28 "Disabled" true) }} - {{ end }} -
-
-
-
-
-
-

Title

- - -
-
- - -
-
-
-

- {{ or .Data.Title "N/A" }} -

-
-
-
-

Author

- - - -
-
- - -
-
-
-

- {{ or .Data.Author "N/A" }} -

-
-
-
-

Time Read

- - -
-
-

Seconds / Percent

-

- {{ .Data.SecondsPerPercent }} -

-
-
-

Words / Minute

-

- {{ .Data.Wpm }} -

-
-
-

Est. Time Left

-

- {{ niceSeconds .TotalTimeLeftSeconds }} -

-
-
-
-

- {{ niceSeconds .Data.TotalTimeSeconds }} -

-
-
-

Progress

-

- {{ .Data.Percentage }}% -

-
-
- -
-
-

Description

- -
-
-
- -
- -
- - -
-
-

{{ or .Data.Description "N/A" }}

-
-
- - {{ if .MetadataError }} -
-
-
-
-

No Metadata Results Found

-
- Back to Document -
-
- {{ end }} - - - {{ if .Metadata }} -
-
-
-
-

Metadata Results

-
-
-
-
-
- Cover -
-
- -
-
-
-
- Title -
-
- {{ or .Metadata.Title "N/A" }} -
-
-
-
- Author -
-
- {{ or .Metadata.Author "N/A" }} -
-
-
-
- ISBN 10 -
-
- {{ or .Metadata.ISBN10 "N/A" }} -
-
-
-
- ISBN 13 -
-
- {{ or .Metadata.ISBN13 "N/A" }} -
-
-
-
- Description -
-
- {{ or .Metadata.Description "N/A" }} -
-
-
- -
-
- Cancel - -
-
-
- {{ end }} -
- - -{{end}} diff --git a/templates/pages/document.tmpl b/templates/pages/document.tmpl new file mode 100644 index 0000000..88e06c9 --- /dev/null +++ b/templates/pages/document.tmpl @@ -0,0 +1,299 @@ +{{ template "base" . }} +{{ define "title" }}Documents{{ end }} +{{ define "header" }}Documents{{ end }} +{{ define "content" }} +
+ +
+
+ + {{ if .Data.Filepath }} + Read + {{ end }} +
+
+
+

ISBN-10:

+

{{ or .Data.Isbn10 "N/A" }}

+
+
+

ISBN-13:

+

{{ or .Data.Isbn13 "N/A" }}

+
+
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+
+
+ {{ template "svg/activity" (dict "Size" 28) }} +
+ + +
+
+ + + + +
+
+
+ {{ if .Data.Filepath }} + {{ template "svg/download" (dict "Size" 28) }} + {{ else }} + {{ template "svg/download" (dict "Size" 28 "Disabled" true) }} + {{ end }} +
+
+
+
+
+
+

Title

+ + +
+
+ + +
+
+
+

{{ or .Data.Title "N/A" }}

+
+
+
+

Author

+ + +
+
+ + +
+
+
+

{{ or .Data.Author "N/A" }}

+
+
+
+

Time Read

+ + +
+
+

Seconds / Percent

+

{{ .Data.SecondsPerPercent }}

+
+
+

Words / Minute

+

{{ .Data.Wpm }}

+
+
+

Est. Time Left

+

{{ niceSeconds .TotalTimeLeftSeconds }}

+
+
+
+

{{ niceSeconds .Data.TotalTimeSeconds }}

+
+
+

Progress

+

{{ .Data.Percentage }}%

+
+
+
+
+

Description

+ +
+
+
+ +
+ +
+ + +
+
+

{{ or .Data.Description "N/A" }}

+
+
+ {{ if .MetadataError }} +
+
+
+
+

No Metadata Results Found

+
+ Back to Document +
+
+ {{ end }} + + {{ if .Metadata }} +
+
+
+
+

Metadata Results

+
+
+
+
+
Cover
+
+ +
+
+
+
Title
+
+ {{ or .Metadata.Title "N/A" }} +
+
+
+
Author
+
+ {{ or .Metadata.Author "N/A" }} +
+
+
+
ISBN 10
+
+ {{ or .Metadata.ISBN10 "N/A" }} +
+
+
+
ISBN 13
+
+ {{ or .Metadata.ISBN13 "N/A" }} +
+
+
+
Description
+
+ {{ or .Metadata.Description "N/A" }} +
+
+
+ +
+
+ Cancel + +
+
+
+ {{ end }} +
+ +{{ end }} diff --git a/templates/pages/documents.html b/templates/pages/documents.html deleted file mode 100644 index 9f81336..0000000 --- a/templates/pages/documents.html +++ /dev/null @@ -1,141 +0,0 @@ -{{template "base" .}} - -{{define "title"}}Documents{{end}} - -{{define "header"}} -Documents -{{end}} - -{{define "content"}} -
-
-
-
- - {{ template "svg/search2" (dict "Size" 15) }} - - -
-
- - -
-
- -
- {{range $doc := .Data }} -
-
-
- - - -
-
-
-
-

Title

-

- {{ or $doc.Title "Unknown" }} -

-
-
-
-
-

Author

-

- {{ or $doc.Author "Unknown" }} -

-
-
-
-
-

Progress

-

- {{ $doc.Percentage }}% -

-
-
-
-
-

Time Read

-

- {{ niceSeconds $doc.TotalTimeSeconds }} -

-
-
-
-
- {{ template "svg/activity" }} - - {{ if $doc.Filepath }} - {{ template "svg/download" }} - {{ else }} - {{ template "svg/download" (dict "Disabled" true) }} - {{ end }} -
-
-
- {{end}} -
- -
- {{ if .PreviousPage }} - - {{ end }} - - {{ if .NextPage }} - - {{ end }} -
- -
- -
-
- - -
- -
- -
- - -{{end}} diff --git a/templates/pages/documents.tmpl b/templates/pages/documents.tmpl new file mode 100644 index 0000000..b336053 --- /dev/null +++ b/templates/pages/documents.tmpl @@ -0,0 +1,120 @@ +{{ template "base" . }} +{{ define "title" }}Documents{{ end }} +{{ define "header" }}Documents{{ end }} +{{ define "content" }} +
+
+
+
+ + {{ template "svg/search2" (dict "Size" 15) }} + + +
+
+ +
+
+
+ {{ range $doc := .Data }} +
+
+
+ + + +
+
+
+
+

Title

+

{{ or $doc.Title "Unknown" }}

+
+
+
+
+

Author

+

{{ or $doc.Author "Unknown" }}

+
+
+
+
+

Progress

+

{{ $doc.Percentage }}%

+
+
+
+
+

Time Read

+

{{ niceSeconds $doc.TotalTimeSeconds }}

+
+
+
+
+ {{ template "svg/activity" }} + {{ if $doc.Filepath }} + {{ template "svg/download" }} + {{ else }} + {{ template "svg/download" (dict "Disabled" true) }} + {{ end }} +
+
+
+ {{ end }} +
+
+ {{ if .PreviousPage }} + + {{ end }} + {{ if .NextPage }} + + {{ end }} +
+
+ +
+
+ + +
+ +
+ +
+ +{{ end }} diff --git a/templates/pages/error.html b/templates/pages/error.html deleted file mode 100644 index 579ed23..0000000 --- a/templates/pages/error.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - AnthoLume - Error - - - - - -
-
-

- {{ .Status }} -

-

- {{ .Error }} -

-

- {{ .Message }} -

- Back to Homepage -
-
- - diff --git a/templates/pages/error.tmpl b/templates/pages/error.tmpl new file mode 100644 index 0000000..6a64099 --- /dev/null +++ b/templates/pages/error.tmpl @@ -0,0 +1,31 @@ + + + + + + + + + + AnthoLume - Error + + + + +
+
+

{{ .Status }}

+

{{ .Error }}

+

{{ .Message }}

+ Back to Homepage +
+
+ + diff --git a/templates/pages/home.html b/templates/pages/home.html deleted file mode 100644 index 7bba5c4..0000000 --- a/templates/pages/home.html +++ /dev/null @@ -1,243 +0,0 @@ -{{template "base" .}} -{{define "title"}}Home{{end}} -{{define "header"}}Home{{end}} - -{{define "content"}} -
-
-
-

- Daily Read Totals -

- - {{ $data := (getSVGGraphData .Data.GraphData 800 70 )}} - - - - - - - {{ range $index, $item := $data.LinePoints }} - - - - - {{ (index $.Data.GraphData $index).Date }} - - - {{ (index $.Data.GraphData $index).MinutesRead }} minutes - - - {{ end }} - - - -
-
- - - -
- {{ range $item := .Data.Streaks }} -
-
-

- {{ if eq $item.Window "WEEK" }} - Weekly Read Streak - {{ else }} - Daily Read Streak - {{ end }} -

-
-

- {{ $item.CurrentStreak }} -

-
-
-
-
-

- {{ if eq $item.Window "WEEK" }} Current Weekly Streak {{ else }} - Current Daily Streak {{ end }} -

-
- {{ $item.CurrentStreakStartDate }} ➞ {{ $item.CurrentStreakEndDate }} -
-
-
{{ $item.CurrentStreak }}
-
-
-
-

- {{ if eq $item.Window "WEEK" }} - Best Weekly Streak - {{ else }} - Best Daily Streak - {{ end }} -

-
- {{ $item.MaxStreakStartDate }} ➞ {{ $item.MaxStreakEndDate }} -
-
-
{{ $item.MaxStreak }}
-
-
-
-
- {{ end }} -
- -
- {{ template "component/leaderboard-card" ( - dict - "Name" "WPM" - "Data" .Data.UserStatistics.WPM - ) - }} - - {{ template "component/leaderboard-card" ( - dict - "Name" "Duration" - "Data" .Data.UserStatistics.Duration - ) - }} - - {{ template "component/leaderboard-card" ( - dict - "Name" "Words" - "Data" .Data.UserStatistics.Words - ) - }} -
-
-{{end}} diff --git a/templates/pages/home.tmpl b/templates/pages/home.tmpl new file mode 100644 index 0000000..1cc118b --- /dev/null +++ b/templates/pages/home.tmpl @@ -0,0 +1,160 @@ +{{ template "base" . }} +{{ define "title" }}Home{{ end }} +{{ define "header" }}Home{{ end }} +{{ define "content" }} +
+
+
+

+ Daily Read Totals +

+ {{ $data := (getSVGGraphData .Data.GraphData 800 70 )}} + + + + + {{ range $index, $item := $data.LinePoints }} + + + + + {{ (index $.Data.GraphData $index).Date }} + + + {{ (index $.Data.GraphData $index).MinutesRead }} minutes + + + {{ end }} + + +
+
+ +
+ {{ range $item := .Data.Streaks }} +
+
+

+ {{ if eq $item.Window "WEEK" }} + Weekly Read Streak + {{ else }} + Daily Read Streak + {{ end }} +

+
+

{{ $item.CurrentStreak }}

+
+
+
+
+

+ {{ if eq $item.Window "WEEK" }} Current Weekly Streak {{ else }} + Current Daily Streak {{ end }} +

+
+ {{ $item.CurrentStreakStartDate }} ➞ {{ $item.CurrentStreakEndDate }} +
+
+
{{ $item.CurrentStreak }}
+
+
+
+

+ {{ if eq $item.Window "WEEK" }} + Best Weekly Streak + {{ else }} + Best Daily Streak + {{ end }} +

+
{{ $item.MaxStreakStartDate }} ➞ {{ $item.MaxStreakEndDate }}
+
+
{{ $item.MaxStreak }}
+
+
+
+
+ {{ end }} +
+
+ {{ template "component/leaderboard-card" (dict + "Name" "WPM" + "Data" .Data.UserStatistics.WPM + )}} + {{ template "component/leaderboard-card" (dict + "Name" "Duration" + "Data" .Data.UserStatistics.Duration + )}} + {{ template "component/leaderboard-card" (dict + "Name" "Words" + "Data" .Data.UserStatistics.Words + )}} +
+
+{{ end }} diff --git a/templates/pages/login.html b/templates/pages/login.html deleted file mode 100644 index 9f84ee6..0000000 --- a/templates/pages/login.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - AnthoLume - {{if .Register}}Register{{else}}Login{{end}} - - - - - - - - - - - - -
-
-
-

Welcome.

-
-
-
- - {{ template "svg/user" (dict "Size" 15) }} - - -
-
-
-
- - {{ template "svg/password" (dict "Size" 15) }} - - - {{ .Error }} -
-
- -
-
- {{ if .Config.RegistrationEnabled }} {{ if .Register }} -

- Trying to login? - - Login here. - -

- {{else}} -

- Don't have an account? - - Register here. - -

- {{end}} {{ end }} -

- - Offline / Local Mode - -

-
-
-
- -
- - - - - diff --git a/templates/pages/login.tmpl b/templates/pages/login.tmpl new file mode 100644 index 0000000..e134108 --- /dev/null +++ b/templates/pages/login.tmpl @@ -0,0 +1,173 @@ + + + + + + + + + + AnthoLume - {{ if .Register }}Register{{ else }}Login{{ end }} + + + + + + + + + +
+
+
+

Welcome.

+
+
+
+ + {{ template "svg/user" (dict "Size" 15) }} + + +
+
+
+
+ + {{ template "svg/password" (dict "Size" 15) }} + + + {{ .Error }} +
+
+ +
+
+ {{ if .Config.RegistrationEnabled }} {{ if .Register }} +

+ Trying to login? + Login here. +

+ {{ else }} +

+ Don't have an account? + Register here. +

+ {{ end }} {{ end }} +

+ Offline / Local Mode +

+
+
+
+ +
+ + + diff --git a/templates/pages/progress.html b/templates/pages/progress.html deleted file mode 100644 index 5baca70..0000000 --- a/templates/pages/progress.html +++ /dev/null @@ -1,49 +0,0 @@ -{{template "base" .}} {{define "title"}}Progress{{end}} {{define "header"}} -Progress -{{end}} {{define "content"}} -
-
- - - - - - - - - - - {{ if not .Data }} - - - - {{ end }} - {{range $progress := .Data }} - - - - - - - {{end}} - -
- Document - - Device - - Percent - - Time -
No Results
- {{ $progress.Author }} - {{ $progress.Title }}

-
-

{{ $progress.DeviceName }}

-
-

{{ $progress.Percentage }}%

-
-

{{ $progress.CreatedAt }}

-
-
-
-{{end}} diff --git a/templates/pages/progress.tmpl b/templates/pages/progress.tmpl new file mode 100644 index 0000000..7d23b0c --- /dev/null +++ b/templates/pages/progress.tmpl @@ -0,0 +1,44 @@ +{{ template "base" . }} +{{ define "title" }}Progress{{ end }} +{{ define "header" }}Progress{{ end }} +{{ define "content" }} +
+
+ + + + + + + + + + + {{ if not .Data }} + + + + {{ end }} + {{ range $progress := .Data }} + + + + + + + {{ end }} + +
DocumentDevicePercentTime
No Results
+ {{ $progress.Author }} - {{ $progress.Title }} +

+
+
+

{{ $progress.DeviceName }}

+
+

{{ $progress.Percentage }}%

+
+

{{ $progress.CreatedAt }}

+
+
+
+{{ end }} diff --git a/templates/pages/search.html b/templates/pages/search.html deleted file mode 100644 index 7cd5dcb..0000000 --- a/templates/pages/search.html +++ /dev/null @@ -1,155 +0,0 @@ -{{template "base" .}} {{define "title"}}Search{{end}} {{define "header"}} -Search -{{end}} {{define "content"}} -
-
-
-
-
-
- - {{ template "svg/search2" (dict "Size" 15) }} - - -
-
-
- - {{ template "svg/documents" (dict "Size" 15) }} - - -
- - -
- {{ if .SearchErrorMessage }} - {{ .SearchErrorMessage }} - {{ end }} -
-
- - - - - - - - - - - - - {{ if not .Data }} - - - - {{ end }} {{range $item := .Data }} - - - - - - - - - {{end}} - -
- Document - - Series - - Type - - Size -
No Results
-
- - - - -
-
- {{ $item.Author }} - {{ $item.Title }} - -

{{ or $item.Series "N/A" }}

-
-

{{ or $item.FileType "N/A" }}

-
-

{{ or $item.FileSize "N/A" }}

-
-
-
-
-{{end}} diff --git a/templates/pages/search.tmpl b/templates/pages/search.tmpl new file mode 100644 index 0000000..5d7e3d4 --- /dev/null +++ b/templates/pages/search.tmpl @@ -0,0 +1,109 @@ +{{ template "base" . }} +{{ define "title" }}Search{{ end }} +{{ define "header" }}Search{{ end }} +{{ define "content" }} +
+
+
+
+
+
+ + {{ template "svg/search2" (dict "Size" 15) }} + + +
+
+
+ + {{ template "svg/documents" (dict "Size" 15) }} + + +
+ +
+ {{ if .SearchErrorMessage }} + {{ .SearchErrorMessage }} + {{ end }} +
+
+ + + + + + + + + + + + + {{ if not .Data }} + + + + {{ end }} {{ range $item := .Data }} + + + + + + + + + {{ end }} + +
DocumentSeriesTypeSize
No Results
+
+ + + + +
+
{{ $item.Author }} - {{ $item.Title }} +

{{ or $item.Series "N/A" }}

+
+

{{ or $item.FileType "N/A" }}

+
+

{{ or $item.FileSize "N/A" }}

+
+
+
+
+{{ end }} diff --git a/templates/pages/settings.html b/templates/pages/settings.html deleted file mode 100644 index 97a0591..0000000 --- a/templates/pages/settings.html +++ /dev/null @@ -1,165 +0,0 @@ -{{template "base" .}} {{define "title"}}Settings{{end}} {{define "header"}} -Settings -{{end}} {{define "content"}} -
-
-
- {{ template "svg/user" (dict "Size" 60) }} -

{{ .Authorization.UserName }}

-
-
- -
-
-

Change Password

-
-
-
- - {{ template "svg/password" (dict "Size" 15) }} - - -
-
-
-
- - {{ template "svg/password" (dict "Size" 15) }} - - -
-
- -
- {{ if .PasswordErrorMessage }} - {{ .PasswordErrorMessage }} - {{ else if .PasswordMessage }} - {{ .PasswordMessage }} - {{ end }} -
- -
-

Change Time Offset

-
-
- - {{ template "svg/clock" (dict "Size" 15) }} - - -
- -
- - {{ if .TimeOffsetErrorMessage }} - {{ .TimeOffsetErrorMessage }} - {{ else if .TimeOffsetMessage }} - {{ .TimeOffsetMessage }} - {{ end }} -
- -
-

Devices

- - - - - - - - - - {{ if not .Data.Devices }} - - - - {{ end }} {{ range $device := .Data.Devices }} - - - - - - {{ end }} - -
- Name - - Last Sync - - Created -
No Results
-

{{ $device.DeviceName }}

-
-

{{ $device.LastSynced }}

-
-

{{ $device.CreatedAt }}

-
-
-
-
-{{end}} diff --git a/templates/pages/settings.tmpl b/templates/pages/settings.tmpl new file mode 100644 index 0000000..522cf13 --- /dev/null +++ b/templates/pages/settings.tmpl @@ -0,0 +1,124 @@ +{{ template "base" . }} +{{ define "title" }}Settings{{ end }} +{{ define "header" }}Settings{{ end }} +{{ define "content" }} +
+
+
+ {{ template "svg/user" (dict "Size" 60) }} +

{{ .Authorization.UserName }}

+
+
+
+
+

Change Password

+
+
+
+ + {{ template "svg/password" (dict "Size" 15) }} + + +
+
+
+
+ + {{ template "svg/password" (dict "Size" 15) }} + + +
+
+ +
+ {{ if .PasswordErrorMessage }} + {{ .PasswordErrorMessage }} + {{ else if .PasswordMessage }} + {{ .PasswordMessage }} + {{ end }} +
+
+

Change Time Offset

+
+
+ + {{ template "svg/clock" (dict "Size" 15) }} + + +
+ +
+ {{ if .TimeOffsetErrorMessage }} + {{ .TimeOffsetErrorMessage }} + {{ else if .TimeOffsetMessage }} + {{ .TimeOffsetMessage }} + {{ end }} +
+
+

Devices

+ + + + + + + + + + {{ if not .Data.Devices }} + + + + {{ end }} + {{ range $device := .Data.Devices }} + + + + + + {{ end }} + +
+ Name + + Last Sync + Created
No Results
+

{{ $device.DeviceName }}

+
+

{{ $device.LastSynced }}

+
+

{{ $device.CreatedAt }}

+
+
+
+
+{{ end }}