From 62b0b360fa8a1a2d1fd6d89d4d227a0ef559cb8a Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Mon, 10 Feb 2020 22:36:13 +0100 Subject: Implement simple attachment support It is now possible to upload and view attachments! Attachments are saved by their content hash, therefore they are automatically deduplicated and we can later easily add integrity checks. Still missing: - Deleting attachments - Multiple file inputs (idea: when the user fills in a file input, create a new empty file input beneath with js) - (nice to have) Thumbnails --- templates/macros.twig | 16 +++++++++++++++- templates/note.twig | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/macros.twig b/templates/macros.twig index dc7e721..4e1b336 100644 --- a/templates/macros.twig +++ b/templates/macros.twig @@ -37,12 +37,26 @@ {% endfor %} +
+

Attachments

+ + + +
{% endmacro %} {% macro new_note() %}

New Note

-
+ {{ _self.note_form_content({}) }}
diff --git a/templates/note.twig b/templates/note.twig index 14989aa..cb0b6d8 100644 --- a/templates/note.twig +++ b/templates/note.twig @@ -1,7 +1,7 @@ {% extends "skeleton.twig" %} {% import "macros.twig" as macros %} {% block body %} -
+ {{ macros.note_form_content(note) }}