diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-04 09:02:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 01:02:51 +0000 |
commit | 8553b4600e3035b6f6ad6907c37cebd013fa4d64 (patch) | |
tree | 110ec9003d7966549d427a52af15ba1b02f3324a /templates | |
parent | 77e29e0c39392f142627303bd798fb55258072b2 (diff) | |
download | gitea-8553b4600e3035b6f6ad6907c37cebd013fa4d64.tar.gz gitea-8553b4600e3035b6f6ad6907c37cebd013fa4d64.zip |
Add an trailing slash to dashboard links (#29555)
Fix #29533, and add some tests for "base/paginate.tmpl"
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base/paginate.tmpl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/templates/base/paginate.tmpl b/templates/base/paginate.tmpl index 503817c339..ef7d0b341b 100644 --- a/templates/base/paginate.tmpl +++ b/templates/base/paginate.tmpl @@ -1,13 +1,15 @@ -{{$paginationLink := .Page.GetParams}} +{{$paginationParams := .Page.GetParams}} +{{$paginationLink := $.Link}} +{{if eq $paginationLink AppSubUrl}}{{$paginationLink = print $paginationLink "/"}}{{end}} {{with .Page.Paginater}} {{if gt .TotalPages 1}} <div class="center page buttons"> <div class="ui borderless pagination menu"> - <a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$.Link}}{{if $paginationLink}}?{{$paginationLink}}{{end}}"{{end}}> + <a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$paginationLink}}{{if $paginationParams}}?{{$paginationParams}}{{end}}"{{end}}> {{svg "gitea-double-chevron-left" 16 "gt-mr-2"}} <span class="navigation_label">{{ctx.Locale.Tr "admin.first_page"}}</span> </a> - <a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}> + <a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$paginationLink}}?page={{.Previous}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}> {{svg "octicon-chevron-left" 16 "gt-mr-2"}} <span class="navigation_label">{{ctx.Locale.Tr "repo.issues.previous"}}</span> </a> @@ -15,14 +17,14 @@ {{if eq .Num -1}} <a class="disabled item">...</a> {{else}} - <a class="{{if .IsCurrent}}active {{end}}item gt-content-center" {{if not .IsCurrent}}href="{{$.Link}}?page={{.Num}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>{{.Num}}</a> + <a class="{{if .IsCurrent}}active {{end}}item gt-content-center" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a> {{end}} {{end}} - <a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}> + <a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$paginationLink}}?page={{.Next}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}> <span class="navigation_label">{{ctx.Locale.Tr "repo.issues.next"}}</span> {{svg "octicon-chevron-right" 16 "gt-ml-2"}} </a> - <a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$.Link}}?page={{.TotalPages}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}> + <a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$paginationLink}}?page={{.TotalPages}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}> <span class="navigation_label">{{ctx.Locale.Tr "admin.last_page"}}</span> {{svg "gitea-double-chevron-right" 16 "gt-ml-2"}} </a> |