~gitpocket/gitpocket

4
a549518608aee4576c58d936fcaf41972ee677c0
mainfeed-discovery
gitpocket/templates/settings.html -rw-r--r--1.9 KiB ViewLogBlameView rawPermalink 40e55b8c7b feat(basin): sourcehut style layout and settings tabs 1 months ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{{define "content"}}
{{$p := .Data.Profile}}
<h3 class="rule">Edit your profile</h3>
<form method="post" action="/settings/avatar" enctype="multipart/form-data" class="avatarform" id="avatarform">
<div class="avatarbox">{{if $p.Avatar}}<img class="avatar" src="/~{{.User.Name}}/avatar?v={{$p.Avatar}}" alt="">{{end}}</div>
<div>
<label>Choose an avatar <input type="file" name="avatar" accept="image/png,image/jpeg,image/gif,image/webp" required></label>
<small>If the image is not square you can pick the crop below. It is resized to 256×256 and stored as PNG.</small>
<div class="cropper" hidden><canvas></canvas><input type="range" min="10" max="100" value="100"><small>Drag to move the square, scroll or slide to resize.</small></div>
<input type="hidden" name="x"><input type="hidden" name="y"><input type="hidden" name="size">
<div class="actions left"><button class="btn">Upload avatar ▸</button>{{if $p.Avatar}}<button class="btn danger" formaction="/settings/avatar/delete" formnovalidate>Remove</button>{{end}}</div>
</div>
</form>
<script src="/static/crop.js" defer></script>
<form method="post" action="/settings/profile" class="stack wide">
<div class="pair">
<label>Username <span class="muted">(you can't edit this)</span><input value="{{.User.Name}}" disabled></label>
<label>Name <input name="display" value="{{$p.Display}}" maxlength="100" placeholder="Shown on your profile"></label>
</div>
<div class="pair">
<label>Location <input name="location" value="{{$p.Location}}" maxlength="100"></label>
<label>Workplace <input name="workplace" value="{{$p.Workplace}}" maxlength="100"></label>
</div>
<label>URL <input name="website" value="{{$p.Website}}" maxlength="200" placeholder="https://"></label>
<label>Bio <textarea name="bio" rows="6" maxlength="4000" placeholder="Markdown supported">{{$p.Bio}}</textarea></label>
<div class="actions"><button class="btn primary">Save changes ▸</button></div>
</form>
{{end}}