starting admin work
This commit is contained in:
@ -16,107 +16,123 @@
|
||||
|
||||
<h2 class="mb-4">View Entries</h2>
|
||||
|
||||
{# ── Import / Export, Stats, Filters & View Toggle ─────────────────────── #}
|
||||
<div class="mb-3 d-flex flex-wrap justify-content-between align-items-center">
|
||||
<!-- Left: import/export & stats toggle -->
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<button class="btn btn-primary me-2" data-bs-toggle="modal" data-bs-target="#importModal">
|
||||
Import CSV
|
||||
</button>
|
||||
<a href="{{ url_for('utility.export_data') }}" class="btn btn-secondary me-2">
|
||||
Export My Data
|
||||
</a>
|
||||
<button
|
||||
class="btn btn-secondary me-2 d-inline-block d-md-none"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#statsModal">
|
||||
Stats
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary me-2 d-none d-md-inline-block"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#statsBox"
|
||||
aria-expanded="false"
|
||||
aria-controls="statsBox"
|
||||
id="statsToggle">
|
||||
Stats <i class="bi bi-chevron-down"></i>
|
||||
</button>
|
||||
{# ── Import / Export / Stats & Filters / View Toggle ───────────────────── #}
|
||||
<div class="mb-3 d-flex flex-wrap justify-content-between align-items-start">
|
||||
{# LEFT: Import/Export + Stats toggles #}
|
||||
<div class="btn-toolbar mb-2" role="toolbar">
|
||||
<div class="btn-group me-2" role="group">
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
|
||||
Import CSV
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group me-2" role="group">
|
||||
<a href="{{ url_for('utility.export_data') }}" class="btn btn-secondary">
|
||||
Export My Data
|
||||
</a>
|
||||
<button
|
||||
class="btn btn-secondary d-inline-block d-md-none"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#statsModal">
|
||||
Stats
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary d-none d-md-inline-block"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#statsBox"
|
||||
aria-expanded="false"
|
||||
aria-controls="statsBox"
|
||||
id="statsToggle">
|
||||
Stats <i class="bi bi-chevron-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: filter form + view toggle -->
|
||||
{# RIGHT: filter form + view toggle #}
|
||||
<form
|
||||
method="get"
|
||||
action="{{ url_for('plant.index') }}"
|
||||
class="d-flex flex-wrap align-items-center mb-2"
|
||||
class="row gx-2 gy-2 align-items-center mb-2"
|
||||
>
|
||||
<div class="input-group me-2" style="min-width:200px;">
|
||||
<span class="input-group-text">Search</span>
|
||||
<input
|
||||
type="search"
|
||||
name="q"
|
||||
value="{{ q }}"
|
||||
class="form-control"
|
||||
placeholder="by name…"
|
||||
/>
|
||||
<div class="col-auto">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">Search</span>
|
||||
<input
|
||||
type="search"
|
||||
name="q"
|
||||
value="{{ q }}"
|
||||
class="form-control"
|
||||
placeholder="by name…"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select
|
||||
name="type"
|
||||
class="form-select me-2"
|
||||
style="min-width:140px;"
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
<option value="">All Types</option>
|
||||
{% for t in plant_types %}
|
||||
<option
|
||||
value="{{ t|lower }}"
|
||||
{% if t|lower == type_filter %}selected{% endif %}
|
||||
>{{ t }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-auto">
|
||||
<select
|
||||
name="type"
|
||||
class="form-select"
|
||||
style="min-width:140px;"
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
<option value="">All Types</option>
|
||||
{% for t in plant_types %}
|
||||
<option
|
||||
value="{{ t|lower }}"
|
||||
{% if t|lower == type_filter %}selected{% endif %}
|
||||
>{{ t }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<select
|
||||
name="per_page"
|
||||
class="form-select me-2"
|
||||
style="min-width:140px;"
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
{% for size in [6,12,18,24] %}
|
||||
<option value="{{ size }}" {% if per_page == size %}selected{% endif %}>
|
||||
{{ size }} per page
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-auto">
|
||||
<select
|
||||
name="per_page"
|
||||
class="form-select"
|
||||
style="min-width:140px;"
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
{% for size in [6,12,18,24] %}
|
||||
<option value="{{ size }}" {% if per_page == size %}selected{% endif %}>
|
||||
{{ size }} per page
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{# keep the current view so Apply doesn’t reset it #}
|
||||
{# preserve current view so Apply doesn’t reset it #}
|
||||
<input type="hidden" name="view" value="{{ view_mode }}" />
|
||||
|
||||
<button type="submit" class="btn btn-primary me-2">Apply</button>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Apply</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" role="group" aria-label="View mode">
|
||||
<a
|
||||
href="{{ url_for('plant.index',
|
||||
page=pagination.page,
|
||||
per_page=per_page,
|
||||
q=q,
|
||||
type=type_filter,
|
||||
view='grid'
|
||||
) }}"
|
||||
class="btn btn-outline-secondary {% if view_mode=='grid' %}active{% endif %}"
|
||||
title="Card View"
|
||||
><i class="bi bi-grid-3x3-gap-fill"></i></a>
|
||||
|
||||
<a
|
||||
href="{{ url_for('plant.index',
|
||||
page=pagination.page,
|
||||
per_page=per_page,
|
||||
q=q,
|
||||
type=type_filter,
|
||||
view='list'
|
||||
) }}"
|
||||
class="btn btn-outline-secondary {% if view_mode=='list' %}active{% endif %}"
|
||||
title="List View"
|
||||
><i class="bi bi-list-ul"></i></a>
|
||||
<div class="col-auto">
|
||||
<div class="btn-group" role="group" aria-label="View mode">
|
||||
<a
|
||||
href="{{ url_for('plant.index',
|
||||
page=pagination.page,
|
||||
per_page=per_page,
|
||||
q=q,
|
||||
type=type_filter,
|
||||
view='grid') }}"
|
||||
class="btn btn-outline-secondary {% if view_mode=='grid' %}active{% endif %}"
|
||||
title="Card View"
|
||||
>
|
||||
<i class="bi bi-grid-3x3-gap-fill"></i>
|
||||
</a>
|
||||
<a
|
||||
href="{{ url_for('plant.index',
|
||||
page=pagination.page,
|
||||
per_page=per_page,
|
||||
q=q,
|
||||
type=type_filter,
|
||||
view='list') }}"
|
||||
class="btn btn-outline-secondary {% if view_mode=='list' %}active{% endif %}"
|
||||
title="List View"
|
||||
>
|
||||
<i class="bi bi-list-ul"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user