blob: 2226a83cb98bd671636db37a255200548234f260 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
{{ template "layout.html" . }}
{{ define "content" }}
<table class="admin">
<tr>
<td>
{{ if .LastPaperDL }}
{{ .Status }} (<a style="text-decoration: underline;" href="/download/{{ .LastPaperDL }}">download</a>)
{{ else }}
{{ .Status }}
{{ end }}
</td>
</tr>
<tr>
<td>
<form method='post' action='/admin/add/'>
<input type='text' name='new-category' placeholder="Mathematics" value=''/>
<input type="submit" value="New Category" />
</form>
</td>
</tr>
{{ $categoryCount := len .Papers.List }}
{{ if gt $categoryCount 0 }}
<tr>
<td>
<form method='post' action='/admin/add/'>
<input type='text' name='dl-paper' placeholder="URL or DOI" value=''/>
<select class="sel" name="dl-category" id="category">
{{ $lastUsedCategory := .LastUsedCategory }}
{{ if $lastUsedCategory }}
<option value="{{ .LastUsedCategory }}">{{ $lastUsedCategory }}</option>
{{ end }}
{{ range $category, $papers := .Papers.List }}
{{ if ne $category $lastUsedCategory }}
<option value="{{ $category }}">{{ $category }}</option>
{{ end }}
{{ end }}
</select>
<input type="submit" value="Download" />
</form>
</td>
</tr>
{{ end }}
</table>
{{ if gt $categoryCount 0 }}
<div class="cat-cont">
<div class="cat">
{{ range $category, $paper := .Papers.List }}
<span class="cat"><a href="#{{ $category }}">{{ $category }}</a></span>
{{ end }}
</div>
</div>
<p class="Pp"><a class='active' href='/admin/edit/'>Edit</a></p>
<div class='content'>
{{ block "list" . }}{{ end }}
</div>
{{ end }}
{{ end }}
|