1
0
Fork 0
forked from forgejo/forgejo

Link to previous blames in file blame page (#16259)

Adds a link to each blame hunk, to view the blame of an earlier version of the file, similar to GitHub. Also refactors the blame render from fmtstring based to template based.

* Fix blame bottom line and add blame prior button

* Jump to previous parent commit from the commit.

* Fix previous commit link

* Fix previous blame link

* Fix the given file not exist in the previous commit.

* Fix blameRow struct not export

* fix theming issues, rename template var

* remove unused LastCommit fetch

* fix location of blame-hunk divider

* rewrite previous commit checks

* remove duplicate commit lookup

its already resolved and stored in ctx.Repo.Commit!

* split out blamePart processing into function

Co-authored-by: rogerluo410 <rogerluo410@gmail.com>
This commit is contained in:
Norwin 2021-06-28 01:13:20 +02:00 committed by GitHub
parent 59c58553ba
commit 9c6aeb47f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 166 additions and 101 deletions

View file

@ -106,6 +106,7 @@
--color-markup-code-block: #00000010;
--color-button: #ffffff;
--color-code-bg: #ffffff;
--color-code-sidebar-bg: #f5f5f5;
--color-shadow: #00000030;
--color-secondary-bg: #f4f4f4;
--color-expand-button: #d8efff;
@ -1442,6 +1443,14 @@ a.ui.label:hover {
margin-right: 0;
}
.lines-blame-btn {
padding-left: 10px;
padding-right: 10px;
text-align: right !important;
background-color: var(--color-code-sidebar-bg);
width: 2%;
}
.lines-num {
padding-left: 10px;
padding-right: 10px;
@ -1507,7 +1516,7 @@ a.ui.label:hover {
.blame .lines-num {
padding: 0 !important;
background-color: #f5f5f5;
background-color: var(--color-code-sidebar-bg);
}
.blame .lines-code {
@ -1532,7 +1541,7 @@ a.ui.label:hover {
vertical-align: top;
color: #999999;
padding: 0 !important;
background: #f5f5f5;
background: var(--color-code-sidebar-bg);
width: 1%;
-moz-user-select: none;
-ms-user-select: none;
@ -1574,6 +1583,10 @@ a.ui.label:hover {
}
}
.top-line-blame {
border-top: 1px solid var(--color-secondary);
}
.lines-code,
.lines-commit {
.bottom-line {