mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-07-16 06:34:17 +00:00
Add setting for default format
This commit is contained in:
parent
ef41ff32e2
commit
fdd9b8fd2b
7 changed files with 26 additions and 5 deletions
service
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"mime/multipart"
|
||||
"html/template"
|
||||
"mime/multipart"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
|
@ -198,6 +198,7 @@ func (svc *service) ServeNavPage(c *model.Client) (err error) {
|
|||
|
||||
postContext := model.PostContext{
|
||||
DefaultVisibility: c.Session.Settings.DefaultVisibility,
|
||||
DefaultFormat: c.Session.Settings.DefaultFormat,
|
||||
Formats: svc.postFormats,
|
||||
}
|
||||
|
||||
|
@ -326,6 +327,7 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
|
|||
|
||||
postContext = model.PostContext{
|
||||
DefaultVisibility: visibility,
|
||||
DefaultFormat: c.Session.Settings.DefaultFormat,
|
||||
Formats: svc.postFormats,
|
||||
ReplyContext: &model.ReplyContext{
|
||||
InReplyToID: id,
|
||||
|
@ -686,8 +688,9 @@ func (svc *service) ServeSearchPage(c *model.Client,
|
|||
func (svc *service) ServeSettingsPage(c *model.Client) (err error) {
|
||||
commonData := svc.getCommonData(c, "settings")
|
||||
data := &renderer.SettingsData{
|
||||
CommonData: commonData,
|
||||
Settings: &c.Session.Settings,
|
||||
CommonData: commonData,
|
||||
Settings: &c.Session.Settings,
|
||||
PostFormats: svc.postFormats,
|
||||
}
|
||||
|
||||
rCtx := getRendererContext(c)
|
||||
|
|
|
@ -584,6 +584,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||
settings := func(w http.ResponseWriter, req *http.Request) {
|
||||
c := newClient(w, req, req.FormValue("csrf_token"))
|
||||
visibility := req.FormValue("visibility")
|
||||
format := req.FormValue("format")
|
||||
copyScope := req.FormValue("copy_scope") == "true"
|
||||
threadInNewTab := req.FormValue("thread_in_new_tab") == "true"
|
||||
hideAttachments := req.FormValue("hide_attachments") == "true"
|
||||
|
@ -595,6 +596,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||
|
||||
settings := &model.Settings{
|
||||
DefaultVisibility: visibility,
|
||||
DefaultFormat: format,
|
||||
CopyScope: copyScope,
|
||||
ThreadInNewTab: threadInNewTab,
|
||||
HideAttachments: hideAttachments,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue