2017-03-15 00:28:27 +01:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
2017-04-03 21:50:41 +02:00
|
|
|
{% if image %}
|
2021-07-31 00:05:13 +02:00
|
|
|
<h1>Edit image</h1>
|
|
|
|
<p>Edit an image metadata. To change the image itself, you need to delete and add a new one.</p>
|
2017-04-03 21:50:41 +02:00
|
|
|
{% else %}
|
2021-07-31 00:05:13 +02:00
|
|
|
<h1>Upload image</h1>
|
|
|
|
<p>Here you can add a new image to the gallery. You can use all common image types. The uploaded
|
|
|
|
image will be cropped (Thumbnail) and resized (detail image).</p>
|
2017-04-03 21:50:41 +02:00
|
|
|
{% endif %}
|
2017-03-15 00:28:27 +01:00
|
|
|
|
2017-04-03 21:50:41 +02:00
|
|
|
<form action="{% if image %}/edit/{{ image.id }}{% else %}/upload{% endif %}" enctype="multipart/form-data" method="POST" class="form-horizontal">
|
2017-03-15 00:28:27 +01:00
|
|
|
{% csrf-field %}
|
|
|
|
|
2017-04-03 21:50:41 +02:00
|
|
|
{% if not image %}
|
2021-07-31 00:05:13 +02:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="file" class="form-label sr-only">Image</label>
|
2017-03-15 00:28:27 +01:00
|
|
|
<input id="file" class="form-control" name="file" type="file" />
|
|
|
|
</div>
|
2017-04-03 21:50:41 +02:00
|
|
|
{% endif %}
|
2017-03-15 00:28:27 +01:00
|
|
|
|
2021-07-31 00:05:13 +02:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="title" class="form-label">Image title</label>
|
2017-03-28 00:19:23 +02:00
|
|
|
<input type="text" name="title" class="form-control"
|
2017-04-03 21:50:41 +02:00
|
|
|
value="{{ image.title }}"
|
2021-07-31 00:05:13 +02:00
|
|
|
placeholder="Leave empty for filename">
|
2017-03-15 00:28:27 +01:00
|
|
|
</div>
|
|
|
|
|
2021-07-31 00:05:13 +02:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="description" clas="form-label">Description (optional)</label>
|
2017-04-03 21:50:41 +02:00
|
|
|
<textarea name="description" class="form-control" rows="4">{{image.description }}</textarea>
|
2017-03-15 00:28:27 +01:00
|
|
|
</div>
|
|
|
|
|
2021-07-31 00:05:13 +02:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="tags" class="form-label">Tags</label>
|
2017-03-28 00:19:23 +02:00
|
|
|
<input type="text" id="tags" name="tags" class="form-control"
|
2017-04-03 21:50:41 +02:00
|
|
|
value="{% if tags %}{% for tag in tags %}{{ tag.tagname }} {% endfor %}{% endif %}"
|
2021-07-31 00:05:13 +02:00
|
|
|
placeholder="Separate with space or comma">
|
2017-03-15 00:28:27 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-success">
|
|
|
|
<span class="fa fa-floppy-o"></span>
|
2017-04-03 21:50:41 +02:00
|
|
|
{% if image %}
|
2021-07-31 00:05:13 +02:00
|
|
|
Edit image
|
2017-04-03 21:50:41 +02:00
|
|
|
{% else %}
|
2021-07-31 00:05:13 +02:00
|
|
|
Upload image
|
2017-04-03 21:50:41 +02:00
|
|
|
{% endif %}
|
2017-03-15 00:28:27 +01:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|