From 711f6dc9b0f77b35706bcb31a41b5f6a9e50d401 Mon Sep 17 00:00:00 2001 From: Cherrg Date: Sat, 29 Jun 2019 11:18:49 +0200 Subject: [PATCH] Fix 7303 - remove unnessesary buttons on archived repos (#7326) * archived repo - remove - open/close button on issue list - assigne person on issue list Signed-off-by: Michael Gnehr * archived repo - remove - comment field on issue view - lock/unlock issue conversation button from sidebar on issue view Signed-off-by: Michael Gnehr * archived repo - add 'compare commits' button to pull request + remove new pull request button from compare view as the route is still working, and there is no need to be hidden Signed-off-by: Michael Gnehr --- options/locale/locale_en-US.ini | 1 + templates/repo/diff/compare.tmpl | 2 ++ templates/repo/issue/list.tmpl | 8 ++++++++ templates/repo/issue/view_content.tmpl | 4 +++- templates/repo/issue/view_content/sidebar.tmpl | 2 +- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 97e4e3f91..acaa98c3a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1866,6 +1866,7 @@ push_tag = pushed tag %[2]s to %[3]s delete_tag = deleted tag %[2]s from %[3]s delete_branch = deleted branch %[2]s from %[3]s compare_commits = Compare %d commits +compare_commits_general = Compare commits mirror_sync_push = synced commits to %[3]s at %[4]s from mirror mirror_sync_create = synced new reference %[2]s to %[3]s from mirror mirror_sync_delete = synced and deleted reference %[2]s at %[3]s from mirror diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index cc727422d..877241fb3 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -56,9 +56,11 @@ {{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}} {{else}} + {{if not .Repository.IsArchived}}
+ {{end}} diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 448ab1a75..3007c9910 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -17,6 +17,12 @@ {{.i18n.Tr "repo.pulls.new"}} {{end}} + {{else}} + {{if not .PageIsIssueList}} + + {{end}} {{end}}
@@ -132,6 +138,7 @@ this one correctly, but not the other one. */}}
+ {{end}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index de9ffdb93..cb85c5be9 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -70,7 +70,7 @@ {{ template "repo/issue/view_content/pull". }} {{end}} {{if .IsSigned}} - {{ if or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked)) }} + {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} {{else}} {{if .IsSigned}} + {{if .Repository.IsArchived}} + {{end}} {{else}}
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 853f68147..e50ac0a4b 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -336,7 +336,7 @@ {{end}}
- {{ if .IsRepoAdmin }} + {{ if and .IsRepoAdmin (not .Repository.IsArchived) }}