From cff9d0aa5832e2d4c296a8c9b34ac5f88c9b0d3d Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 12 Feb 2014 12:42:27 +0100 Subject: [PATCH] Fix stray and if only one article is displayed. We already check if loop.length > 1 before outputting
and
    tags, but we neglected to do the same check when outputting the corresponding end tags. Also, since I had to read the code when I touched it, simplified a conditional: if (a) if (a and (b or not b and c)) can be simplified to if (a) if (b or c) Note the "b or not b", it was just too ugly to not fix. --- pelican/tests/output/basic/category/bar.html | 4 +--- pelican/tests/output/basic/category/yeah.html | 4 +--- pelican/tests/output/basic/tag/foobar.html | 4 +--- pelican/tests/output/basic/tag/yeah.html | 4 +--- pelican/tests/output/custom/category/bar.html | 4 +--- pelican/tests/output/custom/category/yeah.html | 4 +--- pelican/tests/output/custom/tag/foobar.html | 4 +--- pelican/tests/output/custom/tag/yeah.html | 4 +--- pelican/themes/notmyidea/templates/index.html | 11 +++++++---- 9 files changed, 15 insertions(+), 28 deletions(-) diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 54b1db3e..763cfe77 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -46,8 +46,6 @@ YEAH !

    -
-
- -
- -
- -

blogroll

@@ -100,4 +98,4 @@ YEAH !

}()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index c8e066c8..11fd181d 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -63,8 +63,6 @@ Page 1 / 1

- -

blogroll

@@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index c62d3418..c224992e 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -63,8 +63,6 @@ Page 1 / 1

- -

blogroll

@@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index 288f4ec7..49c78359 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -55,8 +55,6 @@ YEAH !

Page 1 / 1

- -

blogroll

@@ -100,4 +98,4 @@ YEAH !

}()); - \ No newline at end of file + diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 2d45bb2a..c8982476 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -42,12 +42,15 @@ {% endif %} {% if loop.last %} - - {% if loop.last and (articles_page.has_previous() - or not articles_page.has_previous() and loop.length > 1) %} + {% if loop.length > 1 %} + + {% endif %} + {% if articles_page.has_previous() or loop.length > 1 %} {% include 'pagination.html' %} {% endif %} -
+ {% if loop.length > 1 %} + + {% endif %} {% endif %} {% endfor %} {% else %}