Files
lego-instructions-manager/app/templates/admin/sets.html

100 lines
4.2 KiB
HTML

{% extends "base.html" %}
{% block title %}Set Management - Admin{% endblock %}
{% block content %}
<div class="row mb-4">
<div class="col">
<h1><i class="bi bi-box-seam"></i> Set Management</h1>
</div>
<div class="col-auto">
<a href="{{ url_for('admin.dashboard') }}" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left"></i> Back
</a>
</div>
</div>
<div class="card mb-4">
<div class="card-body">
<form method="GET">
<div class="row g-2">
<div class="col-md-6">
<input type="text" class="form-control" name="search"
value="{{ search }}" placeholder="Search sets...">
</div>
<div class="col-md-3">
<select class="form-select" name="type">
<option value="all" {% if filter_type=='all' %}selected{% endif %}>All Sets</option>
<option value="official" {% if filter_type=='official' %}selected{% endif %}>Official Only</option>
<option value="mocs" {% if filter_type=='mocs' %}selected{% endif %}>MOCs Only</option>
</select>
</div>
<div class="col-md-3">
<button class="btn btn-primary w-100" type="submit">
<i class="bi bi-search"></i> Filter
</button>
</div>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body p-0">
{% if sets %}
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead>
<tr>
<th>Set Number</th>
<th>Name</th>
<th>Theme</th>
<th>Year</th>
<th>Type</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for set in sets %}
<tr>
<td><strong>{{ set.set_number }}</strong></td>
<td>{{ set.set_name }}</td>
<td><span class="badge bg-primary">{{ set.theme }}</span></td>
<td>{{ set.year_released }}</td>
<td>
{% if set.is_moc %}
<span class="badge bg-warning text-dark">
<i class="bi bi-star-fill"></i> MOC
</span>
{% else %}
<span class="badge bg-secondary">Official</span>
{% endif %}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ url_for('sets.view_set', set_id=set.id) }}"
class="btn btn-outline-primary">
<i class="bi bi-eye"></i>
</a>
<form method="POST" action="{{ url_for('admin.delete_set', set_id=set.id) }}"
style="display:inline;"
onsubmit="return confirm('Delete {{ set.set_number }}?');">
<button type="submit" class="btn btn-outline-danger">
<i class="bi bi-trash"></i>
</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="text-center text-muted my-4">No sets found</p>
{% endif %}
</div>
</div>
{% endblock %}