hatecomputers.club/templates/kennel_cats.html

67 lines
1.9 KiB
HTML
Raw Permalink Normal View History

{{ define "content" }}
<table>
<tr>
<th>name.</th>
<th>link.</th>
<th>description.</th>
<th>spritesheet.</th>
<th>created at.</th>
<th>remove.</th>
</tr>
{{ if (eq (len .Cats) 0) }}
<tr>
<td colspan="6"><span class="blinky">no cats found</span></td>
</tr>
{{ end }}
{{ range $cat := .Cats }}
<tr>
<td>{{ $cat.Name }}</td>
<td><a href="{{ $cat.Link }}">{{ $cat.Link }}</a></td>
<td>{{ $cat.Description }}</td>
<td><a href="{{ $cat.Spritesheet }}"><img width="100" src="{{ $cat.Spritesheet }}"></a></td>
<td class="time">{{ $cat.CreatedAt }}</td>
<td>
<form method="POST" action="/kennel/cats/delete">
<input type="hidden" name="id" value="{{ $cat.ID }}" />
<input type="submit" value="remove." />
</form>
</td>
</tr>
{{ end }}
</table>
<br>
<form method="POST" action="/kennel/cats" class="form" enctype="multipart/form-data">
<h2>add cat.</h2>
<hr>
<label for="name">name.</label>
<input type="text" name="name" id="name"
{{ if not .CatForm }}
placeholder="wallace."
{{ else }}
value="{{ .CatForm.Name }}"
{{ end }}
/>
<label for="description">description.</label>
<input type="text" name="description" id="description"
{{ if not .CatForm }}
placeholder="a cat."
{{ else }}
value="{{ .CatForm.Description }}"
{{ end }}
/>
<label for="link">link.</label>
<input type="text" name="link" id="link"
{{ if not .CatForm }}
placeholder="https://hatecomputers.club"
{{ else }}
value="{{ .CatForm.Link }}"
{{ end }}/>
<label for="spritesheet" style="margin:0">spritesheet.</label>
<h6>if not specified, will use <a href="/static/img/cat_spritesheets/default.gif">the default</a>. check it out for the format we expect. max 50KB.</h6>
<input type="file" name="spritesheet" id="spritesheet" />
<input type="submit" value="mrow." />
</form>
{{ end }}