#5092 "Tokens". base.html's inline palette was its own: white text on the gold button (1.81:1), a red at 3.26:1 on a card, a warning yellow at hue 42 beside the gold accent at 46, a lavender page title, serif labels at 13px and weights up to 700. - static/theme.css is design system 6's generated sheet (FabledSword + the Steward accent). static/steward.css is base.html's stylesheet moved out, with :root now aliases onto those tokens (--bg, --text-muted, --green…) so every template keeps rendering; it states no colour of its own. - Status text colours are Steward overrides recorded in the design system (tokens 182-184): success #5FB87A, warning #E08A3C, error #EC7A6C. The house -fg mixes read "up" as grey hint text (dE 8.2) and warning as the accent (dE 11.5); these are >= 4.5:1 on page, card, hover and their own 15-25% tints. --orange is now the midpoint of warning and error. - Primary button and active range button: dark text on gold (7.82:1). Danger button on the house destructive fill. Badges and alerts take the -fg colour on a tint; the gold badge uses --fs-accent-fg. - Type: Inter body, Fraunces only for page titles and h1/h2, JetBrains Mono for code; section and widget titles become the tiny caps label in the body face; weights capped at 500. - Removed: the lavender title and share-view gradient, #606080, and the undefined --card-bg, --accent-faint, --accent-bg, --bg-alt, --border-low and --row-alt (now real tokens); the dead settings/index.html. - Guards (tests/test_style_tokens.py): every var(--x) used is defined; steward.css states no colour or weight over 500; hex colours in templates may only go down (ceiling 75, from 81 before this change), each with a self-test that it can fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
99 lines
4.7 KiB
HTML
99 lines
4.7 KiB
HTML
{% extends "base.html" %}
|
|
{% from "_macros.html" import crumbs %}
|
|
{% block title %}Browse Playbooks — Steward{% endblock %}
|
|
{% block breadcrumb %}
|
|
{%- if view_contents is defined -%}
|
|
{{ crumbs([("Ansible", "/ansible/"), ("Browse", "/ansible/browse"), (view_path, "")]) }}
|
|
{%- else -%}
|
|
{{ crumbs([("Ansible", "/ansible/"), ("Browse", "")]) }}
|
|
{%- endif -%}
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;">
|
|
<h1 class="page-title" style="margin-bottom:0;">Browse Playbooks</h1>
|
|
<div style="display:flex;gap:0.5rem;">
|
|
{% if session.user_role == 'admin' %}
|
|
<a href="/ansible/playbooks/new" class="btn btn-sm">New playbook</a>
|
|
{% endif %}
|
|
<a href="/ansible/inventory/targets" class="btn btn-ghost btn-sm">Inventory</a>
|
|
<a href="/ansible/schedules" class="btn btn-ghost btn-sm">Schedules</a>
|
|
</div>
|
|
</div>
|
|
|
|
{% if view_contents is defined %}
|
|
<div class="card">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;">
|
|
<h3 class="section-title">{{ view_path }}</h3>
|
|
<div style="display:flex;gap:0.5rem;">
|
|
{% if view_editable and session.user_role == 'admin' %}
|
|
<a href="/ansible/playbooks/edit/{{ view_source }}/{{ view_path }}" class="btn btn-sm">Edit</a>
|
|
<form method="post" action="/ansible/playbooks/delete" style="display:inline;"
|
|
onsubmit="return confirm('Delete {{ view_path }}?');">{{ csrf_field() }}
|
|
<input type="hidden" name="source_name" value="{{ view_source }}">
|
|
<input type="hidden" name="playbook_path" value="{{ view_path }}">
|
|
<button type="submit" class="btn btn-sm btn-danger">Delete</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<pre style="background:var(--bg);padding:1rem;border-radius:4px;overflow-x:auto;font-size:0.8rem;color:var(--text-muted);max-height:600px;overflow-y:auto;">{{ view_contents }}</pre>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if not source_data %}
|
|
{% if view_contents is not defined %}
|
|
<div class="card">
|
|
<p style="color:var(--text-muted);">No Ansible sources configured. <a href="/settings/ansible/">Add sources in Settings → Ansible</a>.</p>
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
{% for sd in source_data %}
|
|
<div class="card" style="margin-bottom:1.5rem;">
|
|
<div style="display:flex;align-items:center;gap:0.75rem;margin-bottom:1rem;">
|
|
<h3 class="section-title">{{ sd.source.name }}</h3>
|
|
<span style="color:var(--text-muted);font-size:0.8rem;background:var(--bg-elevated);padding:0.2rem 0.5rem;border-radius:3px;">{{ sd.source.type }}</span>
|
|
<span style="color:var(--text-dim);font-size:0.8rem;">{{ sd.source.path }}</span>
|
|
</div>
|
|
|
|
{% if not sd.playbooks %}
|
|
<p style="color:var(--text-dim);font-size:0.9rem;">No playbooks found at this path.</p>
|
|
{% else %}
|
|
<table class="table" style="margin-bottom:1rem;">
|
|
<thead>
|
|
<tr>
|
|
<th>Playbook</th>
|
|
<th style="width:120px;"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for pb in sd.playbooks %}
|
|
<tr>
|
|
<td>
|
|
<div style="display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;">
|
|
{% if pb.category %}<span style="font-size:0.68rem;text-transform:uppercase;letter-spacing:0.04em;background:var(--bg-elevated);color:var(--text-dim);border-radius:3px;padding:0.05em 0.45em;">{{ pb.category }}</span>{% endif %}
|
|
<span style="font-family:ui-monospace,monospace;font-size:0.88rem;">{{ pb.path }}</span>
|
|
</div>
|
|
{% if pb.description %}<div style="font-size:0.78rem;color:var(--text-muted);margin-top:0.15rem;">{{ pb.description }}</div>{% endif %}
|
|
</td>
|
|
<td class="td-actions">
|
|
<a href="/ansible/browse/{{ sd.source.name }}/{{ pb.path }}" class="btn btn-sm btn-ghost" style="margin-right:0.5rem;">View</a>
|
|
{% if sd.editable and session.user_role == 'admin' %}
|
|
<a href="/ansible/playbooks/edit/{{ sd.source.name }}/{{ pb.path }}" class="btn btn-sm btn-ghost" style="margin-right:0.5rem;">Edit</a>
|
|
{% endif %}
|
|
<a hx-get="/ansible/run-form/{{ sd.source.name }}/{{ pb.path }}"
|
|
hx-target="#run-form-{{ sd.source.name }}" hx-swap="innerHTML"
|
|
style="cursor:pointer;" class="btn btn-sm btn-ghost">Run</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{# Run form (loaded on demand via HTMX from /ansible/run-form/<source>/<pb>) #}
|
|
<div id="run-form-{{ sd.source.name }}"></div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|