From 54375572e11d23dacb20c5742d171af3072d7b9c Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Thu, 28 Nov 2024 00:46:17 +0300 Subject: Серьезная реновация MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/neonxp/layouts/partials/pagination.html | 98 -------------------------- 1 file changed, 98 deletions(-) delete mode 100644 themes/neonxp/layouts/partials/pagination.html (limited to 'themes/neonxp/layouts/partials/pagination.html') diff --git a/themes/neonxp/layouts/partials/pagination.html b/themes/neonxp/layouts/partials/pagination.html deleted file mode 100644 index ee7a171..0000000 --- a/themes/neonxp/layouts/partials/pagination.html +++ /dev/null @@ -1,98 +0,0 @@ -{{- $validFormats := slice "default" "terse" }} - -{{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }} -{{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }} - -{{- $page := . }} -{{- $format := "default" }} - -{{- if reflect.IsMap . }} - {{- with .page }} - {{- $page = . }} - {{- else }} - {{- errorf $msg1 }} - {{- end }} - {{- with .format }} - {{- $format = lower . }} - {{- end }} -{{- end }} - -{{- if in $validFormats $format }} - {{- if gt $page.Paginator.TotalPages 1 }} - - {{- end }} -{{- else }} - {{- errorf $msg2 (delimit $validFormats ", ") }} -{{- end -}} - -{{/* --------------------------------------------------------------------- */}} -{{- define "partials/inline/pagination/default" }} - {{- with .Paginator }} - {{- $currentPageNumber := .PageNumber }} - - {{- with .First }} - {{- if ne $currentPageNumber .PageNumber }} -
  • - -
  • - {{- else }} -
  • - -
  • - {{- end }} - {{- end }} - - {{- with .Prev }} -
  • - -
  • - {{- else }} -
  • - -
  • - {{- end }} - - {{- $slots := 5 }} - {{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }} - {{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }} - {{- if lt (add (sub $end $start) 1) $slots }} - {{- $start = math.Max 1 (add (sub $end $slots) 1) }} - {{- end }} - - {{- range $k := seq $start $end }} - {{- if eq $.Paginator.PageNumber $k }} -
  • - [{{ $k }}] -
  • - {{- else }} -
  • - {{ $k }} -
  • - {{- end }} - {{- end }} - - {{- with .Next }} -
  • - -
  • - {{- else }} -
  • - -
  • - {{- end }} - - {{- with .Last }} - {{- if ne $currentPageNumber .PageNumber }} -
  • - -
  • - {{- else }} -
  • - -
  • - {{- end }} - {{- end }} - {{- end }} -{{- end -}} \ No newline at end of file -- cgit v1.2.3