blob: 05cf04fd64754a98348be72e4b98153f26ab5529 (
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
|
{{ template "layout.html" . }}
{{ define "content" }}
{{ if .LastPaperDL }}
<p>{{ .Status }} (<a style="text-decoration: underline;" href="/download/{{ .LastPaperDL }}">download</a>)</p>
{{ else }}
<p>{{ .Status }}</p>
{{ end }}
<table id='header'>
<tr>
<td class='inpt'>
<form method='post' action='/admin/add/'>
<input type='text' name='new-category' placeholder="Mathematics" value=''/>
<input class='btn' type="submit" value="New Category" />
</form>
</td>
</tr>
{{ $categoryCount := len .Papers.List }}
{{ if gt $categoryCount 0 }}
<tr>
<td class='inpt'>
<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 class="btn" type="submit" value="Download" />
</form>
</td>
</tr>
{{ end }}
</table>
{{ if gt $categoryCount 0 }}
<div class="cat">
<span>{{ range $category, $paper := .Papers.List }}[<a href="#{{ $category }}">{{ $category }}</a>] {{ end }}</span>
</div>
<table class='tabs'>
<tr>
<td><a class='active' href='/admin/edit/'>Edit</a></td>
</tr>
</table>
<div class='content'>
{{ block "list" . }}{{ end }}
</div>
{{ end }}
{{ end }}
|