# along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
-{% block object_gallery_content -%}
- <div>
- {% if media_entries %}
- <ul class="media_thumbnail">
- {% for entry in media_entries %}
- <li class="media_thumbnail">
- <a href="{{ entry.url_for_self(request.urlgen) }}">
- <img src="{{ request.app.public_store.file_url(
- entry['media_files']['thumb']) }}" /></a>
- </li>
- {% endfor %}
- </ul>
- {% include "mediagoblin/utils/pagination.html" %}
- {% endif %}
+{% from "mediagoblin/utils/pagination.html" import render_pagination %}
- </div>
-{% endblock %}
+{% block object_gallery_content -%}
+ {% if media_entries and media_entries.count() %}
+ {% for entry in media_entries %}
+ <div class="media_thumbnail">
+ <a href="{{ entry.url_for_self(request.urlgen) }}">
+ <img src="{{ request.app.public_store.file_url(
+ entry['media_files']['thumb']) }}" /></a>
+ </div>
+ {% endfor %}
+ <div class="clear"></div>
+ {% 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 %}
+ <p>
+ <i>There doesn't seem to be any media here yet...</i>
+ </p>
+ {% endif %}
+{% endblock %}