feat: add plant link to images page

This commit is contained in:
Jef Roosens 2025-01-24 21:41:13 +01:00
parent 15b2ef3477
commit 18499631ea
Signed by: Jef Roosens
GPG key ID: 21FD3D77D56BAF49
4 changed files with 25 additions and 10 deletions

View file

@ -35,3 +35,7 @@
<input type="submit">
</form>
{% endmacro %}
{% macro name(plant) %}
<a hx-get="/plants/{{ plant.id }}" hx-target="#content" hx-push-url="true">{{ plant.name }} (<em>{{ plant.species }}</em>)</a>
{% endmacro %}

View file

@ -1,10 +1,13 @@
{% import "components/plant.html" as comp_plant %}
<h1>Images</h1>
{% for image in images %}
<article>
<p>Date taken: {{ image.date_taken }}</p>
<p>Note: {{ image.note }}</p>
<a href="/images/{{ image.id }}/original" target="_blank">
<img src="/images/{{ image.id }}/thumb">
<p>Date taken: {{ image.0.date_taken }}</p>
<p>Note: {{ image.0.note }}</p>
<p>Plant: {{ comp_plant::name(plant=image.1) }}</p>
<a href="/images/{{ image.0.id }}/original" target="_blank">
<img src="/images/{{ image.0.id }}/thumb">
</a>
</article>
{% endfor %}