Personal Git forge.
{{define "content"}}<h1>Configuration settings.</h1><h2>Git.</h2><form action="default_branch" method="post" class="git-form"> {{ .csrfField }} <label for="branch">Default branch name:</label> <input type="text" name="branch" value="{{.Config.GitDefaultBranch}}" required> <input type="submit" value="Save"></form><h2>SSH.</h2><h3>Your public keys.</h3><div class="ssh-key-list"> {{range .User.SSHPubKeys}} <div class="ssh-key"> <div class="data"> <h4>{{.Name}}</h4> <code>{{.Fingerprint}}</code> </div> <form action="delete_ssh_key" method="post" class="non-chalant"> {{ $.csrfField }} <input type="text" value="{{.ID}}" name="key" hidden readonly> <input type="submit" value="Delete." warning> </form> </div> {{else}} <p class="no-ssh-keys">You haven't uploaded any SSH keys yet.</p> {{end}}</div><h3>Add a SSH key.</h3><form action="add_ssh_key" method="post" class="ssh-key-form"> {{ .csrfField }} <label for="name">Name:</label> <input type="text" name="name" placeholder="Work laptop" required> <label for="key">Public key:</label> <input type="text" name="key" placeholder="ssh-rsa AAAAB3Nza(...) work-laptop" required> <input type="submit" value="Add SSH key."></form><h2>Hackatime.</h2>{{if .User.HackatimeToken}}<p>You've already linked your Hackatime. {{if .Hackatime}}Linked Slack ID: <code>{{.Hackatime.SlackID}}</code>{{else}}We could not reach the Hackatime API, but it's still linked.{{end}}</p>{{else}}<p>If you have a Hackatime account, you can <a href="/auth/hackatime">link it</a> to get stats on your projects.</p>{{end}}<style> .ssh-key-list { display: flex; flex-direction: column; gap: var(--gap); padding: var(--gap); border: var(--solid-border); .no-ssh-keys { margin: 0; } } .ssh-key { display: flex; flex-direction: row; gap: var(--gap); align-items: center; justify-content: space-between; * { margin: 0; } } .ssh-key-form, .ssh-key-form>* { width: 100%; } .git-form { width: 100%; display: flex; flex-direction: row; input[type="text"] { flex: 1; } input[type="submit"] { width: fit-content; } }</style>{{end}}