From 0a9794a6bc0e34ebee88355baa52b2b08b908bd8 Mon Sep 17 00:00:00 2001 From: 6543 <24977596+6543@users.noreply.github.com> Date: Mon, 29 Jul 2019 23:20:39 +0200 Subject: [PATCH] hide delete/restore button on archived repos [backport] (#7660) * hide delete/restore button on archived repos close issue #7653 * backport vor v1.9 * hide column also * move protected icon to first colum backport parts of https://github.com/go-gitea/gitea/pull/7461 * backport comit divergenze fix https://github.com/go-gitea/gitea/issues/7625 --- templates/repo/branch/list.tmpl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 2028797bdb..cba6b740c5 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -12,7 +12,12 @@ - +
{{.DefaultBranch}} + {{if .IsProtected}} + + {{end}} + {{.DefaultBranch}} +
@@ -27,9 +32,9 @@ {{.i18n.Tr "repo.branch.name"}} + - - {{if and $.IsWriter (not $.IsMirror)}} + {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}} {{.i18n.Tr "repo.branch.delete_head"}} {{end}} @@ -43,6 +48,9 @@ {{.Name}}

{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}

{{else}} + {{if .IsProtected}} + + {{end}} {{.Name}}

{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

{{end}} @@ -79,13 +87,11 @@ {{end}} {{end}} - {{if and $.IsWriter (not $.IsMirror)}} + {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}} - {{if .IsProtected}} - - {{else if .IsDeleted}} + {{if and .IsDeleted (not .IsProtected)}} - {{else}} + {{else if (not .IsProtected)}} {{end}}