mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
Removed Mark visible button from org/members
This commit is contained in:
parent
3c061edafd
commit
a36e5bb83d
3 changed files with 16 additions and 24 deletions
|
@ -6,6 +6,7 @@ package org
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"forgejo.org/models"
|
||||
"forgejo.org/models/organization"
|
||||
"forgejo.org/modules/base"
|
||||
|
@ -18,6 +19,7 @@ import (
|
|||
const (
|
||||
// tplMembers template for organization members page
|
||||
tplMembers base.TplName = "org/member/members"
|
||||
tplSettingsOrganization base.TplName = "/user/settings/organization"
|
||||
)
|
||||
|
||||
// Members render organization users page
|
||||
|
@ -79,7 +81,7 @@ func Members(ctx *context.Context) {
|
|||
func MembersAction(ctx *context.Context) {
|
||||
uid := ctx.FormInt64("uid")
|
||||
if uid == 0 {
|
||||
ctx.Redirect("/user/settings/organization")
|
||||
ctx.Redirect(tplSettingsOrganization)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -106,7 +108,7 @@ func MembersAction(ctx *context.Context) {
|
|||
err = models.RemoveOrgUser(ctx, org.ID, uid)
|
||||
if organization.IsErrLastOrgOwner(err) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
ctx.JSONRedirect("/user/settings/organization")
|
||||
ctx.JSONRedirect(tplSettingsOrganization)
|
||||
return
|
||||
}
|
||||
case "leave":
|
||||
|
@ -118,7 +120,7 @@ func MembersAction(ctx *context.Context) {
|
|||
})
|
||||
} else if organization.IsErrLastOrgOwner(err) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
ctx.JSONRedirect("/user/settings/organization")
|
||||
ctx.JSONRedirect(tplSettingsOrganization)
|
||||
} else {
|
||||
log.Error("RemoveOrgUser(%d,%d): %v", org.ID, ctx.Doer.ID, err)
|
||||
}
|
||||
|
@ -134,7 +136,7 @@ func MembersAction(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
redirect := "/user/settings/organization"
|
||||
redirect := tplSettingsOrganization
|
||||
if ctx.Params(":action") == "leave" {
|
||||
redirect = setting.AppSubURL + "/"
|
||||
}
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
{{template "shared/user/name" .}}
|
||||
{{if not $isPublic}}
|
||||
<span class="ui label">{{ctx.Locale.Tr "org.members.private"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if not $.PublicOnly}}
|
||||
<div class="flex-item-body">
|
||||
|
@ -38,13 +35,6 @@
|
|||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}
|
||||
{{if $isPublic}}
|
||||
<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{svg "octicon-eye-closed" 12 "icon"}}{{ctx.Locale.Tr "org.members.public_helper"}}</a>
|
||||
{{else}}
|
||||
<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{svg "octicon-eye" 12 "icon"}}{{ctx.Locale.Tr "org.members.private_helper"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if eq $.SignedUser.ID .ID}}
|
||||
<form>
|
||||
<button class="ui red tiny button delete-button" data-modal-id="leave-organization"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue