image_attachments.html 1.5 KB

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