05/06 Phase 2: fixed issues
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
{% extends "admin/layouts/base.html" %}
|
||||
{% block title %}Settings Overrides — {{ tenant.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h4 class="fw-bold mb-0">Overrides — {{ tenant.name }}</h4>
|
||||
<a href="{{ url_for('settings_override.set_override', tenant_id=tenant.id) }}" class="btn btn-warning btn-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i>Set Override
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if active %}
|
||||
<div class="card shadow-sm mb-4 border-warning">
|
||||
<div class="card-header bg-warning-subtle fw-semibold">Active Overrides</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm mb-0">
|
||||
<thead><tr><th>Key</th><th>Value</th><th>Set by</th><th>Set at</th><th>Note</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for ov in active %}
|
||||
<tr>
|
||||
<td><code>{{ ov.setting_key }}</code></td>
|
||||
<td>{{ ov.setting_value }}</td>
|
||||
<td class="small">{{ ov.admin.name if ov.admin else ov.overridden_by }}</td>
|
||||
<td class="small text-muted">{{ ov.overridden_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||||
<td class="small text-muted">{{ ov.note or '—' }}</td>
|
||||
<td>
|
||||
<form method="POST" action="{{ url_for('settings_override.lift_override', override_id=ov.id) }}"
|
||||
onsubmit="return confirm('Lift this override?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button class="btn btn-outline-warning btn-sm">Lift</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-light">No active overrides for this tenant.</div>
|
||||
{% endif %}
|
||||
|
||||
{% if history %}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header fw-semibold text-muted">Override History</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm mb-0">
|
||||
<thead><tr><th>Key</th><th>Value</th><th>Set at</th><th>Lifted at</th></tr></thead>
|
||||
<tbody>
|
||||
{% for ov in history %}
|
||||
<tr class="text-muted">
|
||||
<td><code>{{ ov.setting_key }}</code></td>
|
||||
<td>{{ ov.setting_value }}</td>
|
||||
<td class="small">{{ ov.overridden_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||||
<td class="small">{{ ov.lifted_at.strftime('%Y-%m-%d %H:%M') if ov.lifted_at else '—' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ url_for('tenants.detail', tenant_id=tenant.id) }}" class="btn btn-outline-secondary btn-sm mt-3">
|
||||
<i class="bi bi-arrow-left me-1"></i>Back to Tenant
|
||||
</a>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user