Skip to content

Commit faf5705

Browse files
yp05327wxiaoguang
andauthored
GitHub like repo home page (#32213)
Move some components (description, license, release, language stats) to sidebar --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent 3c4a062 commit faf5705

20 files changed

+1245
-1043
lines changed

options/locale/locale_en-US.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ confirm_delete_selected = Confirm to delete all selected items?
145145

146146
name = Name
147147
value = Value
148+
readme = Readme
148149

149150
filter = Filter
150151
filter.clear = Clear Filter
@@ -1045,7 +1046,8 @@ generate_repo = Generate Repository
10451046
generate_from = Generate From
10461047
repo_desc = Description
10471048
repo_desc_helper = Enter short description (optional)
1048-
repo_lang = Language
1049+
repo_no_desc = No description provided
1050+
repo_lang = Languages
10491051
repo_gitignore_helper = Select .gitignore templates.
10501052
repo_gitignore_helper_desc = Choose which files not to track from a list of templates for common languages. Typical artifacts generated by each language's build tools are included on .gitignore by default.
10511053
issue_labels = Issue Labels

routers/web/repo/blame.go

-6
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ func RefBlame(ctx *context.Context) {
114114
ctx.Data["UsesIgnoreRevs"] = result.UsesIgnoreRevs
115115
ctx.Data["FaultyIgnoreRevsFile"] = result.FaultyIgnoreRevsFile
116116

117-
// Get Topics of this repo
118-
renderRepoTopics(ctx)
119-
if ctx.Written() {
120-
return
121-
}
122-
123117
commitNames := processBlameParts(ctx, result.Parts)
124118
if ctx.Written() {
125119
return

routers/web/repo/branch.go

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func Branches(ctx *context.Context) {
8989
pager := context.NewPagination(int(branchesCount), pageSize, page, 5)
9090
pager.SetDefaultParams(ctx)
9191
ctx.Data["Page"] = pager
92-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
9392
ctx.HTML(http.StatusOK, tplBranch)
9493
}
9594

routers/web/repo/commit.go

-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ func Commits(ctx *context.Context) {
102102
pager := context.NewPagination(int(commitsCount), pageSize, page, 5)
103103
pager.SetDefaultParams(ctx)
104104
ctx.Data["Page"] = pager
105-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
106105
ctx.HTML(http.StatusOK, tplCommits)
107106
}
108107

@@ -219,8 +218,6 @@ func SearchCommits(ctx *context.Context) {
219218
}
220219
ctx.Data["Username"] = ctx.Repo.Owner.Name
221220
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
222-
ctx.Data["RefName"] = ctx.Repo.RefName
223-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
224221
ctx.HTML(http.StatusOK, tplCommits)
225222
}
226223

@@ -266,7 +263,6 @@ func FileHistory(ctx *context.Context) {
266263
pager := context.NewPagination(int(commitsCount), setting.Git.CommitsRangeSize, page, 5)
267264
pager.SetDefaultParams(ctx)
268265
ctx.Data["Page"] = pager
269-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
270266
ctx.HTML(http.StatusOK, tplCommits)
271267
}
272268

routers/web/repo/release.go

-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"code.gitea.io/gitea/services/context/upload"
3232
"code.gitea.io/gitea/services/forms"
3333
releaseservice "code.gitea.io/gitea/services/release"
34-
repo_service "code.gitea.io/gitea/services/repository"
3534
)
3635

3736
const (
@@ -153,9 +152,6 @@ func Releases(ctx *context.Context) {
153152
ctx.Data["Title"] = ctx.Tr("repo.release.releases")
154153
ctx.Data["IsViewBranch"] = false
155154
ctx.Data["IsViewTag"] = true
156-
// Disable the showCreateNewBranch form in the dropdown on this page.
157-
ctx.Data["CanCreateBranch"] = false
158-
ctx.Data["HideBranchesInDropdown"] = true
159155

160156
listOptions := db.ListOptions{
161157
Page: ctx.FormInt("page"),
@@ -193,9 +189,6 @@ func Releases(ctx *context.Context) {
193189
pager := context.NewPagination(int(numReleases), listOptions.PageSize, listOptions.Page, 5)
194190
pager.SetDefaultParams(ctx)
195191
ctx.Data["Page"] = pager
196-
197-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
198-
199192
ctx.HTML(http.StatusOK, tplReleasesList)
200193
}
201194

@@ -205,9 +198,6 @@ func TagsList(ctx *context.Context) {
205198
ctx.Data["Title"] = ctx.Tr("repo.release.tags")
206199
ctx.Data["IsViewBranch"] = false
207200
ctx.Data["IsViewTag"] = true
208-
// Disable the showCreateNewBranch form in the dropdown on this page.
209-
ctx.Data["CanCreateBranch"] = false
210-
ctx.Data["HideBranchesInDropdown"] = true
211201
ctx.Data["CanCreateRelease"] = ctx.Repo.CanWrite(unit.TypeReleases) && !ctx.Repo.Repository.IsArchived
212202

213203
namePattern := ctx.FormTrim("q")
@@ -254,8 +244,6 @@ func TagsList(ctx *context.Context) {
254244
pager.SetDefaultParams(ctx)
255245
ctx.Data["Page"] = pager
256246
ctx.Data["PageIsViewCode"] = !ctx.Repo.Repository.UnitEnabled(ctx, unit.TypeReleases)
257-
ctx.Data["LicenseFileName"] = repo_service.LicenseFileName
258-
259247
ctx.HTML(http.StatusOK, tplTagsList)
260248
}
261249

0 commit comments

Comments
 (0)