<html>
<head>
</head>
<body>
{{ $timeFormat := "Jan _2 15:04:05" }}
	<p>Create content:</p>
	<form action="/hugo/edit/new" method="POST">
		<label>Name: <input type="text" name="name" /></label>
		<select name="type">
		    {{- range .ContentTypes }}
			<option value="{{ . }}">{{ . }}</option>
		    {{- end }}
		</select>
		<input type="submit" />
	</form>

	<p>Edit content:</p>
	<table>{{ range .Content }}
	<tr>
		{{ if .Metadata }}
			<td>
				<a href="/hugo/edit/{{ .Filename }}">
				{{ .Metadata.Title }}
				</a>
			</td>
			<td>
				{{ .Metadata.Date.Format $timeFormat }}
				{{ if not (.Metadata.Lastmod.Equal .Metadata.Date) }}
				(last modified {{.Metadata.Lastmod.Format $timeFormat }})
				{{end}}
			</td>
		{{ else }}
			<td>
				<a href="/hugo/edit/{{ .Filename }}">
				{{ .Filename }}
				</a>
			</td>
			<td>(unable to load metadata)</td>
		{{ end }}
	</tr>
	{{- end }}
	</table>
</body>
</html>
