From 842005439ff36b857cfcf9b54234163e6a49b5cf Mon Sep 17 00:00:00 2001 From: zzossig Date: Thu, 29 Oct 2020 22:27:37 +0900 Subject: fix #314 - Archive page shows error when there are 0 posts --- i18n/ca.toml | 3 +++ i18n/en.toml | 5 ++++- i18n/eo.toml | 5 ++++- i18n/es.toml | 3 +++ i18n/fa.toml | 5 ++++- i18n/fr.toml | 5 ++++- i18n/ko.toml | 5 ++++- i18n/ro.toml | 3 +++ i18n/zh.toml | 5 ++++- layouts/archive/list.html | 42 ++++++++++++++++++++----------------- layouts/talks/list.html | 53 ++++++++++++++++++++++++++--------------------- 11 files changed, 85 insertions(+), 49 deletions(-) diff --git a/i18n/ca.toml b/i18n/ca.toml index 8867101..64a7630 100644 --- a/i18n/ca.toml +++ b/i18n/ca.toml @@ -114,3 +114,6 @@ other = "solarized" [skin-kimbie] other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/en.toml b/i18n/en.toml index 3842736..506b78f 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/eo.toml b/i18n/eo.toml index ac80aae..94fc1f6 100644 --- a/i18n/eo.toml +++ b/i18n/eo.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/es.toml b/i18n/es.toml index 1dd00b3..647a71a 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -114,3 +114,6 @@ other = "solarized" [skin-kimbie] other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/fa.toml b/i18n/fa.toml index 206bbcd..661db0a 100644 --- a/i18n/fa.toml +++ b/i18n/fa.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/fr.toml b/i18n/fr.toml index 896d199..d4cba9a 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/ko.toml b/i18n/ko.toml index 8d2941c..f06b688 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/ro.toml b/i18n/ro.toml index 5fce423..d062ebf 100644 --- a/i18n/ro.toml +++ b/i18n/ro.toml @@ -114,3 +114,6 @@ other = "solarized" [skin-kimbie] other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/i18n/zh.toml b/i18n/zh.toml index b4c3ad3..dcf297b 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -113,4 +113,7 @@ other = "hacker" other = "solarized" [skin-kimbie] -other = "kimbie" \ No newline at end of file +other = "kimbie" + +[no-contents] +other = "Nothing to Display" \ No newline at end of file diff --git a/layouts/archive/list.html b/layouts/archive/list.html index 4925349..6ccd50f 100644 --- a/layouts/archive/list.html +++ b/layouts/archive/list.html @@ -16,27 +16,31 @@ {{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }} {{ end }} + {{ if gt (len $filteredPages) 0 }} {{ $paginator := .Paginate ($filteredPages.GroupByDate ($.Param "archiveGroupByDate" | default "2006")) ($.Param "archivePaginate") }} - {{ range ($paginator).PageGroups }} - {{ .Key }} - - {{ end }} + {{ .Key }} + + {{ end }} + {{ else }} + {{ i18n "no-contents" | default "There is nothing to display" }} + {{ end }} +
{{ partial "pagination/pagination" . }} diff --git a/layouts/talks/list.html b/layouts/talks/list.html index 023adf4..27aeedb 100644 --- a/layouts/talks/list.html +++ b/layouts/talks/list.html @@ -17,34 +17,39 @@ {{ end }}
{{ $pages := (where .Site.RegularPages "Section" "talks") }} - {{ $paginator := .Paginate ($pages.GroupByPublishDate ($.Param "talksGroupByDate" | default "2006")) ($.Param "talksPaginate") }} - {{ range ($paginator).PageGroups }} - {{ .Key }} - {{ end }} - + {{ else }} + {{ i18n "no-contents" | default "There is nothing to display" }} {{ end }} +
{{ partial "pagination/pagination" . }} -- cgit v1.2.3