Skip to content

Commit 10e3d4c

Browse files
lunnySysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Fix disable download button (go-gitea#20701)
1 parent c0ae2cd commit 10e3d4c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/context/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (ctx *Context) HTML(status int, name base.TplName) {
224224
ctx.Data["TemplateLoadTimes"] = func() string {
225225
return strconv.FormatInt(time.Since(tmplStartTime).Nanoseconds()/1e6, 10) + "ms"
226226
}
227-
if err := ctx.Render.HTML(ctx.Resp, status, string(name), ctx.Data); err != nil {
227+
if err := ctx.Render.HTML(ctx.Resp, status, string(name), templates.BaseVars().Merge(ctx.Data)); err != nil {
228228
if status == http.StatusInternalServerError && name == base.TplName("status/500") {
229229
ctx.PlainText(http.StatusInternalServerError, "Unable to find status/500 template")
230230
return

templates/repo/branch/list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
{{svg "octicon-git-branch"}}
113113
</div>
114114
{{end}}
115-
{{if (not .IsDeleted)}}
115+
{{if and (not .IsDeleted) (not $.DisableDownloadSourceArchives)}}
116116
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" (.Name)}}" data-position="top right">
117117
{{svg "octicon-download"}}
118118
<div class="menu">

templates/repo/home.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<div class="ui action tiny input" id="clone-panel">
121121
{{template "repo/clone_buttons" .}}
122122
{{template "repo/clone_script" .}}
123-
{{if not .DisableDownloadSourceArchives}}
123+
{{if not $.DisableDownloadSourceArchives}}
124124
<button id="download-btn" class="ui basic small compact jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right">
125125
{{svg "octicon-download"}}
126126
<div class="menu">

0 commit comments

Comments
 (0)