forked from forgejo/forgejo
Code review UI improvements and bugfixes (#4682)
* Code review UI improvements * More fixes to dark theme * Style fix * Fix to allow add code review comments only on review files tab * More readability dark style fixes * Fix commenting on deleted files. Fixes #4752 * Fix line blame getting for multiple corner cases
This commit is contained in:
parent
756eafaaf6
commit
4befec242a
11 changed files with 100 additions and 32 deletions
|
@ -125,7 +125,7 @@
|
|||
|
||||
</td>
|
||||
<td class="lines-code lines-code-old halfwidth">
|
||||
{{if and $.root.SignedUserID $line.CanComment}}
|
||||
{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
|
||||
<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>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{if $.hidden}}
|
||||
<button class="comment-form-reply ui green labeled icon tiny button"><i class="reply icon"></i> {{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
|
||||
{{end}}
|
||||
<form class="ui form {{if $.hidden}}hide comment-form{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post">
|
||||
<form class="ui form {{if $.hidden}}hide comment-form comment-form-reply{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post">
|
||||
{{$.root.CsrfTokenHtml}}
|
||||
<input type="hidden" name="side" value="{{if $.Side}}{{$.Side}}{{end}}">
|
||||
<input type="hidden" name="line" value="{{if $.Line}}{{$.Line}}{{end}}">
|
||||
|
@ -34,8 +34,10 @@
|
|||
class="ui submit green tiny button btn-start-review">{{$.root.i18n.Tr "repo.diff.comment.start_review"}}</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if not $.root.CurrentReview}}
|
||||
<button type="submit"
|
||||
class="ui submit tiny basic button btn-add-single">{{$.root.i18n.Tr "repo.diff.comment.add_single_comment"}}</button>
|
||||
{{end}}
|
||||
{{if or (not $.HasComments) $.hidden}}
|
||||
<button type="button" class="ui submit tiny basic button btn-cancel" onclick="cancelCodeComment(this);">{{$.root.i18n.Tr "cancel"}}</button>
|
||||
{{end}}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</td>
|
||||
{{end}}
|
||||
<td class="lines-code {{if (not $line.RightIdx)}}lines-code-old{{end}}">
|
||||
{{if and $.root.SignedUserID $line.CanComment}}
|
||||
{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
|
||||
<a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>
|
||||
{{end}}
|
||||
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue