Skip to content

Commit 5ebe735

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Refactor RepoBranchTagSelector (go-gitea#32681) Allow to disable the password-based login (sign-in) form (go-gitea#32687) Fix JS error when reply comment on Conversation page (go-gitea#32685) fix(go-gitea#32667): 🐛 Fixe a keystring misuse and refactor duplicates keystrings (go-gitea#32668)
2 parents 24e46aa + e3e3260 commit 5ebe735

File tree

20 files changed

+370
-354
lines changed

20 files changed

+370
-354
lines changed

custom/conf/app.example.ini

+13-9
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ LEVEL = Info
784784
;; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token
785785
;ENABLE_BASIC_AUTHENTICATION = true
786786
;;
787+
;; Show the password sign-in form (for password-based login), otherwise, only show OAuth2 login methods.
788+
;; If you set it to false, maybe it also needs to set ENABLE_BASIC_AUTHENTICATION to false to completely disable password-based authentication.
789+
;ENABLE_PASSWORD_SIGNIN_FORM = true
790+
;;
787791
;; More detail: https://github.com/gogits/gogs/issues/165
788792
;ENABLE_REVERSE_PROXY_AUTHENTICATION = false
789793
; Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible.
@@ -1944,13 +1948,13 @@ LEVEL = Info
19441948
;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
19451949
;MINIO_SECRET_ACCESS_KEY =
19461950
;;
1947-
;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`.
1948-
;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables
1949-
;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,
1950-
;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION),
1951+
;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`.
1952+
;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables
1953+
;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,
1954+
;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION),
19511955
;; or the DefaultIAMRoleEndpoint if not provided otherwise.
19521956
;MINIO_IAM_ENDPOINT =
1953-
;;
1957+
;;
19541958
;; Minio bucket to store the attachments only available when STORAGE_TYPE is `minio`
19551959
;MINIO_BUCKET = gitea
19561960
;;
@@ -2695,10 +2699,10 @@ LEVEL = Info
26952699
;; Minio secretAccessKey to connect only available when STORAGE_TYPE is `minio`
26962700
;MINIO_SECRET_ACCESS_KEY =
26972701
;;
2698-
;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`.
2699-
;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables
2700-
;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,
2701-
;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION),
2702+
;; Preferred IAM Endpoint to override Minio's default IAM Endpoint resolution only available when STORAGE_TYPE is `minio`.
2703+
;; If not provided and STORAGE_TYPE is `minio`, will search for and derive endpoint from known environment variables
2704+
;; (AWS_CONTAINER_AUTHORIZATION_TOKEN, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,
2705+
;; AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN, AWS_ROLE_SESSION_NAME, AWS_REGION),
27022706
;; or the DefaultIAMRoleEndpoint if not provided otherwise.
27032707
;MINIO_IAM_ENDPOINT =
27042708
;;

modules/cache/cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestTest(t *testing.T) {
4343
elapsed, err := Test()
4444
assert.NoError(t, err)
4545
// mem cache should take from 300ns up to 1ms on modern hardware ...
46-
assert.Less(t, elapsed, SlowCacheThreshold)
46+
assert.Less(t, elapsed, time.Millisecond)
4747
}
4848

4949
func TestGetCache(t *testing.T) {

modules/setting/service.go

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var Service = struct {
4141
AllowOnlyInternalRegistration bool
4242
AllowOnlyExternalRegistration bool
4343
ShowRegistrationButton bool
44+
EnablePasswordSignInForm bool
4445
ShowMilestonesDashboardPage bool
4546
RequireSignInView bool
4647
EnableNotifyMail bool
@@ -159,6 +160,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
159160
Service.ShowMilestonesDashboardPage = sec.Key("SHOW_MILESTONES_DASHBOARD_PAGE").MustBool(true)
160161
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
161162
Service.EnableBasicAuth = sec.Key("ENABLE_BASIC_AUTHENTICATION").MustBool(true)
163+
Service.EnablePasswordSignInForm = sec.Key("ENABLE_PASSWORD_SIGNIN_FORM").MustBool(true)
162164
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
163165
Service.EnableReverseProxyAuthAPI = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION_API").MustBool()
164166
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()

options/locale/locale_en-US.ini

-2
Original file line numberDiff line numberDiff line change
@@ -1461,8 +1461,6 @@ issues.new.no_items = No items
14611461
issues.new.milestone = Milestone
14621462
issues.new.no_milestone = No Milestone
14631463
issues.new.clear_milestone = Clear milestone
1464-
issues.new.open_milestone = Open Milestones
1465-
issues.new.closed_milestone = Closed Milestones
14661464
issues.new.assignees = Assignees
14671465
issues.new.clear_assignees = Clear assignees
14681466
issues.new.no_assignees = No Assignees

routers/web/auth/auth.go

+17-31
Original file line numberDiff line numberDiff line change
@@ -160,54 +160,42 @@ func CheckAutoLogin(ctx *context.Context) bool {
160160
return false
161161
}
162162

163-
// SignIn render sign in page
164-
func SignIn(ctx *context.Context) {
163+
func prepareSignInPageData(ctx *context.Context) {
165164
ctx.Data["Title"] = ctx.Tr("sign_in")
166-
167-
if CheckAutoLogin(ctx) {
168-
return
169-
}
170-
171-
if ctx.IsSigned {
172-
RedirectAfterLogin(ctx)
173-
return
174-
}
175-
176-
oauth2Providers, err := oauth2.GetOAuth2Providers(ctx, optional.Some(true))
177-
if err != nil {
178-
ctx.ServerError("UserSignIn", err)
179-
return
180-
}
181-
ctx.Data["OAuth2Providers"] = oauth2Providers
165+
ctx.Data["OAuth2Providers"], _ = oauth2.GetOAuth2Providers(ctx, optional.Some(true))
182166
ctx.Data["Title"] = ctx.Tr("sign_in")
183167
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login"
184168
ctx.Data["PageIsSignIn"] = true
185169
ctx.Data["PageIsLogin"] = true
186170
ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled(ctx)
171+
ctx.Data["EnablePasswordSignInForm"] = setting.Service.EnablePasswordSignInForm
187172

188173
if setting.Service.EnableCaptcha && setting.Service.RequireCaptchaForLogin {
189174
context.SetCaptchaData(ctx)
190175
}
176+
}
191177

178+
// SignIn render sign in page
179+
func SignIn(ctx *context.Context) {
180+
if CheckAutoLogin(ctx) {
181+
return
182+
}
183+
if ctx.IsSigned {
184+
RedirectAfterLogin(ctx)
185+
return
186+
}
187+
prepareSignInPageData(ctx)
192188
ctx.HTML(http.StatusOK, tplSignIn)
193189
}
194190

195191
// SignInPost response for sign in request
196192
func SignInPost(ctx *context.Context) {
197-
ctx.Data["Title"] = ctx.Tr("sign_in")
198-
199-
oauth2Providers, err := oauth2.GetOAuth2Providers(ctx, optional.Some(true))
200-
if err != nil {
201-
ctx.ServerError("UserSignIn", err)
193+
if !setting.Service.EnablePasswordSignInForm {
194+
ctx.Error(http.StatusForbidden)
202195
return
203196
}
204-
ctx.Data["OAuth2Providers"] = oauth2Providers
205-
ctx.Data["Title"] = ctx.Tr("sign_in")
206-
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login"
207-
ctx.Data["PageIsSignIn"] = true
208-
ctx.Data["PageIsLogin"] = true
209-
ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled(ctx)
210197

198+
prepareSignInPageData(ctx)
211199
if ctx.HasError() {
212200
ctx.HTML(http.StatusOK, tplSignIn)
213201
return
@@ -216,8 +204,6 @@ func SignInPost(ctx *context.Context) {
216204
form := web.GetForm(ctx).(*forms.SignInForm)
217205

218206
if setting.Service.EnableCaptcha && setting.Service.RequireCaptchaForLogin {
219-
context.SetCaptchaData(ctx)
220-
221207
context.VerifyCaptcha(ctx, tplSignIn, form)
222208
if ctx.Written() {
223209
return

templates/repo/branch_dropdown.tmpl

+40-70
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,57 @@
11
{{/* Attributes:
2-
* root
32
* ContainerClasses
4-
* (TODO: search "branch_dropdown" in the template directory)
5-
*/}}
6-
{{$defaultSelectedRefName := $.root.BranchName}}
7-
{{if and .root.IsViewTag (not .noTag)}}
8-
{{$defaultSelectedRefName = .root.TagName}}
9-
{{end}}
10-
{{if eq $defaultSelectedRefName ""}}
11-
{{$defaultSelectedRefName = $.root.Repository.DefaultBranch}}
12-
{{end}}
13-
14-
{{$type := ""}}
15-
{{if and .root.IsViewTag (not .noTag)}}
16-
{{$type = "tag"}}
17-
{{else if .root.IsViewBranch}}
18-
{{$type = "branch"}}
19-
{{else}}
20-
{{$type = "tree"}}
21-
{{end}}
3+
* Repository
4+
* CurrentRefType: eg. "branch", "tag"
5+
* CurrentRefShortName: eg. "master", "v1.0"
6+
* CurrentTreePath
7+
* RefLinkTemplate: redirect to the link when a branch/tag is selected
8+
* RefFormActionTemplate: change the parent form's action when a branch/tag is selected
9+
* DropdownFixedText: the text to show in the dropdown (mainly used by "release page"), if empty, the text will be the branch/tag name
10+
* ShowTabBranches
11+
* ShowTabTagsTab
12+
* AllowCreateNewRef
2213

23-
{{$showBranchesInDropdown := not .root.HideBranchesInDropdown}}
14+
Search "repo/branch_dropdown" in the template directory to find all occurrences.
15+
*/}}
16+
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
17+
data-text-release-compare="{{ctx.Locale.Tr "repo.release.compare"}}"
18+
data-text-branches="{{ctx.Locale.Tr "repo.branches"}}"
19+
data-text-tags="{{ctx.Locale.Tr "repo.tags"}}"
20+
data-text-filter-branch="{{ctx.Locale.Tr "repo.pulls.filter_branch"}}"
21+
data-text-filter-tag="{{ctx.Locale.Tr "repo.find_tag"}}"
22+
data-text-default-branch-label="{{ctx.Locale.Tr "repo.default_branch_label"}}"
23+
data-text-create-tag="{{ctx.Locale.Tr "repo.tag.create_tag"}}"
24+
data-text-create-branch="{{ctx.Locale.Tr "repo.branch.create_branch"}}"
25+
data-text-create-ref-from="{{ctx.Locale.Tr "repo.branch.create_from"}}"
26+
data-text-no-results="{{ctx.Locale.Tr "no_results_found"}}"
2427

25-
<script type="module">
26-
const data = {
27-
'textReleaseCompare': {{ctx.Locale.Tr "repo.release.compare"}},
28-
'textCreateTag': {{ctx.Locale.Tr "repo.tag.create_tag"}},
29-
'textCreateBranch': {{ctx.Locale.Tr "repo.branch.create_branch"}},
30-
'textCreateBranchFrom': {{ctx.Locale.Tr "repo.branch.create_from"}},
31-
'textBranches': {{ctx.Locale.Tr "repo.branches"}},
32-
'textTags': {{ctx.Locale.Tr "repo.tags"}},
33-
'textDefaultBranchLabel': {{ctx.Locale.Tr "repo.default_branch_label"}},
28+
data-current-repo-default-branch="{{.Repository.DefaultBranch}}"
29+
data-current-repo-link="{{.Repository.Link}}"
30+
data-current-tree-path="{{.CurrentTreePath}}"
31+
data-current-ref-type="{{.CurrentRefType}}"
32+
data-current-ref-short-name="{{.CurrentRefShortName}}"
3433

35-
'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}',
36-
'showBranchesInDropdown': {{$showBranchesInDropdown}},
37-
'searchFieldPlaceholder': '{{if $.noTag}}{{ctx.Locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{ctx.Locale.Tr "repo.find_tag"}}{{end}}...',
38-
'branchForm': {{$.branchForm}},
39-
'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}},
40-
'setAction': {{.setAction}},
41-
'submitForm': {{.submitForm}},
42-
'viewType': {{$type}},
43-
'refName': {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}},
44-
'commitIdShort': {{ShortSha .root.CommitID}},
45-
'tagName': {{.root.TagName}},
46-
'branchName': {{.root.BranchName}},
47-
'noTag': {{.noTag}},
48-
'defaultSelectedRefName': {{$defaultSelectedRefName}},
49-
'repoDefaultBranch': {{.root.Repository.DefaultBranch}},
50-
'enableFeed': {{.root.EnableFeed}},
51-
'rssURLPrefix': '{{$.root.RepoLink}}/rss/branch/',
52-
'branchURLPrefix': '{{if .branchURLPrefix}}{{.branchURLPrefix}}{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/branch/{{end}}',
53-
'branchURLSuffix': '{{if .branchURLSuffix}}{{.branchURLSuffix}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}',
54-
'tagURLPrefix': '{{if .tagURLPrefix}}{{.tagURLPrefix}}{{else if .release}}{{$.root.RepoLink}}/compare/{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/tag/{{end}}',
55-
'tagURLSuffix': '{{if .tagURLSuffix}}{{.tagURLSuffix}}{{else if .release}}...{{if .release.IsDraft}}{{PathEscapeSegments .release.Target}}{{else}}{{if .release.TagName}}{{PathEscapeSegments .release.TagName}}{{else}}{{PathEscapeSegments .release.Sha1}}{{end}}{{end}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}',
56-
'repoLink': {{.root.RepoLink}},
57-
'treePath': {{.root.TreePath}},
58-
'branchNameSubURL': {{.root.BranchNameSubURL}},
59-
'noResults': {{ctx.Locale.Tr "no_results_found"}},
60-
};
61-
{{if .release}}
62-
data.release = {
63-
'tagName': {{.release.TagName}},
64-
};
65-
{{end}}
66-
window.config.pageData.branchDropdownDataList = window.config.pageData.branchDropdownDataList || [];
67-
window.config.pageData.branchDropdownDataList.push(data);
68-
</script>
34+
data-ref-link-template="{{.RefLinkTemplate}}"
35+
data-ref-form-action-template="{{.RefFormActionTemplate}}"
36+
data-dropdown-fixed-text="{{.DropdownFixedText}}"
37+
data-show-tab-branches="{{.ShowTabBranches}}"
38+
data-show-tab-tags="{{.ShowTabTags}}"
39+
data-allow-create-new-ref="{{.AllowCreateNewRef}}"
6940

70-
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}">
41+
data-enable-feed="{{ctx.RootData.EnableFeed}}"
42+
>
7143
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
7244
<div class="ui dropdown custom branch-selector-dropdown ellipsis-items-nowrap">
7345
<div class="ui button branch-dropdown-button">
7446
<span class="flex-text-block gt-ellipsis">
75-
{{if .release}}
76-
{{ctx.Locale.Tr "repo.release.compare"}}
77-
{{else}}
78-
{{if eq $type "tag"}}
47+
{{if not .DropdownFixedText}}
48+
{{if .ShowTabTags}}
7949
{{svg "octicon-tag"}}
80-
{{else}}
50+
{{else if .ShowTabBranches}}
8151
{{svg "octicon-git-branch"}}
8252
{{end}}
83-
<strong ref="dropdownRefName" class="tw-ml-2 tw-inline-block gt-ellipsis">{{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong>
8453
{{end}}
54+
<strong class="tw-ml-2 tw-inline-block gt-ellipsis">{{Iif .DropdownFixedText .SelectedRefShortName}}</strong>
8555
</span>
8656
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
8757
</div>

templates/repo/commit_page.tmpl

+9-8
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@
6666
</div>
6767
<div class="content">
6868
<p id="cherry-pick-content" class="branch-dropdown"></p>
69-
{{template "repo/branch_dropdown" dict "root" .
70-
"noTag" true "disableCreateBranch" true
71-
"branchForm" "branch-dropdown-form"
72-
"branchURLPrefix" (printf "%s/_cherrypick/%s/" $.RepoLink .CommitID) "branchURLSuffix" ""
73-
"setAction" true "submitForm" true}}
74-
<form method="get" action="{{$.RepoLink}}/_cherrypick/{{.CommitID}}/{{if $.BranchName}}{{PathEscapeSegments $.BranchName}}{{else}}{{PathEscapeSegments $.Repository.DefaultBranch}}{{end}}" id="branch-dropdown-form">
75-
<input type="hidden" name="ref" value="{{if $.BranchName}}{{$.BranchName}}{{else}}{{$.Repository.DefaultBranch}}{{end}}">
76-
<input type="hidden" name="refType" value="branch">
69+
70+
<form method="get">
71+
{{template "repo/branch_dropdown" dict
72+
"Repository" .Repository
73+
"ShowTabBranches" true
74+
"CurrentRefType" "branch"
75+
"CurrentRefShortName" (Iif $.BranchName $.Repository.DefaultBranch)
76+
"RefFormActionTemplate" (print "{RepoLink}/_cherrypick/" .CommitID "/{RefShortName}")
77+
}}
7778
<input type="hidden" id="cherry-pick-type" name="cherry-pick-type"><br>
7879
<button type="submit" id="cherry-pick-submit" class="ui primary button"></button>
7980
</form>

templates/repo/commits.tmpl

+18-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@
55
{{template "repo/sub_menu" .}}
66
<div class="repo-button-row">
77
<div class="repo-button-row-left">
8-
{{template "repo/branch_dropdown" dict "root" .}}
8+
9+
{{$branchDropdownCurrentRefType := "branch"}}
10+
{{$branchDropdownCurrentRefShortName := .BranchName}}
11+
{{if .IsViewTag}}
12+
{{$branchDropdownCurrentRefType := "tag"}}
13+
{{$branchDropdownCurrentRefShortName := .TagName}}
14+
{{end}}
15+
{{template "repo/branch_dropdown" dict
16+
"Repository" .Repository
17+
"ShowTabBranches" true
18+
"ShowTabTags" true
19+
"CurrentRefType" $branchDropdownCurrentRefType
20+
"CurrentRefShortName" $branchDropdownCurrentRefShortName
21+
"CurrentTreePath" .TreePath
22+
"RefLinkTemplate" "{RepoLink}/commits/{RefType}/{RefShortName}/{TreePath}"
23+
"AllowCreateNewRef" .CanCreateBranch
24+
}}
25+
926
<a href="{{.RepoLink}}/graph" class="ui basic small compact button">
1027
{{svg "octicon-git-branch"}}
1128
{{ctx.Locale.Tr "repo.commit_graph"}}

templates/repo/home.tmpl

+16-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,22 @@
4747
{{$isHomepage := (eq $n 0)}}
4848
<div class="repo-button-row" data-is-homepage="{{$isHomepage}}">
4949
<div class="repo-button-row-left">
50-
{{template "repo/branch_dropdown" dict "root" .}}
50+
{{$branchDropdownCurrentRefType := "branch"}}
51+
{{$branchDropdownCurrentRefShortName := .BranchName}}
52+
{{if .IsViewTag}}
53+
{{$branchDropdownCurrentRefType := "tag"}}
54+
{{$branchDropdownCurrentRefShortName := .TagName}}
55+
{{end}}
56+
{{template "repo/branch_dropdown" dict
57+
"Repository" .Repository
58+
"ShowTabBranches" true
59+
"ShowTabTags" true
60+
"CurrentRefType" $branchDropdownCurrentRefType
61+
"CurrentRefShortName" $branchDropdownCurrentRefShortName
62+
"CurrentTreePath" .TreePath
63+
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
64+
"AllowCreateNewRef" .CanCreateBranch
65+
}}
5166
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
5267
{{$cmpBranch := ""}}
5368
{{if ne .Repository.ID .BaseRepo.ID}}

templates/repo/issue/filter_actions.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
{{end}}
5959
{{if .ClosedMilestones}}
6060
<div class="divider"></div>
61-
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
61+
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
6262
{{range .ClosedMilestones}}
6363
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
6464
{{.Name}}

templates/repo/issue/sidebar/milestone_list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
2323
<div class="scrolling menu">
2424
{{if $data.OpenMilestones}}
25-
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_milestone"}}</div>
25+
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
2626
{{range $data.OpenMilestones}}
2727
<a class="item muted" data-value="{{.ID}}" href="{{$pageMeta.RepoLink}}/issues?milestone={{.ID}}">
2828
{{svg "octicon-milestone" 18}} {{.Name}}
@@ -31,7 +31,7 @@
3131
{{end}}
3232
{{if and $data.OpenMilestones $data.ClosedMilestones}}<div class="divider"></div>{{end}}
3333
{{if $data.ClosedMilestones}}
34-
<div class="header">{{ctx.Locale.Tr "repo.issues.new.closed_milestone"}}</div>
34+
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
3535
{{range $data.ClosedMilestones}}
3636
<a class="item muted" data-value="{{.ID}}" href="{{$pageMeta.RepoLink}}/issues?milestone={{.ID}}">
3737
{{svg "octicon-milestone" 18}} {{.Name}}

0 commit comments

Comments
 (0)