Fix article editor
This commit is contained in:
@@ -3,9 +3,60 @@
|
||||
{% block page_title %}Knowledge Base Management{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<!-- Filter bar -->
|
||||
<form method="GET" action="{{ url_for('admin.kb_list') }}" class="card mb-3">
|
||||
<div class="card-body py-2">
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col-12 col-sm">
|
||||
<div style="position:relative;">
|
||||
<i class="bi bi-search" style="position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:13px;"></i>
|
||||
<input type="text" name="q" value="{{ q }}" placeholder="Search title or tags…"
|
||||
class="form-control form-control-sm" style="padding-left:30px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-auto">
|
||||
<select name="category" class="form-select form-select-sm" style="min-width:140px;">
|
||||
<option value="">All categories</option>
|
||||
{% for cat in categories %}
|
||||
<option value="{{ cat }}" {% if cat == sel_category %}selected{% endif %}>
|
||||
{{ cat.replace('_',' ').title() }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6 col-sm-auto">
|
||||
<select name="author_id" class="form-select form-select-sm" style="min-width:140px;">
|
||||
<option value="">All authors</option>
|
||||
{% for author in authors %}
|
||||
<option value="{{ author.id }}" {% if sel_author_id == author.id|string %}selected{% endif %}>
|
||||
{{ author.full_name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6 col-sm-auto">
|
||||
<select name="published" class="form-select form-select-sm" style="min-width:130px;">
|
||||
<option value="" {% if sel_published == '' %}selected{% endif %}>All statuses</option>
|
||||
<option value="yes" {% if sel_published == 'yes' %}selected{% endif %}>Published</option>
|
||||
<option value="no" {% if sel_published == 'no' %}selected{% endif %}>Draft</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Filter</button>
|
||||
{% if q or sel_category or sel_author_id or sel_published %}
|
||||
<a href="{{ url_for('admin.kb_list') }}" class="btn btn-secondary btn-sm ms-1">Clear</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<span><i class="bi bi-journal-text me-2"></i>Articles <span style="font-size:12px;color:var(--muted);">({{ articles|length }})</span></span>
|
||||
<span><i class="bi bi-journal-text me-2"></i>Articles
|
||||
<span style="font-size:12px;color:var(--muted);">({{ articles|length }} result{{ 's' if articles|length != 1 }})</span>
|
||||
</span>
|
||||
<a href="{{ url_for('admin.kb_new') }}" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i>New Article
|
||||
</a>
|
||||
@@ -65,7 +116,12 @@
|
||||
{% else %}
|
||||
<div class="p-5 text-center" style="color:var(--muted);">
|
||||
<i class="bi bi-journal-x" style="font-size:40px;display:block;margin-bottom:12px;"></i>
|
||||
No articles yet. <a href="{{ url_for('admin.kb_new') }}" style="color:var(--accent3);">Create your first article →</a>
|
||||
{% if q or sel_category or sel_author_id or sel_published %}
|
||||
No articles match your filters.
|
||||
<a href="{{ url_for('admin.kb_list') }}" style="color:var(--accent3);display:block;margin-top:8px;">Clear filters</a>
|
||||
{% else %}
|
||||
No articles yet. <a href="{{ url_for('admin.kb_new') }}" style="color:var(--accent3);">Create your first article →</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user