Skip to content

Following up fixes for "Fix inconsistent user profile layout across tabs" #25739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions routers/web/user/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
17 changes: 7 additions & 10 deletions templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion templates/org/projects/view.tmpl
Original file line number Diff line number Diff line change
@@ -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" .}}
Expand Down
8 changes: 2 additions & 6 deletions templates/projects/view.tmpl
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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}}
Expand Down Expand Up @@ -253,8 +251,6 @@

</div>

</div>

{{if .CanWriteProjects}}
<div class="ui g-modal-confirm delete modal">
<div class="header">
Expand Down
14 changes: 6 additions & 8 deletions templates/shared/user/profile_big_avatar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down