diff options
author | Jordan <me@jordan.im> | 2021-12-20 14:09:46 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2021-12-20 14:09:46 -0700 |
commit | b8cd19d3ccba302a8f45467bff6a1cd7841a3ef2 (patch) | |
tree | dc2023db679a948e13fe31a87ec6d819a470971a | |
parent | e75d842f662d9d6a95da6e2ac7a6ee2afdde2115 (diff) | |
download | keep-b8cd19d3ccba302a8f45467bff6a1cd7841a3ef2.tar.gz keep-b8cd19d3ccba302a8f45467bff6a1cd7841a3ef2.zip |
web: housekeeping
-rw-r--r-- | web.go | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -36,6 +36,7 @@ const index = ` display: block; font-family: monospace; white-space: wrap; + text-align: center; } div{ margin: 1em 0; @@ -73,16 +74,16 @@ const index = ` </head> <body> <div> - <h1 style="text-align:center;">Keep</h1> - <p style="text-align: center;">{{- .Err -}}</p> - <p style="text-align: center;"> + <h1>Keep</h1> + <p>{{- .Err -}}</p> + <p> <b>{{- .Stats.URLs -}}</b> URLs, <b>{{- .Stats.Users -}}</b> users, <b>{{- .Stats.Guilds -}}</b> guilds, <b>{{- .Stats.Channels -}}</b> channels </p> <div style="padding-top:5px; padding-bottom:5px;"> - <form action="" method="get" style="text-align:center;"> + <form action="" method="get"> <label for="user">User:</label> <input type="text" id="user" name="user"> <label for="guild">Guild:</label> @@ -92,7 +93,7 @@ const index = ` <input type="submit" value="Filter"> </form> </div> - <p style="text-align: center;"> + <p> {{- if or (ne .User "") (ne .Guild "") (ne .Channel "") -}} Entries filtered by: {{- end -}} @@ -100,6 +101,7 @@ const index = ` {{- if ne .Guild "" }} <b>Guild</b> ({{ .Guild -}}){{- end -}} {{- if ne .Channel "" }} <b>Channel</b> ({{ .Channel -}}){{- end -}} </p> + {{- if gt (len .Entries) 0 -}} <div id="navigate"> {{- if gt .Offset 0 -}} <a href="{{ setQuery .URL "offset" (intToStr (subtract .Offset 100)) }}">Previous</a> @@ -129,6 +131,11 @@ const index = ` {{- end -}} </table> </div> + {{- else -}} + <p>No results to display</p> + <p><a href="./">Home</a></p> + {{- end -}} + {{- if gt (len .Entries) 0 -}} <div id="navigate"> {{- if gt .Offset 0 -}} <a href="{{ setQuery .URL "offset" (intToStr (subtract .Offset 100)) }}">Previous</a> @@ -138,6 +145,7 @@ const index = ` <a href="{{ setQuery .URL "offset" (intToStr (add .Offset 100)) }}">Next</a> {{- end -}} </div> + {{- end -}} </body> </html> ` |