mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-12-25 15:09:49 +00:00
Use post method for like and retweet
This commit is contained in:
parent
e9bd72306e
commit
50e58c4e01
@ -167,7 +167,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||||||
|
|
||||||
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
||||||
w.WriteHeader(http.StatusFound)
|
w.WriteHeader(http.StatusFound)
|
||||||
}).Methods(http.MethodGet)
|
}).Methods(http.MethodPost)
|
||||||
|
|
||||||
r.HandleFunc("/unlike/{id}", func(w http.ResponseWriter, req *http.Request) {
|
r.HandleFunc("/unlike/{id}", func(w http.ResponseWriter, req *http.Request) {
|
||||||
ctx := getContextWithSession(context.Background(), req)
|
ctx := getContextWithSession(context.Background(), req)
|
||||||
@ -180,7 +180,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||||||
|
|
||||||
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
||||||
w.WriteHeader(http.StatusFound)
|
w.WriteHeader(http.StatusFound)
|
||||||
}).Methods(http.MethodGet)
|
}).Methods(http.MethodPost)
|
||||||
|
|
||||||
r.HandleFunc("/retweet/{id}", func(w http.ResponseWriter, req *http.Request) {
|
r.HandleFunc("/retweet/{id}", func(w http.ResponseWriter, req *http.Request) {
|
||||||
ctx := getContextWithSession(context.Background(), req)
|
ctx := getContextWithSession(context.Background(), req)
|
||||||
@ -193,7 +193,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||||||
|
|
||||||
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
||||||
w.WriteHeader(http.StatusFound)
|
w.WriteHeader(http.StatusFound)
|
||||||
}).Methods(http.MethodGet)
|
}).Methods(http.MethodPost)
|
||||||
|
|
||||||
r.HandleFunc("/unretweet/{id}", func(w http.ResponseWriter, req *http.Request) {
|
r.HandleFunc("/unretweet/{id}", func(w http.ResponseWriter, req *http.Request) {
|
||||||
ctx := getContextWithSession(context.Background(), req)
|
ctx := getContextWithSession(context.Background(), req)
|
||||||
@ -206,7 +206,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||||||
|
|
||||||
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
|
||||||
w.WriteHeader(http.StatusFound)
|
w.WriteHeader(http.StatusFound)
|
||||||
}).Methods(http.MethodGet)
|
}).Methods(http.MethodPost)
|
||||||
|
|
||||||
r.HandleFunc("/post", func(w http.ResponseWriter, req *http.Request) {
|
r.HandleFunc("/post", func(w http.ResponseWriter, req *http.Request) {
|
||||||
ctx := getContextWithSession(context.Background(), req)
|
ctx := getContextWithSession(context.Background(), req)
|
||||||
|
@ -82,6 +82,10 @@
|
|||||||
min-width: 64px;
|
min-width: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-action form {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.status-action:last-child {
|
.status-action:last-child {
|
||||||
min-width: unset;
|
min-width: unset;
|
||||||
}
|
}
|
||||||
|
@ -101,13 +101,13 @@
|
|||||||
</a>
|
</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if .Reblogged}}
|
{{if .Reblogged}}
|
||||||
<a class="status-retweet" href="/unretweet/{{.ID}}" title="undo retweet">
|
<form class="status-retweet" action="/unretweet/{{.ID}}" method="post">
|
||||||
<img class="icon" src="/static/icons/retweeted.png" alt="undo retweet" />
|
<input type="image" src="/static/icons/retweeted.png" alt="undo retweet" class="icon" title="undo retweet">
|
||||||
</a>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<a class="status-retweet" href="/retweet/{{.ID}}" title="retweet">
|
<form class="status-retweet" action="/retweet/{{.ID}}" method="post">
|
||||||
<img class="icon" src="/static/icons/retweet.png" alt="retweet" />
|
<input type="image" src="/static/icons/retweet.png" alt="retweet" class="icon" title="retweet">
|
||||||
</a>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="status-action-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
|
<a class="status-action-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
|
||||||
@ -116,13 +116,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
{{if .Favourited}}
|
{{if .Favourited}}
|
||||||
<a class="status-like" href="/unlike/{{.ID}}" title="unlike">
|
<form class="status-like" action="/unlike/{{.ID}}" method="post">
|
||||||
<img class="icon" src="/static/icons/liked.png" alt="unlike" />
|
<input type="image" src="/static/icons/liked.png" alt="unlike" class="icon" title="unlike">
|
||||||
</a>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<a class="status-like" href="/like/{{.ID}}" title="like">
|
<form class="status-like" action="/like/{{.ID}}" method="post">
|
||||||
<img class="icon" src="/static/icons/star-o.png" alt="like" />
|
<input type="image" src="/static/icons/star-o.png" alt="like" class="icon" title="like">
|
||||||
</a>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="status-action-count" href="/likedby/{{.ID}}" title="click to see the the list">
|
<a class="status-action-count" href="/likedby/{{.ID}}" title="click to see the the list">
|
||||||
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
|
<span> {{DisplayInteractionCount .FavouritesCount}} </span>
|
||||||
|
Loading…
Reference in New Issue
Block a user