From 4fd9eee6274dba2ec5d4ef4d8779b619b99cc473 Mon Sep 17 00:00:00 2001 From: Ciaran Ainsworth <ciaranainsworth@outlook.com> Date: Tue, 1 Feb 2022 17:24:26 +0100 Subject: [PATCH] Add link to CSS and implement new pagination --- theme/funkwhale/templates/base.html | 1 + theme/funkwhale/templates/pagination.html | 69 ++++++++++++++++++----- 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/theme/funkwhale/templates/base.html b/theme/funkwhale/templates/base.html index 9256f1d..5b429c4 100644 --- a/theme/funkwhale/templates/base.html +++ b/theme/funkwhale/templates/base.html @@ -17,6 +17,7 @@ <meta itemprop="description" content="{{ AUTHOR_DESCRIPTION }}"> <!-- Style Meta Data --> + <link rel="stylesheet" href="https://ui.funkwhale.audio/v0.1.2/css/funkwhale.css" type="text/css" /> <link rel="stylesheet" href="{{ SITEURL }}/theme/css/style.css" type="text/css"/> <link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css"/> diff --git a/theme/funkwhale/templates/pagination.html b/theme/funkwhale/templates/pagination.html index 8d27510..9aa1255 100644 --- a/theme/funkwhale/templates/pagination.html +++ b/theme/funkwhale/templates/pagination.html @@ -1,16 +1,57 @@ {% if DEFAULT_PAGINATION %} - <p class="paginator"> - {% if articles_page.has_previous() %} - {% if articles_page.previous_page_number() == 1 %} - <a href="{{ SITEURL }}/{{ page_name }}.html">~:)</a> - {% else %} - <a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() }}.html">~:)</a> + <nav class="pagination is-centered"> + <ul class="pagination-list"> + {% if articles_page.has_previous() %} + {% if articles_page.previous_page_number() == 1 %} + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}.html" aria-label="Goto page 1">1</a> + </li> + {% elif articles_page.previous_page_number() == 2 %} + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}.html" aria-label="Goto page 1">1</a> + </li> + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() }}.html" aria-label="Goto page {{ articles_page.previous_page_number() }}">{{ articles_page.previous_page_number() }}</a> + </li> + {% else %} + <li> + <a class="pagination-link" href="{{ SITEURL}}/{{ page_name }}.html" aria-label="Goto page 1">1</a> + </li> + <li> + <span class="pagination-ellipsis">…</span> + </li> + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() }}.html">{{ articles_page.previous_page_number() }}</a> + </li> + {% endif %} {% endif %} - {% endif %} - {{ articles_page.number }} ~ {{ articles_paginator.num_pages }} - {% if articles_page.has_next() %} - <a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html">(:~</a> - {% endif %} - </p> -{% endif %} - + <li> + <a class="pagination-link is-current" aria-label="Page {{ articles_page.number }}" aria-current="page">{{ articles_page.number }}</a> + </li> + {% if articles_page.has_next() %} + {% if articles_page.next_page_number() == articles_paginator.num_pages %} + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html" aria-label="Goto page {{ articles_page.next_page_number() }}">{{ articles_page.next_page_number() }}</a> + </li> + {% elif articles_page.next_page_number() == articles_paginator.num_pages -1%} + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html" aria-label="Goto page {{ articles_page.next_page_number() }}">{{ articles_page.next_page_number() }}</a> + </li> + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_paginator.num_pages }}.html" aria-label="Goto page {{ articles_paginator.num_pages }}">{{ articles_paginator.num_pages }}</a> + </li> + {% else %} + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html" aria-label="Goto page {{ articles_page.next_page_number() }}">{{ articles_page.next_page_number() }}</a> + </li> + <li> + <span class="pagination-ellipsis">…</span> + </li> + <li> + <a class="pagination-link" href="{{ SITEURL }}/{{ page_name }}{{ articles_paginator.num_pages }}.html" aria-label="Goto page {{ articles_paginator.num_pages }}">{{ articles_paginator.num_pages }}</a> + </li> + {% endif %} + {% endif %} + </ul> + </nav> +{% endif %} \ No newline at end of file -- GitLab