Skip to content

Commit cdf05fb

Browse files
committed
Add missing changes
1 parent cd3a9af commit cdf05fb

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

routers/web/repo/blame.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ func RefBlame(ctx *context.Context) {
4646
return
4747
}
4848

49-
// ctx.Data["RepoPreferences"] = ctx.Session.Get("repoPreferences")
49+
showFileViewTreeSidebar := true
50+
if ctx.Doer != nil {
51+
v, err := user_model.GetUserSetting(ctx, ctx.Doer.ID, user_model.SettingsKeyShowFileViewTreeSidebar, "true")
52+
if err != nil {
53+
log.Error("GetUserSetting: %v", err)
54+
} else {
55+
showFileViewTreeSidebar, _ = strconv.ParseBool(v)
56+
}
57+
}
5058
ctx.Data["RepoPreferences"] = &preferencesForm{
51-
ShowFileViewTreeSidebar: true,
59+
ShowFileViewTreeSidebar: showFileViewTreeSidebar,
5260
}
5361

5462
branchLink := ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()

routers/web/repo/file.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Copyright 2014 The Gogs Authors. All rights reserved.
2-
// Copyright 2018 The Gitea Authors. All rights reserved.
1+
// Copyright 2024 The Gitea Authors. All rights reserved.
32
// SPDX-License-Identifier: MIT
43

54
package repo

routers/web/repo/view.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ import (
4646
)
4747

4848
const (
49-
tplRepoEMPTY templates.TplName = "repo/empty"
50-
tplRepoHome templates.TplName = "repo/home"
51-
tplRepoHomeContent templates.TplName = "repo/home_content"
52-
tplRepoViewList templates.TplName = "repo/view_list"
53-
tplWatchers templates.TplName = "repo/watchers"
54-
tplForks templates.TplName = "repo/forks"
55-
tplMigrating templates.TplName = "repo/migrate/migrating"
49+
tplRepoEMPTY templates.TplName = "repo/empty"
50+
tplRepoHome templates.TplName = "repo/home"
51+
tplRepoHomeContent templates.TplName = "repo/home_content"
52+
tplRepoViewList templates.TplName = "repo/view_list"
53+
tplWatchers templates.TplName = "repo/watchers"
54+
tplForks templates.TplName = "repo/forks"
55+
tplMigrating templates.TplName = "repo/migrate/migrating"
5656
)
5757

5858
type fileInfo struct {

0 commit comments

Comments
 (0)