* build(deps): bump askama from 0.12.1 to 0.15.4 Bumps [askama](https://github.com/askama-rs/askama) from 0.12.1 to 0.15.4. - [Release notes](https://github.com/askama-rs/askama/releases) - [Commits](https://github.com/askama-rs/askama/compare/0.12.1...v0.15.4) --- updated-dependencies: - dependency-name: askama dependency-version: 0.15.4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): adapt templates and tests for askama 0.15 - Migrate macro calls from {% call %} to {{ }} expression syntax (134 occurrences) - Update test assertion for askama 0.15's numeric HTML entity encoding (& vs &) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jon Seager <jon@sgrs.uk>
121 lines
6.2 KiB
HTML
121 lines
6.2 KiB
HTML
{% import "partials/lists/table.html" as table %}
|
|
{% import "partials/icons.html" as icons %}
|
|
|
|
<div id="roaster-list" class="mt-6" data-star-scope="roasters">
|
|
{% if roasters.items.is_empty() && !navigator.has_search() %}
|
|
<div
|
|
class="rounded-lg border border-dashed px-4 py-6 text-sm text-text-secondary"
|
|
>
|
|
<p class="text-center">
|
|
{% if is_authenticated %}
|
|
No roasters added yet. Click the Add button to create your first roaster.
|
|
{% else %}
|
|
No roasters added yet.
|
|
{% endif %}
|
|
</p>
|
|
</div>
|
|
{% else %}
|
|
<section class="rounded-lg border bg-surface"
|
|
{% if roasters.has_next() %}data-infinite-scroll data-next-url="{{ navigator.fragment_page_href(roasters.next_page().unwrap())|safe }}" data-target="#roaster-list"{% endif %}
|
|
>
|
|
{{ table::search_header(navigator, "#roaster-list") }}
|
|
<div class="overflow-x-auto">
|
|
<table class="responsive-table min-w-full divide-y text-left text-sm text-text">
|
|
<thead class="bg-surface-alt text-xs font-semibold tracking-wide text-text">
|
|
<tr>
|
|
{{ table::sortable_header("Added", "created-at", navigator, "#roaster-list") }}
|
|
{{ table::sortable_header("Name", "name", navigator, "#roaster-list") }}
|
|
{{ table::sortable_header("Country", "country", navigator, "#roaster-list") }}
|
|
{{ table::sortable_header("City", "city", navigator, "#roaster-list") }}
|
|
<th scope="col" class="actions-col px-4 py-3 text-right">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y/70">
|
|
{% for roaster in roasters.items %}
|
|
<tr
|
|
data-star-key="{{ roaster.id }}"
|
|
data-sort-created-at="{{ roaster.created_at_sort_key }}"
|
|
data-sort-name="{{ roaster.name }}"
|
|
data-sort-country="{{ roaster.country }}"
|
|
data-sort-city="{{ roaster.city }}"
|
|
class="transition hover:bg-surface-alt"
|
|
{% if roaster.has_homepage || is_authenticated %}onclick="toggleRow(event)"{% endif %}
|
|
>
|
|
<td data-label="Added" class="card-date whitespace-nowrap px-4 py-3 text-xs font-medium text-text-secondary">
|
|
<div>{{ roaster.created_date }}</div>
|
|
<div class="hidden md:block font-normal text-text-muted">{{ roaster.created_time }}</div>
|
|
</td>
|
|
<td data-label="Name" class="card-title px-4 py-3 font-medium text-text">
|
|
{{ roaster.name }}
|
|
</td>
|
|
<td data-label="Location" class="px-4 py-3 whitespace-nowrap md:hidden">{{ roaster.country }}</td>
|
|
{% if !roaster.city.is_empty() %}
|
|
<td data-label="City" class="px-4 py-3 whitespace-nowrap md:hidden">{{ roaster.city }}</td>
|
|
{% endif %}
|
|
<td data-label="Country" class="mobile-hidden px-4 py-3 whitespace-nowrap">{{ roaster.country }}</td>
|
|
<td data-label="City" class="mobile-hidden px-4 py-3 whitespace-nowrap">{{ roaster.city }}</td>
|
|
{% if roaster.has_homepage || is_authenticated %}
|
|
<td data-label="" class="card-detail hidden">
|
|
<div class="flex items-center gap-4">
|
|
{% if roaster.has_homepage %}
|
|
<a class="inline-flex items-center gap-1 text-sm font-medium text-accent hover:text-accent-hover"
|
|
href="{{ roaster.homepage_url }}" target="_blank" rel="noreferrer noopener">
|
|
{{ icons::external_link("h-4 w-4") }} Homepage
|
|
</a>
|
|
{% endif %}
|
|
{% if is_authenticated %}
|
|
<button type="button"
|
|
class="inline-flex items-center gap-1 text-sm font-medium text-text-muted hover:text-red-600"
|
|
data-on:click="confirm('Delete this roaster?') && @delete('/api/v1/roasters/{{ roaster.id }}?{{ navigator.query() }}', {responseOverrides: {selector: '#roaster-list', mode: 'replace'}})">
|
|
{{ icons::delete("h-4 w-4") }} Delete
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
{% endif %}
|
|
<td data-label="" class="card-actions px-4 py-3 text-right">
|
|
{% if roaster.has_homepage || is_authenticated %}
|
|
<button type="button"
|
|
class="inline-flex h-8 w-8 items-center justify-center rounded-md text-text-muted transition hover:text-accent hover:bg-surface-alt"
|
|
title="Actions">
|
|
<span class="icon-expand">{{ icons::ellipsis_vertical("h-5 w-5") }}</span>
|
|
<span class="icon-collapse hidden">{{ icons::chevron_up("h-5 w-5") }}</span>
|
|
</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% if roaster.has_homepage || is_authenticated %}
|
|
<tr class="hidden detail-row">
|
|
<td colspan="5" class="bg-surface-alt px-4 py-2">
|
|
<div class="flex items-center gap-4">
|
|
{% if roaster.has_homepage %}
|
|
<a class="inline-flex items-center gap-1 text-sm font-medium text-accent hover:text-accent-hover"
|
|
href="{{ roaster.homepage_url }}" target="_blank" rel="noreferrer noopener">
|
|
{{ icons::external_link("h-4 w-4") }} Homepage
|
|
</a>
|
|
{% endif %}
|
|
{% if is_authenticated %}
|
|
<button type="button"
|
|
class="inline-flex items-center gap-1 text-sm font-medium text-text-muted hover:text-red-600"
|
|
data-on:click="confirm('Delete this roaster?') && @delete('/api/v1/roasters/{{ roaster.id }}?{{ navigator.query() }}', {responseOverrides: {selector: '#roaster-list', mode: 'replace'}})">
|
|
{{ icons::delete("h-4 w-4") }} Delete
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if roasters.items.is_empty() %}
|
|
<div class="p-8 text-center text-text-muted">No roasters match your search.</div>
|
|
{% endif %}
|
|
{{ table::pagination_header(roasters, navigator, "#roaster-list") }}
|
|
{% if roasters.has_next() %}
|
|
<div class="infinite-scroll-sentinel h-4 md:hidden" aria-hidden="true"></div>
|
|
{% endif %}
|
|
</section>
|
|
{% endif %}
|
|
</div>
|