mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 09:09:36 -05:00
12ee544411
Wrapping was initially added in https://github.com/go-gitea/gitea/pull/2789 but it is currently disabled because the rule that applies wrapping to the wrap class did not have enough CSS specificity. Resolved the issue by using a general selector that matches all code boxes. The previous wrap class was removed because it had only been inconsistenly applied to various code boxes and because I found no easy way to add classes to code boxes rendered in Markdown. Also removed a seemingly useless :before on code view and added padding to restore the spacing.
41 lines
1.9 KiB
Cheetah
41 lines
1.9 KiB
Cheetah
{{$file := .file}}
|
|
{{$highlightClass := $file.GetHighlightClass}}
|
|
{{range $j, $section := $file.Sections}}
|
|
{{range $k, $line := $section.Lines}}
|
|
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
|
|
{{if eq .GetType 4}}
|
|
<td colspan="2" class="lines-num">
|
|
{{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
|
|
</td>
|
|
{{else}}
|
|
<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-num lines-num-new">
|
|
<span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
|
|
</td>
|
|
{{end}}
|
|
<td class="lines-code {{if (not $line.RightIdx)}}lines-code-old{{end}}">
|
|
{{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="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
|
|
</td>
|
|
</tr>
|
|
{{if gt (len $line.Comments) 0}}
|
|
<tr>
|
|
<td colspan="2" class="lines-num"></td>
|
|
<td 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_datahandler" dict "hidden" true "reply" (index $line.Comments 0).ReviewID "root" $.root "comment" (index $line.Comments 0)}}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|