From 5908bb103003912bd0ba3cefa66f2ff815ee8d8e Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 24 Jun 2019 21:23:52 +0100 Subject: Make diff line-marker non-selectable (#7279) * Make diff line-marker non-selectable * Move to use data-* as per @mrsdizzie * fix missing line nums * Add a minimum-width to force right-align of the line num * Move line-type-marker into separate column --- templates/repo/diff/box.tmpl | 17 ++++++++++++----- templates/repo/diff/section_unified.tmpl | 12 ++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'templates/repo') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 2bdf9e5881..94ac094fa4 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -120,8 +120,11 @@ {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} - - {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}} + + + + +
{{if $line.LeftIdx}}{{end}}
{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}} @@ -129,10 +132,12 @@ {{end}}
{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
- - {{if $line.RightIdx}}{{$line.RightIdx}}{{end}} + + + + +
{{if $line.RightIdx}}{{end}}
- {{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}} + @@ -143,6 +148,7 @@ {{if gt (len $line.Comments) 0}} + {{if eq $line.GetCommentSide "previous"}}
@@ -156,6 +162,7 @@ {{end}} + {{if eq $line.GetCommentSide "proposed"}}
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 53ccaedbc2..5706e4cdee 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -8,13 +8,16 @@ {{/* {{if gt $j 0}}{{end}} */}} {{else}} - - {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}} + + - - {{if $line.RightIdx}}{{$line.RightIdx}}{{end}} + + {{end}} + +
+ {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}} + @@ -25,6 +28,7 @@ {{if gt (len $line.Comments) 0}} +
-- cgit v1.2.3