phoenix/templates/settings.html.tmpl
Ivan R. 6d25c4e8af
feat!: migrate to net/http
With the release of Go 1.22, the standard library now has
all the necessary functions that allow us to abandon Gin.

I hope this rewrite will lower the entry barrier for new developers.
As a nice bonus, the size of the program has decreased from 20 to 15.4 MB.

To solve issue #81, request logging has been improved.
Now all errors are displayed in the logs.
2024-03-25 15:52:18 +05:00

127 lines
3.9 KiB
Cheetah

<!DOCTYPE html>
<html lang="en">
<head>
{{template "head" .}}
<link rel="stylesheet" href="assets/css/settings.css" />
</head>
<body>
<h1>Settings</h1>
<a href="/">Main page</a>
{{range .groups}}
<h2 id="group-{{.ID}}">Group "{{.Name}}"</h2>
<div class="row">
<form method="POST" action="/groups/{{.ID}}/update" class="innerForm">
<input
value="{{.Name}}"
placeholder="Name"
name="groupName"
required
/>
<button
type="submit"
aria-label="Save the group"
>
<img src="/assets/svg/floppy-disk-solid.svg" width="16px" height="16px" />
</button>
</form>
<form method="POST" action="/groups/{{.ID}}/delete">
<button
type="submit"
aria-label="Delete the group"
>
<img src="/assets/svg/trash-solid.svg" width="16px" height="16px" />
</button>
</form>
</div>
{{range .Links}}
<div class="row" id="link-{{.ID}}">
<form method="POST" action="/links/{{.ID}}/update" class="innerForm">
<input
class="small-row"
value="{{ if .Icon }}{{ .Icon }}{{ end }}"
name="icon"
placeholder="Icon"
/>
<input
class="small-row"
value="{{.Name}}"
name="linkName"
placeholder="Name"
required
/>
<input
value="{{.Href}}"
name="href"
placeholder="Href"
required
/>
<button
type="submit"
aria-label="Save the link"
>
<img src="/assets/svg/floppy-disk-solid.svg" width="16px" height="16px" />
</button>
</form>
<form method="POST" action="/links/{{.ID}}/delete">
<button
type="submit"
aria-label="Delete the link"
>
<img src="/assets/svg/trash-solid.svg" width="16px" height="16px" />
</button>
</form>
</div>
{{end}}
<form action="/links" method="POST" class="row">
<input
class="small-row"
name="icon"
placeholder="Icon"
/>
<input
class="small-row"
placeholder="Name"
name="linkName"
required
/>
<input
placeholder="Href"
name="href"
type="url"
required
/>
<input
type="hidden"
name="groupID"
value="{{.ID}}"
readonly
/>
<button
type="submit"
aria-label="Create a new link"
>
<img src="/assets/svg/plus-solid.svg" width="16px" height="16px" />
</button>
</form>
{{end}}
<h2>New group</h2>
<form method="POST" action="/groups" class="row">
<input
placeholder="Name"
name="groupName"
required
/>
<button
type="submit"
aria-label="Create a new group"
>
<img src="/assets/svg/plus-solid.svg" width="16px" height="16px" />
</button>
</form>
</body>
</html>