Make redirection work without Referer header
This commit is contained in:
parent
e8bfd3093b
commit
f4620a8c69
|
@ -14,6 +14,7 @@ type Context struct {
|
||||||
CSRFToken string
|
CSRFToken string
|
||||||
UserID string
|
UserID string
|
||||||
AntiDopamineMode bool
|
AntiDopamineMode bool
|
||||||
|
Referrer string
|
||||||
}
|
}
|
||||||
|
|
||||||
type NavData struct {
|
type NavData struct {
|
||||||
|
|
|
@ -58,9 +58,11 @@ func NewService(clientName string,
|
||||||
func getRendererContext(c *client) *renderer.Context {
|
func getRendererContext(c *client) *renderer.Context {
|
||||||
var settings model.Settings
|
var settings model.Settings
|
||||||
var session model.Session
|
var session model.Session
|
||||||
|
var referrer string
|
||||||
if c != nil {
|
if c != nil {
|
||||||
settings = c.Session.Settings
|
settings = c.Session.Settings
|
||||||
session = c.Session
|
session = c.Session
|
||||||
|
referrer = c.url()
|
||||||
} else {
|
} else {
|
||||||
settings = *model.NewSettings()
|
settings = *model.NewSettings()
|
||||||
}
|
}
|
||||||
|
@ -73,6 +75,7 @@ func getRendererContext(c *client) *renderer.Context {
|
||||||
CSRFToken: session.CSRFToken,
|
CSRFToken: session.CSRFToken,
|
||||||
UserID: session.UserID,
|
UserID: session.UserID,
|
||||||
AntiDopamineMode: settings.AntiDopamineMode,
|
AntiDopamineMode: settings.AntiDopamineMode,
|
||||||
|
Referrer: referrer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ type client struct {
|
||||||
Session model.Session
|
Session model.Session
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *client) url() string {
|
||||||
|
return c.Req.URL.RequestURI()
|
||||||
|
}
|
||||||
|
|
||||||
func setSessionCookie(w http.ResponseWriter, sid string, exp time.Duration) {
|
func setSessionCookie(w http.ResponseWriter, sid string, exp time.Duration) {
|
||||||
http.SetCookie(w, &http.Cookie{
|
http.SetCookie(w, &http.Cookie{
|
||||||
Name: "session_id",
|
Name: "session_id",
|
||||||
|
@ -301,7 +305,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
location := c.Req.Header.Get("Referer")
|
location := c.Req.FormValue("referrer")
|
||||||
if len(replyToID) > 0 {
|
if len(replyToID) > 0 {
|
||||||
location = "/thread/" + replyToID + "#status-" + id
|
location = "/thread/" + replyToID + "#status-" + id
|
||||||
}
|
}
|
||||||
|
@ -319,7 +323,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -333,7 +337,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -347,7 +351,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -361,7 +365,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -373,7 +377,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+statusID)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+statusID)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -389,7 +393,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -399,7 +403,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -409,7 +413,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -419,7 +423,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -429,7 +433,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -439,7 +443,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -449,7 +453,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -459,7 +463,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -469,7 +473,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -479,7 +483,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -522,7 +526,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -532,7 +536,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -542,7 +546,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -553,7 +557,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer"))
|
redirect(c, c.Req.FormValue("referrer"))
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -567,7 +571,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
@ -581,7 +585,7 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
|
||||||
if len(rid) > 0 {
|
if len(rid) > 0 {
|
||||||
id = rid
|
id = rid
|
||||||
}
|
}
|
||||||
redirect(c, c.Req.Header.Get("Referer")+"#status-"+id)
|
redirect(c, c.Req.FormValue("referrer")+"#status-"+id)
|
||||||
return nil
|
return nil
|
||||||
}, CSRF, HTML)
|
}, CSRF, HTML)
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
<a class="nav-link" href="/settings" target="_top" accesskey="7" title="Settings (7)">settings</a>
|
<a class="nav-link" href="/settings" target="_top" accesskey="7" title="Settings (7)">settings</a>
|
||||||
<form class="signout" action="/signout" method="post" target="_top">
|
<form class="signout" action="/signout" method="post" target="_top">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="signout" class="btn-link nav-link" accesskey="8" title="Signout (8)">
|
<input type="submit" value="signout" class="btn-link nav-link" accesskey="8" title="Signout (8)">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
{{if .ReadID}}
|
{{if .ReadID}}
|
||||||
<form class="notification-read" action="/notifications/read?max_id={{.ReadID}}" method="post" target="_self">
|
<form class="notification-read" action="/notifications/read?max_id={{.ReadID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="read" class="btn-link" accesskey="C" title="Clear unread notifications (C)">
|
<input type="submit" value="read" class="btn-link" accesskey="C" title="Clear unread notifications (C)">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -57,11 +58,13 @@
|
||||||
</div>
|
</div>
|
||||||
<form class="d-inline" action="/accept/{{.Account.ID}}" method="post" target="_self">
|
<form class="d-inline" action="/accept/{{.Account.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="accept" class="btn-link">
|
<input type="submit" value="accept" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
-
|
-
|
||||||
<form class="d-inline" action="/reject/{{.Account.ID}}" method="post" target="_self">
|
<form class="d-inline" action="/reject/{{.Account.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="reject" class="btn-link">
|
<input type="submit" value="reject" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{{with .Data}}
|
{{with .Data}}
|
||||||
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data" target="_self">
|
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
{{if .ReplyContext}}
|
{{if .ReplyContext}}
|
||||||
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
|
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
|
||||||
<label for="post-content" class="post-form-title"> Reply to {{.ReplyContext.InReplyToName}} </label>
|
<label for="post-content" class="post-form-title"> Reply to {{.ReplyContext.InReplyToName}} </label>
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
</div>
|
</div>
|
||||||
<form class="d-inline" action="/accept/{{.ID}}" method="post" target="_self">
|
<form class="d-inline" action="/accept/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="accept" class="btn-link">
|
<input type="submit" value="accept" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
-
|
-
|
||||||
<form class="d-inline" action="/reject/{{.ID}}" method="post" target="_self">
|
<form class="d-inline" action="/reject/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="reject" class="btn-link">
|
<input type="submit" value="reject" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<form id="settings-form" action="/settings" method="POST">
|
<form id="settings-form" action="/settings" method="POST">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<div class="settings-form-field">
|
<div class="settings-form-field">
|
||||||
<label for="visibility"> Default format </label>
|
<label for="visibility"> Default format </label>
|
||||||
{{$defFormat := .Settings.DefaultFormat}}
|
{{$defFormat := .Settings.DefaultFormat}}
|
||||||
|
|
|
@ -38,23 +38,27 @@
|
||||||
{{if .Muted}}
|
{{if .Muted}}
|
||||||
<form action="/unmuteconv/{{.ID}}" method="post" target="_self">
|
<form action="/unmuteconv/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="unmute" class="btn-link more-link">
|
<input type="submit" value="unmute" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form action="/muteconv/{{.ID}}" method="post" target="_self">
|
<form action="/muteconv/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="mute" class="btn-link more-link">
|
<input type="submit" value="mute" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .Bookmarked}}
|
{{if .Bookmarked}}
|
||||||
<form action="/unbookmark/{{.ID}}" method="post" target="_self">
|
<form action="/unbookmark/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="unbookmark" class="btn-link more-link">
|
<input type="submit" value="unbookmark" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form action="/bookmark/{{.ID}}" method="post" target="_self">
|
<form action="/bookmark/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="bookmark" class="btn-link more-link">
|
<input type="submit" value="bookmark" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
|
@ -62,6 +66,7 @@
|
||||||
{{if eq $.Ctx.UserID .Account.ID}}
|
{{if eq $.Ctx.UserID .Account.ID}}
|
||||||
<form action="/delete/{{.ID}}" method="post" target="_self">
|
<form action="/delete/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="delete" class="btn-link more-link">
|
<input type="submit" value="delete" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -143,6 +148,7 @@
|
||||||
{{if .Poll}}
|
{{if .Poll}}
|
||||||
<form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self">
|
<form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="hidden" name="status_id" value="{{$s.ID}}">
|
<input type="hidden" name="status_id" value="{{$s.ID}}">
|
||||||
{{range $i, $o := .Poll.Options}}
|
{{range $i, $o := .Poll.Options}}
|
||||||
<div class="poll-option">
|
<div class="poll-option">
|
||||||
|
@ -195,6 +201,7 @@
|
||||||
{{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}}
|
{{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}}
|
||||||
<form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self">
|
<form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="{{$rt}}" class="btn-link">
|
<input type="submit" value="{{$rt}}" class="btn-link">
|
||||||
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
|
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
|
||||||
|
@ -209,6 +216,7 @@
|
||||||
{{$like := "like"}} {{if .Favourited}} {{$like = "unlike"}} {{end}}
|
{{$like := "like"}} {{if .Favourited}} {{$like = "unlike"}} {{end}}
|
||||||
<form class="status-like" data-action="{{$like}}" action="/{{$like}}/{{.ID}}" method="post" target="_self">
|
<form class="status-like" data-action="{{$like}}" action="/{{$like}}/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="{{$like}}" class="btn-link">
|
<input type="submit" value="{{$like}}" class="btn-link">
|
||||||
<a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list">
|
<a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list">
|
||||||
|
|
|
@ -23,11 +23,13 @@
|
||||||
{{if .User.Pleroma.Relationship.Following}}
|
{{if .User.Pleroma.Relationship.Following}}
|
||||||
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="unfollow" class="btn-link">
|
<input type="submit" value="unfollow" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="d-inline" action="/follow/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/follow/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="{{if .User.Pleroma.Relationship.Requested}}resend request{{else}}follow{{end}}" class="btn-link">
|
<input type="submit" value="{{if .User.Pleroma.Relationship.Requested}}resend request{{else}}follow{{end}}" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -35,6 +37,7 @@
|
||||||
-
|
-
|
||||||
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="cancel request" class="btn-link">
|
<input type="submit" value="cancel request" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -42,11 +45,13 @@
|
||||||
{{if .User.Pleroma.Relationship.Subscribing}}
|
{{if .User.Pleroma.Relationship.Subscribing}}
|
||||||
<form class="d-inline" action="/unsubscribe/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/unsubscribe/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="unsubscribe" class="btn-link">
|
<input type="submit" value="unsubscribe" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="d-inline" action="/subscribe/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/subscribe/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="subscribe" class="btn-link">
|
<input type="submit" value="subscribe" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -55,11 +60,13 @@
|
||||||
{{if .User.Pleroma.Relationship.Blocking}}
|
{{if .User.Pleroma.Relationship.Blocking}}
|
||||||
<form class="d-inline" action="/unblock/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/unblock/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="unblock" class="btn-link">
|
<input type="submit" value="unblock" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="d-inline" action="/block/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/block/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="block" class="btn-link">
|
<input type="submit" value="block" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -67,11 +74,13 @@
|
||||||
{{if .User.Pleroma.Relationship.Muting}}
|
{{if .User.Pleroma.Relationship.Muting}}
|
||||||
<form class="d-inline" action="/unmute/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/unmute/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="unmute" class="btn-link">
|
<input type="submit" value="unmute" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="d-inline" action="/mute/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/mute/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="mute" class="btn-link">
|
<input type="submit" value="mute" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -80,11 +89,13 @@
|
||||||
{{if .User.Pleroma.Relationship.ShowingReblogs}}
|
{{if .User.Pleroma.Relationship.ShowingReblogs}}
|
||||||
<form class="d-inline" action="/follow/{{.User.ID}}?reblogs=false" method="post">
|
<form class="d-inline" action="/follow/{{.User.ID}}?reblogs=false" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="hide retweets" class="btn-link">
|
<input type="submit" value="hide retweets" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="d-inline" action="/follow/{{.User.ID}}" method="post">
|
<form class="d-inline" action="/follow/{{.User.ID}}" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
|
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
|
||||||
<input type="submit" value="show retweets" class="btn-link">
|
<input type="submit" value="show retweets" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue