2025-03-25 20:32:26 +00:00
|
|
|
|
{% extends "common.html" %}
|
2026-07-18 21:16:07 +02:00
|
|
|
|
{% block title %}Your bouquet · Flowers{% endblock %}
|
2026-07-18 20:27:19 +02:00
|
|
|
|
{% block menuoptions %}
|
|
|
|
|
|
<form action="{{ url_for('flower_vase.application') }}" method="post">
|
|
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
|
|
|
|
<input type="hidden" name="action" value="new">
|
|
|
|
|
|
<button class="button primary compact" type="submit">New entry</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<form action="{{ url_for('flower_vase.application') }}" method="post">
|
|
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
|
|
|
|
<input type="hidden" name="action" value="rehush">
|
|
|
|
|
|
<button class="button ghost compact" type="submit">Password</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<form action="{{ url_for('flower_vase.application') }}" method="post">
|
|
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
|
|
|
|
<input type="hidden" name="action" value="logout">
|
|
|
|
|
|
<button class="button ghost compact" type="submit">Sign out</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
{% endblock %}
|
2025-03-25 20:32:26 +00:00
|
|
|
|
{% block content %}
|
2026-07-18 20:27:19 +02:00
|
|
|
|
<section class="vault-header">
|
|
|
|
|
|
<div>
|
2026-07-18 21:16:07 +02:00
|
|
|
|
<h1>Your bouquet</h1>
|
2026-07-18 20:27:19 +02:00
|
|
|
|
</div>
|
|
|
|
|
|
<label class="search-field" for="search">
|
|
|
|
|
|
<span class="sr-only">Search entries</span>
|
|
|
|
|
|
<input id="search" type="search" placeholder="Search organization or login" value="{{ filter|default('') }}" autocomplete="off">
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</section>
|
2025-03-25 20:32:26 +00:00
|
|
|
|
|
2026-07-18 20:27:19 +02:00
|
|
|
|
<div class="entry-list" id="entry-list">
|
|
|
|
|
|
{% for flower in flowers %}
|
|
|
|
|
|
<form class="entry-row" data-search="{{ flower.organization }} {{ flower.myID }}" action="{{ url_for('flower_vase.application') }}" method="post">
|
|
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
|
|
|
|
<input type="hidden" name="action" value="show">
|
|
|
|
|
|
<input type="hidden" name="organization" value="{{ flower.organization }}">
|
|
|
|
|
|
<input type="hidden" name="datetime" value="{{ flower.dateCreated }}">
|
|
|
|
|
|
<input type="hidden" name="filter" class="current-filter" value="{{ filter|default('') }}">
|
|
|
|
|
|
<button type="submit" class="entry-button">
|
|
|
|
|
|
<span class="entry-icon" aria-hidden="true">{{ flower.organization[:1]|upper }}</span>
|
|
|
|
|
|
<span class="entry-copy">
|
|
|
|
|
|
<strong>{{ flower.organization }}</strong>
|
|
|
|
|
|
<span>{{ flower.myID }}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<time datetime="{{ flower.dateCreated }}">{{ flower.dateCreated[:10] }}</time>
|
|
|
|
|
|
<span class="chevron" aria-hidden="true">›</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
<div class="empty-state">
|
|
|
|
|
|
<span aria-hidden="true">✣</span>
|
|
|
|
|
|
<h2>No active entries</h2>
|
|
|
|
|
|
<p>Create an entry to start your collection.</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{% endfor %}
|
2025-03-25 20:32:26 +00:00
|
|
|
|
</div>
|
2026-07-18 20:27:19 +02:00
|
|
|
|
<p class="empty-state filtered-empty" id="filtered-empty" hidden>No entries match that search.</p>
|
2025-03-25 20:32:26 +00:00
|
|
|
|
|
2026-07-18 20:27:19 +02:00
|
|
|
|
<script>
|
|
|
|
|
|
const search = document.querySelector('#search');
|
|
|
|
|
|
const rows = [...document.querySelectorAll('.entry-row')];
|
|
|
|
|
|
const filteredEmpty = document.querySelector('#filtered-empty');
|
|
|
|
|
|
function filterRows() {
|
|
|
|
|
|
const query = search.value.trim().toLocaleLowerCase();
|
|
|
|
|
|
let visible = 0;
|
|
|
|
|
|
rows.forEach((row) => {
|
|
|
|
|
|
const match = row.dataset.search.toLocaleLowerCase().includes(query);
|
|
|
|
|
|
row.hidden = !match;
|
|
|
|
|
|
row.querySelector('.current-filter').value = search.value;
|
|
|
|
|
|
if (match) visible += 1;
|
|
|
|
|
|
});
|
|
|
|
|
|
filteredEmpty.hidden = visible !== 0 || rows.length === 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
search.addEventListener('input', filterRows);
|
|
|
|
|
|
filterRows();
|
2025-03-25 20:32:26 +00:00
|
|
|
|
</script>
|
2026-07-18 20:27:19 +02:00
|
|
|
|
{% endblock %}
|