aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2021-03-14 13:43:03 -0700
committerJordan <me@jordan.im>2021-03-14 13:43:03 -0700
commitf03d77f73be72a934a99541b30a9663cc99a1733 (patch)
tree5065869c40492ebb917e825b6bcf0075b5117a17 /templates
parentc0271039935407c232270cef74cd2f559f77a64e (diff)
downloadcrane-f03d77f73be72a934a99541b30a9663cc99a1733.tar.gz
crane-f03d77f73be72a934a99541b30a9663cc99a1733.zip
r/w map locks; concurrent safety
Diffstat (limited to 'templates')
-rw-r--r--templates/admin-edit.html10
-rw-r--r--templates/admin.html6
-rw-r--r--templates/index.html4
-rw-r--r--templates/list.html2
4 files changed, 11 insertions, 11 deletions
diff --git a/templates/admin-edit.html b/templates/admin-edit.html
index 57a9aaa..7b30294 100644
--- a/templates/admin-edit.html
+++ b/templates/admin-edit.html
@@ -3,13 +3,13 @@
<p>{{ .Status }}</p>
<table id='header'>
<tr>
- {{ $categoryCount := len .Papers }}
+ {{ $categoryCount := len .Papers.List }}
{{ if gt $categoryCount 0 }}
<td class='inpt'>
<form method='post' action='/admin/edit/'>
<input type="text" id="rename-category" name="rename-to" placeholder="Mathematics">
<select class="sel" name="rename-category" id="category">
- {{ range $category, $papers := .Papers }}
+ {{ range $category, $papers := .Papers.List }}
<option value="{{ $category }}">{{ $category }}</option>
{{ end }}
</select>
@@ -20,7 +20,7 @@
</tr>
</table>
<div class="cat">
- <span>{{ range $category, $paper := .Papers }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
+ <span>{{ range $category, $paper := .Papers.List }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
</div>
<table class='tabs'>
<tr>
@@ -36,7 +36,7 @@
<option value="delete">Delete</option>
</optgroup>
<optgroup label="Move To">
- {{ range $category, $papers := .Papers }}
+ {{ range $category, $papers := .Papers.List }}
<option value="move-{{ $category }}">{{ $category }}</option>
{{ end }}
</optgroup>
@@ -44,7 +44,7 @@
<input class="btn" type="submit" value="Save" />
</div>
<div class='papers nowrap list'>
-{{ range $category, $papers := .Papers }}
+{{ range $category, $papers := .Papers.List }}
{{ $paperCount := len $papers }}
<div class="papersection">
<input type="checkbox" id="{{ $category }}" name="category" value="{{ $category }}">
diff --git a/templates/admin.html b/templates/admin.html
index 22b0e0a..05cf04f 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -14,7 +14,7 @@
</form>
</td>
</tr>
- {{ $categoryCount := len .Papers }}
+ {{ $categoryCount := len .Papers.List }}
{{ if gt $categoryCount 0 }}
<tr>
<td class='inpt'>
@@ -25,7 +25,7 @@
{{ if $lastUsedCategory }}
<option value="{{ .LastUsedCategory }}">{{ $lastUsedCategory }}</option>
{{ end }}
- {{ range $category, $papers := .Papers }}
+ {{ range $category, $papers := .Papers.List }}
{{ if ne $category $lastUsedCategory }}
<option value="{{ $category }}">{{ $category }}</option>
{{ end }}
@@ -39,7 +39,7 @@
</table>
{{ if gt $categoryCount 0 }}
<div class="cat">
- <span>{{ range $category, $paper := .Papers }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
+ <span>{{ range $category, $paper := .Papers.List }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
</div>
<table class='tabs'>
<tr>
diff --git a/templates/index.html b/templates/index.html
index 30023cd..6397671 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,10 +2,10 @@
{{ define "content" }}
<table id='header'>
</table>
-{{ $categoryCount := len .Papers }}
+{{ $categoryCount := len .Papers.List }}
{{ if gt $categoryCount 0 }}
<div class="cat">
- <span>{{ range $category, $paper := .Papers }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
+ <span>{{ range $category, $paper := .Papers.List }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
</div>
<table class='tabs'>
<td><a class='active' href='/admin/'>Manage</a></td>
diff --git a/templates/list.html b/templates/list.html
index 9e139b9..a08efd6 100644
--- a/templates/list.html
+++ b/templates/list.html
@@ -1,6 +1,6 @@
{{ define "list" }}
<div class='papers nowrap list'>
-{{ range $category, $papers := .Papers }}
+{{ range $category, $papers := .Papers.List }}
{{ $paperCount := len $papers }}
{{ if ge $paperCount 1 }}
<div class="papersection">