X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=mediagoblin%2Ftemplates%2Fmediagoblin%2Futils%2Fobject_gallery.html;h=b4da5bc111bea12f9269fffcc871c93dbeb2532e;hb=2e4ad359623916f5ca9f6ec11f5353a1a85a77d2;hp=8ae337f58e3c5c397e02d3aa875444a17a46fe60;hpb=44e3e917fbfc89409bac08d500c5a9246e0dc5f4;p=mediagoblin.git diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 8ae337f5..b4da5bc1 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -1,6 +1,6 @@ {# # GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 Free Software Foundation, Inc +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -16,21 +16,61 @@ # along with this program. If not, see . #} -{% block object_gallery_content -%} -
- {% if media_entries %} -
-{% endblock %} + Args: + - request: Request + - media_entries: pymongo cursor of media entries + - pagination: Paginator object + - pagination_base_url: If you want the pagination to point to a + different URL, point it here + - col_number: How many columns per row (default 5) +#} +{% macro object_gallery(request, media_entries, pagination, + pagination_base_url=None, col_number=5) %} + {% if media_entries and media_entries.count() %} + {{ media_grid(request, media_entries, col_number=col_number) }} +
+ {% if pagination_base_url %} + {# different url, so set that and don't keep the get params #} + {{ render_pagination(request, pagination, pagination_base_url, False) }} + {% else %} + {{ render_pagination(request, pagination) }} + {% endif %} + {% else %} +

+ + {%- trans -%} + There doesn't seem to be any media here yet... + {%- endtrans -%} + +

+ {% endif %} +{% endmacro %}