Files
Gardomatic/internal/web/templates/pages/species.tmpl
T
kleiax 904d14b64c
CI / test (push) Canceled after 0s
Initial commit
2026-09-12 22:22:17 +02:00

19 lines
2.1 KiB
Cheetah
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "title"}}Pflanzen{{end}}
{{define "main"}}
<header class='page-heading'>
<div><h2>Pflanzen</h2></div>
<div class='actions'>{{if or (canGarden .Garden "species:write") (canGlobalSpecies .CurrentUser)}}<a class='button' href='{{webPath "species.new" .Garden.ID}}'>Art anlegen</a>{{end}}{{template "view_toggle" "species"}}</div>
</header>
<form class='panel filter-bar' method='GET'><div class='filter-fields'><div><label for='q'>Suche</label><input id='q' name='q' type='search' value='{{index .Filters "q"}}' placeholder='Name, Sorte oder Kategorie'></div><div><label for='origin'>Herkunft</label><select id='origin' name='origin'><option value=''>Alle</option><option value='garden' {{if eqString (index .Filters "origin") "garden"}}selected{{end}}>Garteneigen</option><option value='global' {{if eqString (index .Filters "origin") "global"}}selected{{end}}>Global</option></select></div><div><label for='sort'>Sortierung</label><select id='sort' name='sort'><option value='name_asc'>Name AZ</option><option value='name_desc' {{if eqString (index .Filters "sort") "name_desc"}}selected{{end}}>Name ZA</option><option value='newest' {{if eqString (index .Filters "sort") "newest"}}selected{{end}}>Neueste zuerst</option><option value='oldest' {{if eqString (index .Filters "sort") "oldest"}}selected{{end}}>Älteste zuerst</option></select></div><button class='filter-submit'>Filtern</button></div></form>
<section class='card-grid collection' data-view-key='species'>
{{range .Species}}
<article class='card card--interactive {{if .ImageData}}card--image{{end}}' {{if .ImageData}}data-background-image='{{.ImageData}}'{{end}} role='link' tabindex='0' data-card-href='{{webPath "species.edit" $.Garden.ID .ID}}' aria-label='{{.CommonName}}{{with .Cultivar}} · {{.}}{{end}} öffnen'><div class='card-content'>
<span class='status'>{{if .GardenID}}Garteneigen{{else}}Global{{end}}</span>
<h3>{{.CommonName}}{{with .Cultivar}} · {{.}}{{end}}</h3>
{{with .BotanicalName}}<p>{{.}}</p>{{end}}</div>
</article>
{{else}}<p>Keine Arten verfügbar.</p>{{end}}
</section>
{{template "pagination" .}}
{{end}}