]> source.dussan.org Git - gitea.git/commitdiff
Fix adding review comment in split view (#5038)
authorLauris BH <lauris@nix.lv>
Tue, 9 Oct 2018 00:46:23 +0000 (03:46 +0300)
committerLunny Xiao <xiaolunwen@gmail.com>
Tue, 9 Oct 2018 00:46:23 +0000 (08:46 +0800)
templates/repo/diff/box.tmpl

index 8be31ce8c31f67ed8cabcf833e7d08d132384564..b5bc3ee07377c9d5340f7362f63fd18963cd3f4b 100644 (file)
                                                                                                        <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
                                                                                                                <td class="lines-num lines-num-old">
                                                                                                                        <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
-
                                                                                                                </td>
                                                                                                                <td class="lines-code lines-code-old halfwidth">
-                                                                                                                       {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
+                                                                                                                       {{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}
                                                                                                                                <a class="ui green button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">+</a>
                                                                                                                        {{end}}
                                                                                                                        <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
                                                                                                                </td>
 
                                                                                                                <td class="lines-code lines-code-new halfwidth">
-                                                                                                                       {{if and $.root.SignedUserID $line.CanComment}}
+                                                                                                                       {{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}
                                                                                                                                <a class="ui green button add-code-comment add-code-comment-right" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}">+</a>
                                                                                                                        {{end}}
                                                                                                                        <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>