Skip to content

Commit 1851c96

Browse files
committed
Merge branch 'lunny/disable_dl_source_ui' of github.com:lunny/gitea into lunny/disable_dl_source_ui
2 parents 9bd5db9 + 908f4a1 commit 1851c96

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ ROUTER = console
880880
;ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false
881881

882882
;; Don't allow download source archive files from UI
883-
;DISABLED_DOWNLOAD_SOURCE_ARCHIVES = false
883+
;DISABLE_DOWNLOAD_SOURCE_ARCHIVES = false
884884

885885
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
886886
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
7878
- `DEFAULT_BRANCH`: **main**: Default branch name of all repositories.
7979
- `ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to adopt unadopted repositories
8080
- `ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to delete unadopted repositories
81-
- `DISABLED_DOWNLOAD_SOURCE_ARCHIVES`: **false**: Don't allow download source archive files from UI
81+
- `DISABLE_DOWNLOAD_SOURCE_ARCHIVES`: **false**: Don't allow download source archive files from UI
8282

8383
### Repository - Editor (`repository.editor`)
8484

modules/setting/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var (
4848
DefaultBranch string
4949
AllowAdoptionOfUnadoptedRepositories bool
5050
AllowDeleteOfUnadoptedRepositories bool
51-
DisabledDownloadSourceArchives bool
51+
DisableDownloadSourceArchives bool
5252

5353
// Repository editor settings
5454
Editor struct {

modules/templates/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func BaseVars() Vars {
3939
"ShowMilestonesDashboardPage": setting.Service.ShowMilestonesDashboardPage,
4040
"ShowFooterBranding": setting.ShowFooterBranding,
4141
"ShowFooterVersion": setting.ShowFooterVersion,
42-
"DisabledDownloadSourceArchives": setting.Repository.DisabledDownloadSourceArchives,
42+
"DisableDownloadSourceArchives": setting.Repository.DisableDownloadSourceArchives,
4343

4444
"EnableSwagger": setting.API.EnableSwagger,
4545
"EnableOpenIDSignIn": setting.Service.EnableOpenIDSignIn,

routers/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func RegisterRoutes(m *web.Route) {
291291
}
292292

293293
dlSourceEnabled := func(ctx *context.Context) {
294-
if setting.Repository.DisabledDownloadSourceArchives {
294+
if setting.Repository.DisableDownloadSourceArchives {
295295
ctx.Error(http.StatusNotFound)
296296
return
297297
}

templates/mail/release.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<br>
3232
{{.locale.Tr "mail.release.downloads"}}
3333
<ul>
34-
{{if not .DisabledDownloadSourceArchives}}
34+
{{if not .DisableDownloadSourceArchives}}
3535
<li>
3636
<a href="{{.Release.Repo.Link}}/archive/{{.Release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{.locale.Tr "mail.release.download.zip"}}</strong></a>
3737
</li>

templates/repo/branch/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{svg "octicon-git-branch"}}
2727
</div>
2828
{{end}}
29-
{{if not $.DisabledDownloadSourceArchives}}
29+
{{if not $.DisableDownloadSourceArchives}}
3030
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}" data-position="top right">
3131
{{svg "octicon-download"}}
3232
<div class="menu">

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
{{if eq $n 0}}
125125
<div class="ui action tiny input" id="clone-panel">
126126
{{template "repo/clone_buttons" .}}
127-
{{if not .DisabledDownloadSourceArchives}}
127+
{{if not .DisableDownloadSourceArchives}}
128128
<button id="download-btn" class="ui basic jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right">
129129
{{svg "octicon-download"}}
130130
<div class="menu">

templates/repo/release/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="download df ac">
3838
{{if $.Permission.CanRead $.UnitTypeCode}}
3939
<a class="mr-3 mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
40-
{{if not $.DisabledDownloadSourceArchives}}
40+
{{if not $.DisableDownloadSourceArchives}}
4141
<a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a>
4242
<a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}TAR.GZ</a>
4343
{{end}}
@@ -106,7 +106,7 @@
106106
<div class="download">
107107
{{if $.Permission.CanRead $.UnitTypeCode}}
108108
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
109-
{{if not $.DisabledDownloadSourceArchives}}
109+
{{if not $.DisableDownloadSourceArchives}}
110110
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
111111
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
112112
{{end}}
@@ -150,7 +150,7 @@
150150
{{$.locale.Tr "repo.release.downloads"}}
151151
</summary>
152152
<ul class="list">
153-
{{if and (not $.DisabledDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
153+
{{if and (not $.DisableDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
154154
<li>
155155
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
156156
</li>

0 commit comments

Comments
 (0)