diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 03b85b17..c5e890fc 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -18,15 +18,46 @@ {% from "mediagoblin/utils/pagination.html" import render_pagination %} +{% macro media_grid(media_list, col_number=5) %} + {% set num_items = media_list.count() %} + {% set col_counter = 0 %} + {% set row_counter = 0 %} + {% set item_counter = 0 %} + + {% set num_rows = num_items // col_number %} + {% if num_items % col_number != 0 %} + {% set num_rows = num_rows + 1 %} + {% endif %} + +