{% from "mediagoblin/utils/pagination.html" import render_pagination %}
{% macro media_grid(request, media_entries, col_number=5) %}
- <ul class="thumb_gallery">
+ <table class="thumb_gallery">
{% for row in gridify_cursor(media_entries, col_number) %}
- {% for entry in row %}
- {% set entry_url = entry.url_for_self(request.urlgen) %}
- <li class="media_thumbnail">
- <a href="{{ entry_url }}">
- <img src="{{ request.app.public_store.file_url(
- entry.media_files['thumb']) }}" />
- </a>
- {% if entry.title %}
- <br />
- <a href="{{ entry_url }}">{{ entry.title }}</a>
- {% endif %}
- </li>
- {% endfor %}
+ <tr class="thumb_row
+ {%- if loop.first %} thumb_row_first
+ {%- elif loop.last %} thumb_row_last{% endif %}">
+ {% for entry in row %}
+ {% set entry_url = entry.url_for_self(request.urlgen) %}
+ <td class="media_thumbnail thumb_entry
+ {%- if loop.first %} thumb_entry_first
+ {%- elif loop.last %} thumb_entry_last{% endif %}">
+ <a href="{{ entry_url }}">
+ <img src="{{ request.app.public_store.file_url(
+ entry.media_files['thumb']) }}" />
+ </a>
+ {% if entry.title %}
+ <a class="thumb_entry_title" href="{{ entry_url }}">{{ entry.title }}</a>
+ {% endif %}
+ </td>
+ {% endfor %}
+ </tr>
{% endfor %}
- </ul>
+ </table>
{%- endmacro %}
{#