fix: add missing navigation for pagination (#540)

This commit is contained in:
Robert Kaussow 2022-11-16 11:06:35 +01:00 committed by GitHub
parent 54b7d1388f
commit 2f752b32ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 0 deletions

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "Stránka není přeložena:"
propertylist_required: povinné propertylist_required: povinné
propertylist_optional: volitené propertylist_optional: volitené
propertylist_default: výchozí propertylist_default: výchozí
pagination_page_prev: předchozí
pagination_page_next: další
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "Seite nicht übersetzt:"
propertylist_required: erforderlich propertylist_required: erforderlich
propertylist_optional: optional propertylist_optional: optional
propertylist_default: Standardwert propertylist_default: Standardwert
pagination_page_prev: vorher
pagination_page_next: weiter
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "Page not translated:"
propertylist_required: required propertylist_required: required
propertylist_optional: optional propertylist_optional: optional
propertylist_default: default propertylist_default: default
pagination_page_prev: prev
pagination_page_next: next
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "Pagina non tradotta:"
propertylist_required: richiesto propertylist_required: richiesto
propertylist_optional: opzionale propertylist_optional: opzionale
propertylist_default: valore predefinito propertylist_default: valore predefinito
pagination_page_prev: precedente
pagination_page_next: prossimo
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "未翻訳のページ:"
propertylist_required: 必須 propertylist_required: 必須
propertylist_optional: 任意 propertylist_optional: 任意
propertylist_default: 既定値 propertylist_default: 既定値
pagination_page_prev:
pagination_page_next:
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -47,3 +47,7 @@ language_switch_no_tranlation_prefix: "页面未翻译:"
propertylist_required: 需要 propertylist_required: 需要
propertylist_optional: 可选 propertylist_optional: 可选
propertylist_default: 默认值 propertylist_default: 默认值
pagination_page_prev: 以前
pagination_page_next: 下一个
pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}"

View File

@ -31,6 +31,7 @@
</footer> </footer>
</article> </article>
{{ end }} {{ end }}
{{ partial "pagination.html" . }}
{{ end }} {{ end }}
{{ define "post-tag" }} {{ define "post-tag" }}

View File

@ -28,4 +28,5 @@
</footer> </footer>
</article> </article>
{{ end }} {{ end }}
{{ partial "pagination.html" . }}
{{ end }} {{ end }}

View File

@ -0,0 +1,22 @@
{{ $pag := $.Paginator }}
<nav class="gdoc-paging flex flex-even align-center" role="navigation">
<div class="gdoc-paging__item gdoc-paging__item--prev">
{{ if $pag.HasPrev }}
<a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Prev.URL }}">
<i class="gdoc-icon">gdoc_keyboard_arrow_left</i>
{{ i18n "pagination_page_prev" | upper }}
</a>
{{ end }}
</div>
<div class="gdoc-paging__state">{{ i18n "pagination_page_state" $pag }}</div>
<div class="gdoc-paging__item gdoc-paging__item--next">
{{ if $pag.HasNext }}
<a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Next.URL }}">
{{ i18n "pagination_page_next" | upper }}
<i class="gdoc-icon">gdoc_keyboard_arrow_right</i>
</a>
{{ end }}
</div>
</nav>

View File

@ -29,6 +29,7 @@
</footer> </footer>
</article> </article>
{{ end }} {{ end }}
{{ partial "pagination.html" . }}
{{ end }} {{ end }}
{{ define "post-tag" }} {{ define "post-tag" }}

View File

@ -679,6 +679,32 @@ svg.gdoc-icon {
} }
} }
.gdoc-paging {
padding: $padding-16 0;
&__item {
flex: 1 1 0;
a:visited {
color: var(--link-color);
}
a:hover,
a:visited:hover {
background: var(--link-color);
color: $gray-100;
}
&--next {
text-align: right;
}
&--prev {
text-align: left;
}
}
}
.gdoc-error { .gdoc-error {
padding: $padding-96 $padding-16; padding: $padding-96 $padding-16;
margin: 0 auto; margin: 0 auto;

View File

@ -1,6 +1,7 @@
@media print { @media print {
.gdoc-nav, .gdoc-nav,
.gdoc-footer .container span:not(:first-child), .gdoc-footer .container span:not(:first-child),
.gdoc-paging,
.editpage { .editpage {
display: none; display: none;
} }