diff --git a/boards/static/css/base.css b/boards/static/css/base.css --- a/boards/static/css/base.css +++ b/boards/static/css/base.css @@ -103,3 +103,13 @@ textarea, input { #preview-text { display: none; } + +.random-images-table { + text-align: center; + width: 100%; +} + +.random-images-table > table { + margin-left: auto; + margin-right: auto; +} diff --git a/boards/templates/boards/random.html b/boards/templates/boards/random.html --- a/boards/templates/boards/random.html +++ b/boards/templates/boards/random.html @@ -9,16 +9,28 @@ {% block content %} {% if posts %} - {% for post in posts %} - - {% endfor %} +
+ + + {% for post in posts %} + + {% if forloop.counter|divisibleby:"3" %} + + + {% endif %} + {% endfor %} + +
+ +
+
{% endif %} {% endblock %} diff --git a/boards/views/random.py b/boards/views/random.py --- a/boards/views/random.py +++ b/boards/views/random.py @@ -12,7 +12,7 @@ TEMPLATE = 'boards/random.html' CONTEXT_POSTS = 'posts' -RANDOM_POST_COUNT = 10 +RANDOM_POST_COUNT = 9 class RandomImageView(View):