From 8dd523595de6ff11a0591932138899e344b5de87 Mon Sep 17 00:00:00 2001 From: vimux Date: Fri, 23 Feb 2018 15:27:28 +0300 Subject: [PATCH] Add pagination --- layouts/_default/list.html | 1 + layouts/partials/pagination.html | 25 +++++++++++++++++++++++++ static/css/main.css | 20 ++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 layouts/partials/pagination.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 626ce37..9c80384 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -7,5 +7,6 @@ {{ end }} + {{ partial "pagination.html" . }} {{ partial "footer.html" . }} \ No newline at end of file diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..2b01dc2 --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,25 @@ +{{- $pag := $.Paginator }} +{{- if gt $pag.TotalPages 1 }} + +{{- end }} \ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css index 56e243e..00f16a1 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -374,6 +374,26 @@ summary { text-decoration: none; } +/* Pagination */ +.pagination { + margin-bottom: 10px; + text-align: center; + background-color: #2a2a2a; +} + +.pagination__item { + display: inline-block; + padding: 4px 10px; + font-weight: 700; + border: 1px solid; +} + +.pagination__item--gap { + color: #888; + cursor: default; + border-color: #888; +} + /* Footer */ .footer { padding: 10px 0;