File tree Expand file tree Collapse file tree 5 files changed +19
-28
lines changed Expand file tree Collapse file tree 5 files changed +19
-28
lines changed Original file line number Diff line number Diff line change @@ -287,9 +287,9 @@ func Action(ctx *context.Context) {
287
287
}
288
288
289
289
if err != nil {
290
- ctx .ServerError (fmt .Sprintf ("Action (%s)" , ctx .FormString ("action" )), err )
290
+ log .Error ("Failed to apply action %q: %v" , ctx .FormString ("action" ), err )
291
+ ctx .JSONError (fmt .Sprintf ("Action %q failed" , ctx .FormString ("action" )))
291
292
return
292
293
}
293
- // FIXME: We should check this URL and make sure that it's a valid Gitea URL
294
- ctx .RedirectToFirst (ctx .FormString ("redirect_to" ), ctx .ContextUser .HomeLink ())
294
+ ctx .JSONOK ()
295
295
}
Original file line number Diff line number Diff line change 20
20
</div>
21
21
</div>
22
22
<div class="right menu">
23
- <form method="post" action="{{.Link}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}&redirect_to={{$.Link}}">
24
- {{$.CsrfTokenHtml}}
25
- <button type="submit" class="ui basic button gt-mr-0">
26
- {{if $.IsFollowing}}
27
- {{.locale.Tr "user.unfollow"}}
28
- {{else}}
29
- {{.locale.Tr "user.follow"}}
30
- {{end}}
31
- </button>
32
- </form>
23
+ <button class="link-action ui basic button gt-mr-0" data-url="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
24
+ {{if $.IsFollowing}}
25
+ {{.locale.Tr "user.unfollow"}}
26
+ {{else}}
27
+ {{.locale.Tr "user.follow"}}
28
+ {{end}}
29
+ </button>
33
30
</div>
34
31
</div>
35
32
Original file line number Diff line number Diff line change 1
1
{{template "base/head" .}}
2
- <div role="main" aria-label="{{.Title}}" class="page-content repository packages ">
2
+ <div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project ">
3
3
{{template "shared/user/org_profile_avatar" .}}
4
4
<div class="ui container">
5
5
{{template "user/overview/header" .}}
Original file line number Diff line number Diff line change 1
- <div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project">
2
- <div class="ui container">
3
1
<div class="ui two column stackable grid">
4
2
<div class="column">
5
3
</div>
70
68
{{end}}
71
69
</div>
72
70
<div class="divider"></div>
73
- </div>
74
- <div class="ui container fluid padded" id="project-board">
71
+
72
+ <div id="project-board">
75
73
76
74
<div class="board {{if .CanWriteProjects}}sortable{{end}}">
77
75
{{range $board := .Boards}}
253
251
254
252
</div>
255
253
256
- </div>
257
-
258
254
{{if .CanWriteProjects}}
259
255
<div class="ui g-modal-confirm delete modal">
260
256
<div class="header">
Original file line number Diff line number Diff line change 99
99
{{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}}
100
100
<li class="follow">
101
101
{{if $.IsFollowing}}
102
- <form method="post" action="{{.Link}}?action=unfollow&redirect_to={{$.Link}}">
103
- {{$.CsrfTokenHtml}}
104
- <button type="submit" class="ui basic red button">{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}</button>
105
- </form>
102
+ <button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unfollow">
103
+ {{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}
104
+ </button>
106
105
{{else}}
107
- <form method="post" action="{{.Link}}?action=follow&redirect_to={{$.Link}}">
108
- {{$.CsrfTokenHtml}}
109
- <button type="submit" class="ui basic green button">{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}</button>
110
- </form>
106
+ <button class="ui basic green button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
107
+ {{svg "octicon-person"}} {{.locale.Tr "user.follow"}}
108
+ </button>
111
109
{{end}}
112
110
</li>
113
111
{{end}}
You can’t perform that action at this time.
0 commit comments