diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index a80abe263f..2874ac6a55 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -2,19 +2,20 @@ {{range $k, $line := $.section.Lines}} {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} -
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} @@ -48,19 +49,20 @@ {{range $k, $line := $.section.Lines}} {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} -
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index 349f0c3dfc..37b42bcb37 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -16,19 +16,20 @@ {{if or (ne .GetType 2) (not $hasmatch)}} {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} -
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index ec59f4d42e..708b333291 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -12,19 +12,20 @@ {{if eq .GetType 4}} {{if $.root.AfterCommitID}} + {{$expandDirection := $line.GetExpandDirection}} -
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} diff --git a/web_src/css/review.css b/web_src/css/review.css index 6337748939..0d69e36681 100644 --- a/web_src/css/review.css +++ b/web_src/css/review.css @@ -164,6 +164,11 @@ flex: 1; } +/* expand direction 3 is both ways with two buttons */ +.code-expander-buttons[data-expand-direction="3"] .code-expander-button { + height: 18px; +} + .code-expander-button:hover { background: var(--color-primary); color: var(--color-primary-contrast);