diff options
author | r <r@freesoftwareextremist.com> | 2023-10-01 13:04:07 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2023-10-01 13:04:07 +0000 |
commit | 81bdc7c705d5d21f62927167d5b2c8e4932c9570 (patch) | |
tree | 8bdd670af920ac0541391366b5711462d9df0fab /templates | |
parent | 8e3999fc3d9761f9ce71c35a7154a77c251caa66 (diff) | |
download | bloat-81bdc7c705d5d21f62927167d5b2c8e4932c9570.tar.gz bloat-81bdc7c705d5d21f62927167d5b2c8e4932c9570.zip |
Add profile edit page
Diffstat (limited to 'templates')
-rw-r--r-- | templates/nav.tmpl | 3 | ||||
-rw-r--r-- | templates/profile.tmpl | 58 |
2 files changed, 61 insertions, 0 deletions
diff --git a/templates/nav.tmpl b/templates/nav.tmpl index 4413823..bdb72be 100644 --- a/templates/nav.tmpl +++ b/templates/nav.tmpl @@ -12,6 +12,9 @@ <a class="nav-link" href="/user/{{.User.ID}}" accesskey="0" title="User profile (0)"> <span class="status-uname">@{{.User.Acct}}</span> </a> + <a class="profile-edit-link" href="/profile" title="edit profile" target="_top"> + edit + </a> </div> <div class="user-info-details-nav"> <a class="nav-link" href="/timeline/home" accesskey="1" title="Home timeline (1)">home</a> diff --git a/templates/profile.tmpl b/templates/profile.tmpl new file mode 100644 index 0000000..4bf1937 --- /dev/null +++ b/templates/profile.tmpl @@ -0,0 +1,58 @@ +{{with .Data}} +{{template "header.tmpl" (WithContext .CommonData $.Ctx)}} +<div class="page-title"> Edit Profile </div> + +<form class="profile-form" action="/profile" method="POST" enctype="multipart/form-data"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> + <div class="profile-form-field"> + <div class="block-label"> + <label for="avatar">Avatar</label> - + <input class="btn-link" type="submit" formaction="/profile/delavatar" formmethod="POST" value="delete"> + </div> + <div> + <a href="{{.User.Avatar}}" target="_blank"> + <img class="profile-avatar" src="{{.User.Avatar}}" alt="profile-avatar" height="96"> + </a> + </div> + <div><input id="avatar" name="avatar" type="file"></div> + </div> + <div class="profile-form-field"> + <div class="block-label"> + <label for="banner">Banner</label> - + <input class="btn-link" type="submit" formaction="/profile/delbanner" formmethod="POST" value="delete"> + </div> + <div> + <a href="{{.User.Header}}" target="_blank"> + <img class="profile-banner" src="{{.User.Header}}" alt="profile-banner" height="120"> + </a> + </div> + <input id="banner" name="banner" type="file"> + </div> + <div class="profile-form-field"> + <div class="block-label"><label for="name">Name</label></div> + <div><input id="name" name="name" type="text" value="{{.User.DisplayName}}"></div> + </div> + <div class="profile-form-field"> + <div class="block-label"><label for="bio">Bio</label></div> + <textarea id="bio" name="bio" cols="80" rows="8">{{.User.Source.Note}}</textarea> + </div> + <div class="profile-form-field"> + <div class="block-label"><label>Metadata</label></div> + {{range $i, $f := .User.Source.Fields}} + <div class="profile-field"> + <input id="field-name-{{$i}}" name="field-name-{{$i}}" type="text" value="{{$f.Name}}" placeholder="name"> + <input id="field-value-{{$i}}" name="field-value-{{$i}}" type="text" value="{{$f.Value}}" placeholder="value"> + </div> + {{end}} + </div> + <div class="profile-form-field"> + <input id="locked" name="locked" type="checkbox" value="true" {{if .User.Locked}}checked{{end}}> + <label for="locked">Require manual approval of follow requests</label> + </div> + <button type="submit"> Save </button> + <button type="reset"> Reset </button> +</form> + +{{template "footer.tmpl"}} +{{end}} |