aboutsummaryrefslogtreecommitdiff
path: root/templates/admin.html
blob: b3d24274dc9248dddf4203734ee723259dcef3e8 (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" }}
<div class="header-desc">
{{ block "topics" . }}{{ end }}
<table>
  {{ if .Status }}
  <tr>
  <td>
    {{ if .LastPaperDL }}
    {{ .Status }} (<a href="/download/{{ .LastPaperDL }}">download</a>)
    {{ else }}
    {{ .Status }}
    {{ end }}
  </td>
  </tr>
  {{ end }}
  <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 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>
</div>
<p><a href='/admin/edit/'>Edit</a></p>
<div class='content'>
{{ block "list" . }}{{ end }}
</div>
{{ end }}