aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-02-15 23:48:26 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-02-15 23:48:26 +0100
commit7f84e36fb2f6a380635bc773eae32aa42203422c (patch)
treeda87ac3d533d64aa7371b89ff61522c0710a3cc0 /templates
parentd24d5f2e21fd4bfb5c369e2932a4c62328ffa758 (diff)
downloadmicropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.tar.gz
micropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.tar.bz2
micropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.zip
Improve attachments
- Allow multiple uploads at once - Make uploads deletable
Diffstat (limited to 'templates')
-rw-r--r--templates/macros.twig37
1 files changed, 26 insertions, 11 deletions
diff --git a/templates/macros.twig b/templates/macros.twig
index 4e1b336..2c72334 100644
--- a/templates/macros.twig
+++ b/templates/macros.twig
@@ -39,17 +39,32 @@
</fieldset>
<div class="attachments-container">
<h2>Attachments</h2>
- <ul class="attachment-list">
- {% for att in note.attachments %}
- <li>
- <a href="{{ url("attachments/%s", att.id) }}">{{ att.fileName ? att.fileName : att.id }}</a>
- </li>
- {% endfor %}
- </ul>
-
- <ul class="attachment-inputs">
- <li><input type="file" name="attachments[]"></li>
- </ul>
+ <table class="attachments">
+ <thead>
+ <tr>
+ <th>Delete</th>
+ <th>File name</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for att in note.attachments %}
+ <tr class="existing">
+ <td>
+ <input type="checkbox" class="attachment-delete-checkbox" value="1" name="attachment_delete[{{ att.id }}]">
+ </td>
+ <td>
+ <a href="{{ url("attachments/%s", att.id) }}">{{ att.fileName ? att.fileName : att.id }}</a>
+ </td>
+ </tr>
+ {% endfor %}
+ <tr class="new">
+ <td></td>
+ <td>
+ <input type="file" multiple name="attachments[]">
+ </td>
+ </tr>
+ </tbody>
+ </table>
</div>
{% endmacro %}