feat: implement simple file upload
This commit is contained in:
parent
c10b9baa95
commit
52478379a0
11 changed files with 232 additions and 9 deletions
16
templates/components/image.html
Normal file
16
templates/components/image.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{% macro form(plant_id, target="#images > ul") %}
|
||||
<form hx-post="/images" hx-target="{{ target }}" hx-swap="beforeend" enctype="multipart/form-data">
|
||||
<input type="hidden" id="plant_id" name="plant_id" value="{{ plant_id }}">
|
||||
|
||||
<label for="date_taken">Date taken:</label>
|
||||
<input type="date" id="date_taken" name="date_taken"></br>
|
||||
|
||||
<label for="note">Note:</label>
|
||||
<textarea id="note" name="note" rows=1></textarea></br>
|
||||
|
||||
<label for="image">Image:</label>
|
||||
<input type="file" id="image" name="image" accept="image/*" capture="environment"></br>
|
||||
|
||||
<input type="submit">
|
||||
</form>
|
||||
{% endmacro form %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue