From 59b901be99fbc8e6db8ff512d2d55f2ef3b4931a Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 29 Sep 2023 20:20:42 +0200 Subject: [PATCH 1/5] link to file from its history --- templates/repo/commits_list.tmpl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 9fb2788a4596..0005434a6ef4 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -4,8 +4,9 @@ {{ctx.Locale.Tr "repo.commits.author"}} SHA1 - {{ctx.Locale.Tr "repo.commits.message"}} + {{ctx.Locale.Tr "repo.commits.message"}} {{ctx.Locale.Tr "repo.commits.date"}} + {{if $.FileName}}{{ctx.Locale.Tr "repo.diff.view_file"}}{{end}} @@ -76,6 +77,11 @@ {{else}} {{TimeSince .Author.When ctx.Locale}} {{end}} + {{if $.FileName}} + + {{svg "octicon-file-code"}} + + {{end}} {{end}} From 234002858edb3e91671155346339366677ee42cb Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 29 Sep 2023 21:04:30 +0200 Subject: [PATCH 2/5] apply code review suggestions Co-authored-by: silverwind --- templates/repo/commits_list.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 0005434a6ef4..2002aabf8b53 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -4,9 +4,9 @@ {{ctx.Locale.Tr "repo.commits.author"}} SHA1 - {{ctx.Locale.Tr "repo.commits.message"}} + {{ctx.Locale.Tr "repo.commits.message"}} {{ctx.Locale.Tr "repo.commits.date"}} - {{if $.FileName}}{{ctx.Locale.Tr "repo.diff.view_file"}}{{end}} + {{if $.FileName}}{{ctx.Locale.Tr "repo.commit.operations"}}{{end}} @@ -79,7 +79,7 @@ {{end}} {{if $.FileName}} - {{svg "octicon-file-code"}} + {{svg "octicon-file-code"}} {{end}} From 925ad52f01b38c2376f49cc75a009aebdede108b Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 29 Sep 2023 21:32:20 +0200 Subject: [PATCH 3/5] move copy commit sha button to operations --- templates/repo/commits_list.tmpl | 12 +++++------- web_src/css/base.css | 7 ------- web_src/css/repo.css | 3 --- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 2002aabf8b53..0c603e870a43 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -6,7 +6,7 @@ SHA1 {{ctx.Locale.Tr "repo.commits.message"}} {{ctx.Locale.Tr "repo.commits.date"}} - {{if $.FileName}}{{ctx.Locale.Tr "repo.commit.operations"}}{{end}} + {{ctx.Locale.Tr "repo.commit.operations"}} @@ -26,7 +26,6 @@ {{end}} - {{$class := "ui sha label"}} {{if .Signature}} {{$class = (print $class " isSigned")}} @@ -77,11 +76,10 @@ {{else}} {{TimeSince .Author.When ctx.Locale}} {{end}} - {{if $.FileName}} - - {{svg "octicon-file-code"}} - - {{end}} + + + {{if $.FileName}}{{svg "octicon-file-code"}}{{end}} + {{end}} diff --git a/web_src/css/base.css b/web_src/css/base.css index 1a4e9d16a143..c1ebc959d550 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1328,13 +1328,6 @@ img.ui.avatar, display: inline-block; /* not sure whether it is still needed */ } -.ui .button.copy-commit-sha { - border: 1px solid var(--color-light-border); - margin-right: 3px; - padding: 6px 6px 4px; - background: var(--color-light); -} - .ui .button.truncate { display: inline-block; max-width: 100%; diff --git a/web_src/css/repo.css b/web_src/css/repo.css index d0d001bf5232..0bb8d8bb7501 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -3049,9 +3049,6 @@ tbody.commit-list { .commit-table th.sha { display: none !important; } - .commit-table .commit-list .copy-commit-sha { - display: none !important; - } .comment-header { flex-wrap: wrap; } From 4ba1f7bed856191a44a81c8acd12096a324de029 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sat, 30 Sep 2023 11:07:43 +0200 Subject: [PATCH 4/5] remove header title --- templates/repo/commits_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 0c603e870a43..c5003af4aee0 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -6,7 +6,7 @@ SHA1 {{ctx.Locale.Tr "repo.commits.message"}} {{ctx.Locale.Tr "repo.commits.date"}} - {{ctx.Locale.Tr "repo.commit.operations"}} + From 672393f37851648b8ac70a69e3726e3ea5a1ec2b Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 1 Oct 2023 13:39:05 +0200 Subject: [PATCH 5/5] ui improvements by silverwind --- options/locale/locale_en-US.ini | 2 ++ templates/repo/commits_list.tmpl | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8667e77a8950..d15228d1893f 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -97,6 +97,7 @@ locked = Locked copy = Copy copy_url = Copy URL +copy_hash = Copy hash copy_content = Copy content copy_branch = Copy branch name copy_success = Copied! @@ -1283,6 +1284,7 @@ commits.signed_by_untrusted_user = Signed by untrusted user commits.signed_by_untrusted_user_unmatched = Signed by untrusted user who does not match committer commits.gpg_key_id = GPG Key ID commits.ssh_key_fingerprint = SSH Key Fingerprint +commits.view_path=View at this point in history commit.operations = Operations commit.revert = Revert diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index c5003af4aee0..6793a81bffee 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -76,9 +76,11 @@ {{else}} {{TimeSince .Author.When ctx.Locale}} {{end}} - - - {{if $.FileName}}{{svg "octicon-file-code"}}{{end}} + +
+ + {{if $.FileName}}{{svg "octicon-file-code"}}{{end}} +
{{end}}