{# plugins/media/templates/media/list.html #}
{% extends 'core/base.html' %}

{% block content %}
<h2>All Uploaded Media</h2>
<ul>
  {% for image in images %}
    <li class="mb-3">
      <img
        src="{{ generate_image_url(image) }}"
        alt="{{ image.caption or 'No caption' }}"
        width="200"
        class="img-thumbnail"
      ><br>
      {{ image.caption or "No caption" }}
      {% if image.plant_id %}
        <br><small class="text-muted">Plant ID: {{ image.plant_id }}</small>
      {% endif %}
      {% if image.growlog_id %}
        <br><small class="text-muted">GrowLog ID: {{ image.growlog_id }}</small>
      {% endif %}
      <br><small class="text-muted">Uploaded by user #{{ image.uploader_id }}</small>
    </li>
  {% endfor %}
</ul>
{% endblock %}
