## Problems Fixed: 1. **Template inheritance inconsistency** - Some admin pages used standalone HTML while others extended base.html 2. **CSS duplication** - Each admin page had duplicate styles for similar components 3. **Header styling variations** - Different admin pages had slightly different header styles 4. **Inconsistent class naming** - Mixed naming patterns across admin templates ## Root Cause: Admin pages were developed independently without a shared styling foundation, leading to code duplication and visual inconsistencies. ## Solution Implemented: ### New Shared Admin Base - **Created `_admin_base.html`** - Unified base template for all admin pages - **Consolidated styles** - Moved common admin styles to shared base template - **Standardized components** - Unified buttons, tables, badges, forms, etc. - **Consistent layout** - Standard admin container, header, and navigation structure ### Refactored Templates - **`admin.html`** - Now extends `_admin_base.html`, removed 300+ lines of duplicate CSS - **`admin_polling.html`** - Converted to use base template, cleaner structure - **`admin_polling_logs.html`** - Completely rewritten to use base template - **Consistent class names** - All admin tables now use `.admin-table` instead of mixed names ### Benefits - **Maintainability** - Single source of truth for admin styling - **Consistency** - All admin pages now have identical look and feel - **Performance** - Reduced CSS duplication improves load times - **Extensibility** - Easy to add new admin pages with consistent styling All admin pages now share a unified, professional appearance\! Commit: [current] 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
2.9 KiB
HTML
84 lines
2.9 KiB
HTML
{% extends "_admin_base.html" %}
|
|
|
|
{% block title %}Polling Logs - {{ source.display_name }} - Admin{% endblock %}
|
|
|
|
{% block page_title %}Polling Logs - {{ source.display_name }}{% endblock %}
|
|
{% block page_description %}View polling history and error logs for this source{% endblock %}
|
|
|
|
{% block admin_styles %}
|
|
.error-detail {
|
|
background: #fff3cd;
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
margin-top: 8px;
|
|
font-size: 0.9rem;
|
|
white-space: pre-wrap;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.no-logs {
|
|
text-align: center;
|
|
padding: 48px;
|
|
color: var(--text-secondary);
|
|
}
|
|
{% endblock %}
|
|
|
|
{% block admin_content %}
|
|
<div class="admin-table">
|
|
{% if logs %}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Timestamp</th>
|
|
<th>Status</th>
|
|
<th>Posts Found</th>
|
|
<th>New Posts</th>
|
|
<th>Updated Posts</th>
|
|
<th>Error Details</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for log in logs %}
|
|
<tr>
|
|
<td>{{ log.poll_time.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
|
<td>
|
|
{% if log.status == 'success' %}
|
|
<span class="status-badge status-success">Success</span>
|
|
{% elif log.status == 'error' %}
|
|
<span class="status-badge status-error">Error</span>
|
|
{% elif log.status == 'running' %}
|
|
<span class="status-badge status-running">Running</span>
|
|
{% else %}
|
|
<span class="status-badge">{{ log.status }}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ log.posts_found }}</td>
|
|
<td>{{ log.posts_new }}</td>
|
|
<td>{{ log.posts_updated }}</td>
|
|
<td>
|
|
{% if log.error_message %}
|
|
<details>
|
|
<summary style="cursor: pointer; color: var(--primary-color);">View Error</summary>
|
|
<div class="error-detail">{{ log.error_message }}</div>
|
|
</details>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<div class="no-logs">
|
|
<p>No polling logs yet.</p>
|
|
<p>Logs will appear here after the first poll.</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div style="margin-top: 24px;">
|
|
<a href="{{ url_for('admin_polling') }}" class="btn btn-secondary">← Back to Polling Management</a>
|
|
</div>
|
|
{% endblock %} |