]> source.dussan.org Git - gitea.git/commitdiff
Fix the wrong line number in the diff view page when expanded twice. (#31431)
authorcharles <30816317+charles7668@users.noreply.github.com>
Thu, 20 Jun 2024 17:43:42 +0000 (01:43 +0800)
committerGitHub <noreply@github.com>
Thu, 20 Jun 2024 17:43:42 +0000 (17:43 +0000)
close #31149, regression of #29385 (incorrect `data-query=`)

templates/repo/diff/blob_excerpt.tmpl

index 2874ac6a55c61f8ab59fd9b88a86dc441f70c7d8..cc2237029bd6822de16b86e8d189907b81843af9 100644 (file)
                        <td colspan="2" class="lines-num">
                                <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
                                        {{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
-                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
+                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
                                                        {{svg "octicon-fold-down"}}
                                                </button>
                                        {{end}}
                                        {{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
-                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
+                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
                                                        {{svg "octicon-fold-up"}}
                                                </button>
                                        {{end}}
                                        {{if eq $expandDirection 2}}
-                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
+                                               <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
                                                        {{svg "octicon-fold"}}
                                                </button>
                                        {{end}}