image_attachments.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {% load helpers %}
  2. {% if images %}
  3. <table class="table table-hover">
  4. <tr>
  5. <th>Name</th>
  6. <th>Size</th>
  7. <th>Created</th>
  8. <th></th>
  9. </tr>
  10. {% for attachment in images %}
  11. <tr{% if not attachment.size %} class="table-danger"{% endif %}>
  12. <td>
  13. <i class="mdi mdi-file-image-outline"></i>
  14. <a class="image-preview" href="{{ attachment.image.url }}" target="_blank">{{ attachment }}</a>
  15. </td>
  16. <td>{{ attachment.size|filesizeformat }}</td>
  17. <td>{{ attachment.created|annotated_date }}</td>
  18. <td class="text-end noprint">
  19. {% if perms.extras.change_imageattachment %}
  20. <a href="{% url 'extras:imageattachment_edit' pk=attachment.pk %}" class="btn btn-warning btn-sm lh-1" title="Edit Image">
  21. <i class="mdi mdi-pencil" aria-hidden="true"></i>
  22. </a>
  23. {% endif %}
  24. {% if perms.extras.delete_imageattachment %}
  25. <a href="{% url 'extras:imageattachment_delete' pk=attachment.pk %}" class="btn btn-danger btn-sm lh-1" title="Delete Image">
  26. <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i>
  27. </a>
  28. {% endif %}
  29. </td>
  30. </tr>
  31. {% endfor %}
  32. </table>
  33. {% else %}
  34. <div class="text-muted">
  35. None
  36. </div>
  37. {% endif %}