diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index f4f7732c50..caa428dc28 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -19,14 +19,14 @@ {{end}} - {{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}}{{/* + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}}{{/* */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff "locale" $.locale}} {{else}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}} {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.LeftIdx}}{{end}} - {{/* + {{/* */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff "locale" $.locale}}{{else}}{{/* */}}{{/* */}}{{end}}{{/* @@ -34,7 +34,7 @@ {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.RightIdx}}{{end}} - {{/* + {{/* */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff "locale" $.locale}}{{else}}{{/* */}}{{/* */}}{{end}}{{/* diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index c4b5ad042c..4fa81f4e62 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -1,4 +1,14 @@ {{$file := .file}} + + + + + + + + + + {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} {{$hasmatch := ne $line.Match -1}} @@ -33,7 +43,7 @@ {{if $line.LeftIdx}}{{if $leftDiff.EscapeStatus.Escaped}}{{end}}{{end}} - {{/* + {{/* */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/* */}}{{/* */}}{{svg "octicon-plus"}}{{/* @@ -48,7 +58,7 @@ {{if $match.RightIdx}}{{if $rightDiff.EscapeStatus.Escaped}}{{end}}{{end}} {{if $match.RightIdx}}{{end}} - {{/* + {{/* */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/* */}}{{/* */}}{{svg "octicon-plus"}}{{/* @@ -65,7 +75,7 @@ {{if $line.LeftIdx}}{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{end}} {{if $line.LeftIdx}}{{end}} - {{/* + {{/* */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2))}}{{/* */}}{{/* */}}{{svg "octicon-plus"}}{{/* @@ -80,7 +90,7 @@ {{if $line.RightIdx}}{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{end}} {{if $line.RightIdx}}{{end}} - {{/* + {{/* */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}{{/* */}}{{/* */}}{{svg "octicon-plus"}}{{/* @@ -98,9 +108,6 @@ {{$match := index $section.Lines $line.Match}} {{if or (gt (len $line.Comments) 0) (gt (len $match.Comments) 0)}} - - - {{if gt (len $line.Comments) 0}} {{if eq $line.GetCommentSide "previous"}} @@ -113,9 +120,6 @@ {{end}} {{end}} - - - {{if eq $line.GetCommentSide "proposed"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} @@ -130,9 +134,6 @@ {{end}} {{else if gt (len $line.Comments) 0}} - - - {{if gt (len $line.Comments) 0}} {{if eq $line.GetCommentSide "previous"}} @@ -140,9 +141,6 @@ {{end}} {{end}} - - - {{if eq $line.GetCommentSide "proposed"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index e0ec85f9a6..ba4ad5b513 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -1,4 +1,11 @@ {{$file := .file}} + + + + + + + {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} @@ -49,7 +56,6 @@ {{if gt (len $line.Comments) 0}} - {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index 7a1e3e9421..2ad3458501 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -48,7 +48,7 @@ {{.locale.Tr "repo.file_too_large"}} {{else}} {{.LineNums}} -
    {{.FileContent}}
+
    {{.FileContent}}
{{end}} diff --git a/web_src/css/repository.css b/web_src/css/repository.css index e84e80b679..4bb49dc439 100644 --- a/web_src/css/repository.css +++ b/web_src/css/repository.css @@ -1801,8 +1801,14 @@ padding: 0 !important; } -.repository .diff-file-box .code-diff tbody tr td.halfwidth { - width: 49%; /* halfwidth is used in split view - and in that case, 1% of each */ +.repository .diff-file-box .code-diff table { + table-layout: fixed; +} + +.repository .diff-file-box .code-diff tbody tr td.lines-num, +.repository .diff-file-box .code-diff tbody tr td.lines-escape, +.repository .diff-file-box .code-diff tbody tr td.lines-type-marker { + white-space: nowrap; } .repository .diff-file-box .code-diff tbody tr td.center { diff --git a/web_src/css/review.css b/web_src/css/review.css index 05456c381b..7e628a9dfc 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -53,12 +53,6 @@ margin-bottom: 0.5em; } -.add-comment .lines-num, -.add-comment .lines-escape, -.add-comment .lines-type-marker { - display: none; -} - .show-outdated:hover, .hide-outdated:hover { text-decoration: underline; diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 7265873b1b..8305038eac 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -548,18 +548,9 @@ export function initRepoPullRequestReview() { ntr = $(` ${isSplit ? ` - - - - - - ` : ` - - - `} `);