summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/web/user/profile.go6
-rw-r--r--templates/org/home.tmpl17
-rw-r--r--templates/org/projects/view.tmpl2
-rw-r--r--templates/projects/view.tmpl8
-rw-r--r--templates/shared/user/profile_big_avatar.tmpl14
5 files changed, 19 insertions, 28 deletions
diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go
index 442fd0433a..07a2261c96 100644
--- a/routers/web/user/profile.go
+++ b/routers/web/user/profile.go
@@ -287,9 +287,9 @@ func Action(ctx *context.Context) {
}
if err != nil {
- ctx.ServerError(fmt.Sprintf("Action (%s)", ctx.FormString("action")), err)
+ log.Error("Failed to apply action %q: %v", ctx.FormString("action"), err)
+ ctx.JSONError(fmt.Sprintf("Action %q failed", ctx.FormString("action")))
return
}
- // FIXME: We should check this URL and make sure that it's a valid Gitea URL
- ctx.RedirectToFirst(ctx.FormString("redirect_to"), ctx.ContextUser.HomeLink())
+ ctx.JSONOK()
}
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 7f52b8cc6d..967b31e7a8 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -20,16 +20,13 @@
</div>
</div>
<div class="right menu">
- <form method="post" action="{{.Link}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}&redirect_to={{$.Link}}">
- {{$.CsrfTokenHtml}}
- <button type="submit" class="ui basic button gt-mr-0">
- {{if $.IsFollowing}}
- {{.locale.Tr "user.unfollow"}}
- {{else}}
- {{.locale.Tr "user.follow"}}
- {{end}}
- </button>
- </form>
+ <button class="link-action ui basic button gt-mr-0" data-url="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
+ {{if $.IsFollowing}}
+ {{.locale.Tr "user.unfollow"}}
+ {{else}}
+ {{.locale.Tr "user.follow"}}
+ {{end}}
+ </button>
</div>
</div>
diff --git a/templates/org/projects/view.tmpl b/templates/org/projects/view.tmpl
index ef8ec24225..33346b6154 100644
--- a/templates/org/projects/view.tmpl
+++ b/templates/org/projects/view.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content repository packages">
+<div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project">
{{template "shared/user/org_profile_avatar" .}}
<div class="ui container">
{{template "user/overview/header" .}}
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index 59fa1870f8..2f0556856f 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -1,5 +1,3 @@
-<div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project">
- <div class="ui container">
<div class="ui two column stackable grid">
<div class="column">
</div>
@@ -70,8 +68,8 @@
{{end}}
</div>
<div class="divider"></div>
- </div>
- <div class="ui container fluid padded" id="project-board">
+
+ <div id="project-board">
<div class="board {{if .CanWriteProjects}}sortable{{end}}">
{{range $board := .Boards}}
@@ -253,8 +251,6 @@
</div>
-</div>
-
{{if .CanWriteProjects}}
<div class="ui g-modal-confirm delete modal">
<div class="header">
diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl
index 408877e481..5a1e43b88e 100644
--- a/templates/shared/user/profile_big_avatar.tmpl
+++ b/templates/shared/user/profile_big_avatar.tmpl
@@ -99,15 +99,13 @@
{{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}}
<li class="follow">
{{if $.IsFollowing}}
- <form method="post" action="{{.Link}}?action=unfollow&redirect_to={{$.Link}}">
- {{$.CsrfTokenHtml}}
- <button type="submit" class="ui basic red button">{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}</button>
- </form>
+ <button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unfollow">
+ {{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}
+ </button>
{{else}}
- <form method="post" action="{{.Link}}?action=follow&redirect_to={{$.Link}}">
- {{$.CsrfTokenHtml}}
- <button type="submit" class="ui basic green button">{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}</button>
- </form>
+ <button class="ui basic green button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
+ {{svg "octicon-person"}} {{.locale.Tr "user.follow"}}
+ </button>
{{end}}
</li>
{{end}}