56 lines
2.8 KiB
HTML
56 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Manage Knowledge Base{% endblock %}
|
|
{% block page_title %}Knowledge Base Management{% endblock %}
|
|
|
|
{% block content %}
|
|
<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>
|
|
<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>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
{% if articles %}
|
|
<table class="table mb-0">
|
|
<thead>
|
|
<tr><th>Title</th><th>Category</th><th>Author</th><th>Published</th><th>Views</th><th>Updated</th><th>Actions</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for art in articles %}
|
|
<tr>
|
|
<td style="font-size:14px;">{{ art.title[:60] }}</td>
|
|
<td style="font-size:12px;color:var(--muted);">{{ art.category or '—' }}</td>
|
|
<td style="font-size:13px;">{{ art.author.full_name if art.author else '—' }}</td>
|
|
<td>
|
|
{% if art.is_published %}
|
|
<span style="color:var(--success);font-size:12px;"><i class="bi bi-check-circle-fill"></i> Yes</span>
|
|
{% else %}
|
|
<span style="color:var(--muted);font-size:12px;"><i class="bi bi-dash-circle"></i> Draft</span>
|
|
{% endif %}
|
|
</td>
|
|
<td style="font-size:12px;color:var(--muted);">{{ art.view_count }}</td>
|
|
<td style="font-size:12px;color:var(--muted);">{{ art.updated_at.strftime('%b %d, %Y') }}</td>
|
|
<td>
|
|
<div class="d-flex gap-1">
|
|
<a href="{{ url_for('tickets.kb_article', article_id=art.id) }}" class="btn btn-secondary btn-sm" title="Preview"><i class="bi bi-eye"></i></a>
|
|
<a href="{{ url_for('admin.kb_edit', article_id=art.id) }}" class="btn btn-secondary btn-sm" title="Edit"><i class="bi bi-pencil"></i></a>
|
|
<form method="POST" action="{{ url_for('admin.kb_delete', article_id=art.id) }}" onsubmit="return confirm('Delete this article?');">
|
|
<button type="submit" class="btn btn-sm" style="background:rgba(248,113,113,.1);border:1px solid rgba(248,113,113,.2);color:var(--danger);" title="Delete"><i class="bi bi-trash"></i></button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% 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>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|