feat: migrate /images page to new typed methods
This commit is contained in:
parent
4e92c02e63
commit
b17c2e7df6
7 changed files with 74 additions and 26 deletions
9
templates/card/image.html
Normal file
9
templates/card/image.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% import "components/plant.html" as comp_plant %}
|
||||
<article>
|
||||
<p>Date taken: {{ item.0.date_taken }}</p>
|
||||
<p>Note: {{ item.0.note }}</p>
|
||||
<p>Plant: {{ comp_plant::name(plant=item.1) }}</p>
|
||||
<a href="/images/{{ item.0.id }}/original" target="_blank">
|
||||
<img src="/images/{{ item.0.id }}/thumb">
|
||||
</a>
|
||||
</article>
|
||||
18
templates/list/card.html
Normal file
18
templates/list/card.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<h1>{{ heading }}</h1>
|
||||
|
||||
<div id="items">
|
||||
{% for item in items %}
|
||||
{{ item | safe }}
|
||||
{% endfor %}
|
||||
|
||||
{% if next_page_url %}
|
||||
<div
|
||||
aria-busy="true"
|
||||
hx-get="{{ next_page_url }}"
|
||||
hx-select="#items > *"
|
||||
hx-trigger="revealed"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue