mirror of
https://github.com/go-gitea/gitea
synced 2025-08-02 15:48:35 +00:00
Change action GETs to POST (#10462)
* Change action GETs to POST * submite = submit + smite * No more # href * Fix test * Match other tests * Explicit csrf Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
@@ -65,9 +65,15 @@
|
||||
{{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
|
||||
<li class="follow">
|
||||
{{if .SignedUser.IsFollowing .Owner.ID}}
|
||||
<a class="ui basic red button" href="{{.Link}}/action/unfollow?redirect_to={{$.Link}}">{{svg "octicon-person" 16}} {{.i18n.Tr "user.unfollow"}}</a>
|
||||
<form method="post" action="{{.Link}}/action/unfollow?redirect_to={{$.Link}}">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<button type="submit" class="ui basic red button">{{svg "octicon-person" 16}} {{.i18n.Tr "user.unfollow"}}</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<a class="ui basic green button" href="{{.Link}}/action/follow?redirect_to={{$.Link}}">{{svg "octicon-person" 16}} {{.i18n.Tr "user.follow"}}</a>
|
||||
<form method="post" action="{{.Link}}/action/follow?redirect_to={{$.Link}}">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<button type="submit" class="ui basic green button">{{svg "octicon-person" 16}} {{.i18n.Tr "user.follow"}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
|
Reference in New Issue
Block a user