summaryrefslogtreecommitdiff
path: root/src/http/tpl/post-assets-manage.html
blob: 7e01ff4ecc2c30f721fa37045bf45eb3585e65a1 (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
58
59
{{ define "body" }}

{{ $assetIDs := .GetPostAssetIDs }}

<p>
  <a href="{{ .RootURL.Path "admin" }}">Back to Admin</a>
</p>

<h1>Assets</h1>

<h2>Upload Asset</h2>

<p>
  If the given ID is the same as an existing asset's ID, then that asset will be
  overwritten.
</p>

<form action="{{ .RootURL.Assets }}" method="POST" enctype="multipart/form-data">
  <div class="row">
    <div class="four columns">
      <input type="text" placeholder="Unique ID" name="id" />
    </div>
    <div class="four columns">
      <input type="file" name="file" /><br/>
    </div>
    <div class="four columns">
      <input type="submit" value="Upload" />
    </div>
  </div>
</form>

{{ if $assetIDs }}

<h2>Existing Assets</h2>

<table>

  {{ range $assetIDs }}
    <tr>
      <td><a href="{{ $.RootURL.Asset . }}">{{ . }}</a></td>
      <td>
        <form
          action="{{ ($.RootURL.Asset .).MethodDelete }}"
          method="POST"
          style="margin-bottom: 0;"
          >
          <input type="submit" value="Delete" />
        </form>
      </td>
    </tr>
  {{ end }}

</table>

{{ end }}

{{ end }}

{{ template "base.html" . }}