summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl/edit-post.html
blob: 708858d225ce4154a0b2ec42ea7218fca70f252f (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{{ define "body" }}

  <p>
    <a href="{{ BlogURL "posts/" }}">
      <button>Back to Posts</button>
    </a>
  </p>

  <form method="POST" action="{{ BlogURL "posts/" }}">

    {{ .CSRFFormInput }}

    <div class="row">

      <div class="columns six">
        <label for="idInput">Unique ID</label>
        {{ if eq .Payload.ID "" }}
          <input
              id="idInput"
              name="id"
              class="u-full-width"
              type="text"
              placeholder="e.g. how-to-fly-a-kite"
              value="{{ .Payload.ID }}" />
        {{ else }}
          <a href="{{ PostURL .Payload.ID }}" target="_blank">{{ .Payload.ID }}</a>
          <input name="id" type="hidden" value="{{ .Payload.ID }}" />
        {{ end }}
      </div>

      <div class="columns three">
        <label for="tagsInput">Tags (space separated)</label>
        <input
            id="tagsInput"
            name="tags"
            class="u-full-width"
            type="text"
            value="{{ range $i, $tag := .Payload.Tags }}{{ if ne $i 0 }} {{ end }}{{ $tag }}{{ end }}" />
      </div>

      <div class="columns three">
        <label for="seriesInput">Series</label>
        <input
            id="seriesInput"
            name="series"
            class="u-full-width"
            type="text"
            value="{{ .Payload.Series }}" />
      </div>

    </div>

    <div class="row">

      <div class="columns six">
        <label for="titleInput">Title</label>
        <input
            id="titleInput"
            name="title"
            class="u-full-width"
            type="text"
            value="{{ .Payload.Title }}" />
      </div>

      <div class="columns six">
        <label for="descrInput">Description</label>
        <input
            id="descrInput"
            name="description"
            class="u-full-width"
            type="text"
            value="{{ .Payload.Description }}" />
      </div>

    </div>

    <div class="row">
      <div class="columns twelve">
       <textarea
         name="body"
         class="u-full-width"
         placeholder="Blog body"
         style="height: 50vh;"
         >
         {{- .Payload.Body -}}
       </textarea>
      </div>
    </div>

    <input type="submit" value="Save" />

  </form>

{{ end }}

{{ template "base.html" . }}