Fix stray </ol> and </section> if only one article is displayed.

We already check if loop.length > 1 before outputting <section> and <ol>
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.
This commit is contained in:
Mario Lang 2014-02-12 12:42:27 +01:00
commit cff9d0aa58
9 changed files with 15 additions and 28 deletions

View file

@ -46,8 +46,6 @@ YEAH !</p>
</div>
</article>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
@ -67,4 +65,4 @@ YEAH !</p>
</footer><!-- /#contentinfo -->
</body>
</html>
</html>

View file

@ -56,8 +56,6 @@
</div>
</article>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
@ -77,4 +75,4 @@
</footer><!-- /#contentinfo -->
</body>
</html>
</html>

View file

@ -56,8 +56,6 @@
</div>
</article>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
@ -77,4 +75,4 @@
</footer><!-- /#contentinfo -->
</body>
</html>
</html>

View file

@ -46,8 +46,6 @@ YEAH !</p>
</div>
</article>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
@ -67,4 +65,4 @@ YEAH !</p>
</footer><!-- /#contentinfo -->
</body>
</html>
</html>

View file

@ -55,8 +55,6 @@ YEAH !</p>
Page 1 / 1
</p>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
@ -100,4 +98,4 @@ YEAH !</p>
}());
</script>
</body>
</html>
</html>

View file

@ -63,8 +63,6 @@
Page 1 / 1
</p>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
@ -108,4 +106,4 @@
}());
</script>
</body>
</html>
</html>

View file

@ -63,8 +63,6 @@
Page 1 / 1
</p>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
@ -108,4 +106,4 @@
}());
</script>
</body>
</html>
</html>

View file

@ -55,8 +55,6 @@ YEAH !</p>
Page 1 / 1
</p>
</aside><!-- /#featured -->
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
@ -100,4 +98,4 @@ YEAH !</p>
}());
</script>
</body>
</html>
</html>

View file

@ -42,12 +42,15 @@
</article></li>
{% endif %}
{% if loop.last %}
</ol><!-- /#posts-list -->
{% if loop.last and (articles_page.has_previous()
or not articles_page.has_previous() and loop.length > 1) %}
{% if loop.length > 1 %}
</ol><!-- /#posts-list -->
{% endif %}
{% if articles_page.has_previous() or loop.length > 1 %}
{% include 'pagination.html' %}
{% endif %}
</section><!-- /#content -->
{% if loop.length > 1 %}
</section><!-- /#content -->
{% endif %}
{% endif %}
{% endfor %}
{% else %}