Skip to content

Commit fb3954f

Browse files
lafrikslunny
authored andcommitted
Fix adding review comment in split view (#5038)
1 parent 6df46c5 commit fb3954f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

templates/repo/diff/box.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@
122122
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
123123
<td class="lines-num lines-num-old">
124124
<span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
125-
126125
</td>
127126
<td class="lines-code lines-code-old halfwidth">
128-
{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
127+
{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}
129128
<a class="ui green button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">+</a>
130129
{{end}}
131130
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
@@ -135,7 +134,7 @@
135134
</td>
136135

137136
<td class="lines-code lines-code-new halfwidth">
138-
{{if and $.root.SignedUserID $line.CanComment}}
137+
{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}
139138
<a class="ui green button add-code-comment add-code-comment-right" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}">+</a>
140139
{{end}}
141140
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>

0 commit comments

Comments
 (0)