Skip to content

Commit 6c21961

Browse files
authored
org settings -> webhook/labels/deletion should also active the menu (#17809)
1 parent e8f1f09 commit 6c21961

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

routers/web/org/org_labels.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func NewLabel(ctx *context.Context) {
3434
form := web.GetForm(ctx).(*forms.CreateLabelForm)
3535
ctx.Data["Title"] = ctx.Tr("repo.labels")
3636
ctx.Data["PageIsLabels"] = true
37+
ctx.Data["PageIsOrgSettings"] = true
3738

3839
if ctx.HasError() {
3940
ctx.Flash.Error(ctx.Data["ErrorMsg"].(string))

routers/web/org/setting.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const (
3939
// Settings render the main settings page
4040
func Settings(ctx *context.Context) {
4141
ctx.Data["Title"] = ctx.Tr("org.settings")
42+
ctx.Data["PageIsOrgSettings"] = true
4243
ctx.Data["PageIsSettingsOptions"] = true
4344
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
4445
ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess
@@ -49,6 +50,7 @@ func Settings(ctx *context.Context) {
4950
func SettingsPost(ctx *context.Context) {
5051
form := web.GetForm(ctx).(*forms.UpdateOrgSettingForm)
5152
ctx.Data["Title"] = ctx.Tr("org.settings")
53+
ctx.Data["PageIsOrgSettings"] = true
5254
ctx.Data["PageIsSettingsOptions"] = true
5355
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
5456

@@ -159,6 +161,7 @@ func SettingsDeleteAvatar(ctx *context.Context) {
159161
// SettingsDelete response for deleting an organization
160162
func SettingsDelete(ctx *context.Context) {
161163
ctx.Data["Title"] = ctx.Tr("org.settings")
164+
ctx.Data["PageIsOrgSettings"] = true
162165
ctx.Data["PageIsSettingsDelete"] = true
163166

164167
if ctx.Req.Method == "POST" {
@@ -188,6 +191,7 @@ func SettingsDelete(ctx *context.Context) {
188191
// Webhooks render webhook list page
189192
func Webhooks(ctx *context.Context) {
190193
ctx.Data["Title"] = ctx.Tr("org.settings")
194+
ctx.Data["PageIsOrgSettings"] = true
191195
ctx.Data["PageIsSettingsHooks"] = true
192196
ctx.Data["BaseLink"] = ctx.Org.OrgLink + "/settings/hooks"
193197
ctx.Data["BaseLinkNew"] = ctx.Org.OrgLink + "/settings/hooks"
@@ -219,6 +223,7 @@ func DeleteWebhook(ctx *context.Context) {
219223
// Labels render organization labels page
220224
func Labels(ctx *context.Context) {
221225
ctx.Data["Title"] = ctx.Tr("repo.labels")
226+
ctx.Data["PageIsOrgSettings"] = true
222227
ctx.Data["PageIsOrgSettingsLabels"] = true
223228
ctx.Data["RequireTribute"] = true
224229
ctx.Data["LabelTemplates"] = models.LabelTemplates

templates/org/menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
{{if .IsOrganizationOwner}}
2222
<div class="right menu">
23-
<a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.OrgLink}}/settings">
23+
<a class="{{if .PageIsOrgSettings}}active{{end}} item" href="{{.OrgLink}}/settings">
2424
{{svg "octicon-tools"}} {{.i18n.Tr "repo.settings"}}
2525
</a>
2626
</div>

0 commit comments

Comments
 (0)