aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-04 17:28:53 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-04 17:31:12 +0100
commit2222278dcdf70a1dbcba0e5955344259d0697752 (patch)
tree07bb040b495c37ca389e3c6153e54c9759cbebbe /mediagoblin/templates
parent1244ffc8f5c3617bab98b560dcd57d51bc5afbd4 (diff)
downloadmediagoblin-2222278dcdf70a1dbcba0e5955344259d0697752.tar.lz
mediagoblin-2222278dcdf70a1dbcba0e5955344259d0697752.tar.xz
mediagoblin-2222278dcdf70a1dbcba0e5955344259d0697752.zip
Remove gridify_*
We injected a gridify_list and gridify_cursor function into each jinja2 template that we render. This was used to split the list of media_entries into batches of 5 for nicer table columns. However, jinja2 has a nice |batch filter built in that does the job for us just as well with less code (on our side) Less code=good so let's merge this one. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/utils/collection_gallery.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/object_gallery.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
index 25def418..af332537 100644
--- a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
@@ -20,7 +20,7 @@
{% macro media_grid(request, collection_items, col_number=5) %}
<table class="thumb_gallery">
- {% for row in gridify_cursor(collection_items, col_number) %}
+ {% for row in collection_items|batch(col_number) %}
<tr class="thumb_row
{%- if loop.first %} thumb_row_first
{%- elif loop.last %} thumb_row_last{% endif %}">
diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
index b4da5bc1..0cd8cdab 100644
--- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
@@ -20,7 +20,7 @@
{% macro media_grid(request, media_entries, col_number=5) %}
<table class="thumb_gallery">
- {% for row in gridify_cursor(media_entries, col_number) %}
+ {% for row in media_entries|batch(col_number) %}
<tr class="thumb_row
{%- if loop.first %} thumb_row_first
{%- elif loop.last %} thumb_row_last{% endif %}">