1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Improved comment rendering in "Files" view by adding Comments to DiffLine

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz
2018-05-12 19:09:42 +02:00
parent 58fb672d0d
commit 066086c390
9 changed files with 112 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
{{$file := .}}
{{$file := .file}}
{{$highlightClass := $file.GetHighlightClass}}
{{range $j, $section := $file.Sections}}
{{range $k, $line := $section.Lines}}
@@ -20,5 +20,19 @@
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
</td>
</tr>
{{if gt (len $line.Comments) 0}}
<tr>
<td colspan="4" class="add-comment-left add-comment-right">
<div class="field comment-code-cloud">
<div class="comment-list">
<ui class="ui comments">
{{ template "repo/diff/comments" dict "root" $.root "comments" $line.Comments}}
</ui>
</div>
{{template "repo/diff/comment_form" $.root }}
</div>
</td>
</tr>
{{end}}
{{end}}
{{end}}