|
5 | 5 | {{if eq .GetType 4}}
|
6 | 6 | {{$expandDirection := $line.GetExpandDirection}}
|
7 | 7 | <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
|
8 |
| - <div class="lines-comment"> |
9 |
| - <div> |
10 |
| - {{if $line.SectionInfo.HasComments}} |
11 |
| - <button> |
12 |
| - {{svg "octicon-comment-discussion"}} |
13 |
| - </button> |
14 |
| - {{end}} |
15 |
| - </div> |
16 |
| - <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
17 |
| - {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
18 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
19 |
| - {{svg "octicon-fold-down"}} |
20 |
| - </button> |
21 |
| - {{end}} |
22 |
| - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
23 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
24 |
| - {{svg "octicon-fold-up"}} |
25 |
| - </button> |
26 |
| - {{end}} |
27 |
| - {{if eq $expandDirection 2}} |
28 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
29 |
| - {{svg "octicon-fold"}} |
30 |
| - </button> |
31 |
| - {{end}} |
32 |
| - </div> |
33 |
| - </div> |
| 8 | + <div class="lines-comment"> |
| 9 | + <div> |
| 10 | + {{if $line.SectionInfo.HasComments}} |
| 11 | + <button> |
| 12 | + {{svg "octicon-comment-discussion"}} |
| 13 | + </button> |
| 14 | + {{end}} |
| 15 | + </div> |
| 16 | + <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
| 17 | + {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
| 18 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 19 | + {{svg "octicon-fold-down"}} |
| 20 | + </button> |
| 21 | + {{end}} |
| 22 | + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
| 23 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 24 | + {{svg "octicon-fold-up"}} |
| 25 | + </button> |
| 26 | + {{end}} |
| 27 | + {{if eq $expandDirection 2}} |
| 28 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 29 | + {{svg "octicon-fold"}} |
| 30 | + </button> |
| 31 | + {{end}} |
| 32 | + </div> |
| 33 | + </div> |
34 | 34 | </td>
|
35 | 35 | <td colspan="7" class="lines-code lines-code-old ">{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}{{/*
|
36 | 36 | */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}</td>
|
|
39 | 39 | <td class="lines-escape lines-escape-old">{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
|
40 | 40 | <td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
|
41 | 41 | <td class="lines-code lines-code-old">{{/*
|
42 |
| - */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* |
| 42 | + */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* |
43 | 43 | */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{/*
|
44 | 44 | */}}{{svg "octicon-plus"}}{{/*
|
45 |
| - */}}</button>{{/* |
| 45 | + */}}</button>{{/* |
46 | 46 | */}}{{end}}{{/*
|
47 | 47 | */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/*
|
48 | 48 | */}}<code class="code-inner"></code>{{/*
|
|
52 | 52 | <td class="lines-escape lines-escape-new">{{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
|
53 | 53 | <td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
|
54 | 54 | <td class="lines-code lines-code-new">{{/*
|
55 |
| - */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* |
| 55 | + */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* |
56 | 56 | */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{/*
|
57 | 57 | */}}{{svg "octicon-plus"}}{{/*
|
58 |
| - */}}</button>{{/* |
| 58 | + */}}</button>{{/* |
59 | 59 | */}}{{end}}{{/*
|
60 | 60 | */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/*
|
61 | 61 | */}}<code class="code-inner"></code>{{/*
|
|
64 | 64 | {{end}}
|
65 | 65 | </tr>
|
66 | 66 | {{if $line.Comments}}
|
67 |
| - <tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> |
68 |
| - <td class="add-comment-right" colspan="5"> |
69 |
| - {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}} |
70 |
| - </td> |
71 |
| - </tr> |
72 |
| - {{end}} |
| 67 | + <tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> |
| 68 | + <td class="add-comment-right" colspan="5"> |
| 69 | + {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}} |
| 70 | + </td> |
| 71 | + </tr> |
| 72 | + {{end}} |
73 | 73 | {{end}}
|
74 | 74 | {{else}}
|
75 | 75 | {{range $k, $line := $.section.Lines}}
|
|
78 | 78 | {{if eq .GetType 4}}
|
79 | 79 | {{$expandDirection := $line.GetExpandDirection}}
|
80 | 80 | <td colspan="2" class="lines-num">
|
81 |
| - <div class="lines-comment"> |
82 |
| - <div> |
83 |
| - {{if $line.SectionInfo.HasComments}} |
84 |
| - <button> |
85 |
| - {{svg "octicon-comment-discussion"}} |
86 |
| - </button> |
87 |
| - {{end}} |
88 |
| - </div> |
89 |
| - <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
90 |
| - {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
91 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
92 |
| - {{svg "octicon-fold-down"}} |
93 |
| - </button> |
94 |
| - {{end}} |
95 |
| - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
96 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
97 |
| - {{svg "octicon-fold-up"}} |
98 |
| - </button> |
99 |
| - {{end}} |
100 |
| - {{if eq $expandDirection 2}} |
101 |
| - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
102 |
| - {{svg "octicon-fold"}} |
103 |
| - </button> |
104 |
| - {{end}} |
105 |
| - </div> |
106 |
| - </div> |
| 81 | + <div class="lines-comment"> |
| 82 | + <div> |
| 83 | + {{if $line.SectionInfo.HasComments}} |
| 84 | + <button> |
| 85 | + {{svg "octicon-comment-discussion"}} |
| 86 | + </button> |
| 87 | + {{end}} |
| 88 | + </div> |
| 89 | + <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
| 90 | + {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
| 91 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 92 | + {{svg "octicon-fold-down"}} |
| 93 | + </button> |
| 94 | + {{end}} |
| 95 | + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
| 96 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 97 | + {{svg "octicon-fold-up"}} |
| 98 | + </button> |
| 99 | + {{end}} |
| 100 | + {{if eq $expandDirection 2}} |
| 101 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&pull={{$.PageIsPullFiles}}&anchor={{$.Anchor}}&file_name={{$.section.FileName}}"> |
| 102 | + {{svg "octicon-fold"}} |
| 103 | + </button> |
| 104 | + {{end}} |
| 105 | + </div> |
| 106 | + </div> |
107 | 107 | </td>
|
108 | 108 | {{else}}
|
109 | 109 | <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
|
112 | 112 | <td class="lines-escape">{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
|
113 | 113 | <td class="lines-type-marker"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
114 | 114 | <td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">
|
115 |
| - {{if and $.SignedUserID $.PageIsPullFiles}} |
116 |
| - <button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{svg "octicon-plus"}} |
117 |
| - </button> |
118 |
| - {{end}} |
119 |
| - <code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code></td> |
| 115 | + {{if and $.SignedUserID $.PageIsPullFiles}} |
| 116 | + <button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}"> |
| 117 | + {{svg "octicon-plus"}} |
| 118 | + </button> |
| 119 | + {{end}} |
| 120 | + <code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}> |
| 121 | + {{$inlineDiff.Content}} |
| 122 | + </code> |
| 123 | + </td> |
120 | 124 | </tr>
|
121 | 125 | {{if $line.Comments}}
|
122 |
| - <tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> |
123 |
| - <td class="add-comment-right" colspan="5"> |
124 |
| - {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} |
125 |
| - </td> |
126 |
| - </tr> |
127 |
| - {{end}} |
| 126 | + <tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> |
| 127 | + <td class="add-comment-right" colspan="5"> |
| 128 | + {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} |
| 129 | + </td> |
| 130 | + </tr> |
| 131 | + {{end}} |
128 | 132 | {{end}}
|
129 | 133 | {{end}}
|
0 commit comments