Merge patch and add useredit template...

Patch from: https://git.freesoftwareextremist.com/bloat/commit/?id=887ed241d64ba5db3fd3d87194fb5595e5ad7d73
Patch description:
Use cookies for session
Remove the server side session storage and store all the session related data
in the client side cookies. This decreases the exposure of the auth tokens.
It also simplifies the installation process as bloat no longer requires write
access to the filesystem.

This is a breaking change, all the existing sessions will stop working.
This commit is contained in:
localhost_frssoft 2022-11-12 01:20:49 +03:00
parent 42badedeeb
commit f9702f81a9
15 changed files with 285 additions and 506 deletions

48
templates/useredit.tmpl Normal file
View file

@ -0,0 +1,48 @@
{{with .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
<div class="page-title"> User settings </div>
<form id="user-settings-form" action="/useredit" method="POST">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
<input type="hidden" name="id" value="{{.User.ID}}">
<div class="settings-form-field">
<input id="display-name" name="display-name" value="{{HTML .User.DisplayName}}">
<label for="display-name"> Your display name </label>
</div>
<div class="settings-form-field">
<label for="note"> Your bio: </label>
</div>
<div>
<textarea id="note" name="note" cols="80" rows="8"></textarea>
<div>
<details><summary>Current bio for copypaste</summary>{{.User.Note | Raw}}</details>
</div>
</div>
<div class="settings-form-field" title="Whether manual approval of follow requests is required.">
<input id="locked" name="locked" type="checkbox" value="true" {{if .User.Locked}}checked{{end}}>
<label for="locked"> Locked user? </label>
</div>
<div class="settings-form-field" title="Whether manual approval of follow requests is required.">
<input id="bot" name="bot" type="checkbox" value="true" {{if .User.Bot}}checked{{end}}>
<label for="bot"> User is bot? </label>
</div>
{{if .User.MastodonAccount}}
{{else}}
<div class="page-title"> Pleroma settings </div>
<div class="settings-form-field">
<input id="accepts-chat-messages" name="hide-attachments" type="checkbox" value="true" {{if .User.Pleroma.AcceptsChatMessages}}checked{{end}}>
<label for="accepts-chat-messages"> Allow receive chat messages (bloat not support chats feature) </label>
</div>
<div class="settings-form-field">
<input id="hide-favourites" name="hide-favourites" type="checkbox" value="true" {{if .User.Pleroma.HideFavourites}}checked{{end}}>
<label for="hide-favourites"> User's favorites timeline will be hidden </label>
</div>
{{end}}
<button type="submit"> Save </button>
</form>
{{template "footer.tmpl"}}
{{end}}