tclip/cmd/tclipd/tmpl/create.html
2023-09-19 12:14:48 -04:00

30 lines
1.4 KiB
HTML

{{template "header" .}}
<form action="/api/post" method="POST">
<textarea name="content" rows=20 cols=80></textarea>
<br />
<div>
<label class="block text-sm font-medium leading-6 text-gray-900" for="filename">Filename</label>
<div class="mt-2 max-w-sm">
<input type="text" id="filename" name="filename" placeholder="filename.txt" class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" />
</div>
</div>
<input class="rounded bg-gray-600 px-2 py-1 mt-4 font-semibold text-white shadow-sm hover:bg-gray-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-600" type="submit" value="Submit" />
</form>
<div class="mt-4">
{{if len .RecentPastes | eq 0}}
<p class="prose">There are no pastes in the list. Create one to share with your team!</p>
{{else}}
<h2 class="text-xl font-bold mx-4">Recent pastes</h2>
<ul class="list-disc ml-5">
{{range .RecentPastes}}
<li><a class="font-semibold underline text-gray-900 hover:text-gray-500" href="/paste/{{.ID}}">{{.Filename}}</a> - {{.CreatedAt}} - {{.PasterDisplayName}}</li>
{{end}}
</ul>
<p class="mt-4 font-semibold underline text-gray-900 hover:text-gray-500"><a href="/paste/list">See all pastes</a></p>
{{end}}
</div>
{{template "footer" .}}