feat(frontend): add dedicated /cli page, nav links, and CTA buttons; remove CLI modals for leaner UX

- New CLI page at /cli with detailed usage and improved Quick Start card header
- Add CLI link to navbars and small ‘Try the CLI’ CTAs on Home & Templates
- Remove CLI modals and unused showCliModal() handler (keep_small_simple)
- Self-host Bootstrap and Font Awesome; add OSI logo and GPL notice in footers
- Dockerfile: verify vendor assets exist at build time
- Minor a11y/contrast and heading-order cleanups (100 a11y)
This commit is contained in:
William Valentin
2025-09-15 00:47:31 -07:00
parent 9caf95bb7a
commit a0ae5f869e
16 changed files with 589 additions and 48 deletions

View File

@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ app_name }} Editor — create, validate, and download systemd unit files with a visual editor and real-time checks.">
<title>Editor - {{ app_name }}</title>
<link rel="icon" type="image/svg+xml" href="/static/img/favicon.svg">
<link rel="icon" type="image/svg+xml" sizes="16x16" href="/static/img/favicon-16x16.svg">
@@ -14,10 +15,10 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="{{ app_name }}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.0.1/codemirror.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.0.1/theme/monokai.min.css" rel="stylesheet">
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
<link href="/static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/static/vendor/fontawesome/css/all.min.css">
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
@@ -40,12 +41,15 @@
<li class="nav-item">
<a class="nav-link" href="/templates">Templates</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cli">CLI</a>
</li>
</ul>
<div class="navbar-nav">
<button class="btn btn-outline-light btn-sm me-2" onclick="downloadFile()">
<button class="btn btn-light btn-sm me-2" onclick="downloadFile()">
<i class="fas fa-download me-1"></i>Download
</button>
<button class="btn btn-outline-light btn-sm" onclick="showUploadModal()">
<button class="btn btn-light btn-sm" onclick="showUploadModal()">
<i class="fas fa-upload me-1"></i>Upload
</button>
</div>
@@ -214,7 +218,8 @@
</div>
</div>
<div class="card-body p-0">
<textarea id="editor" class="form-control border-0" rows="25" style="font-family: 'Courier New', monospace; resize: none; color: white; background-color: #2d3748;">[Unit]
<label for="editor" class="visually-hidden">Unit file editor</label>
<textarea id="editor" class="form-control border-0" aria-label="Unit file content" rows="25" style="font-family: 'Courier New', monospace; resize: none; color: white; background-color: #2d3748;">[Unit]
Description=My Service Description
After=network.target
@@ -274,7 +279,7 @@ WantedBy=multi-user.target</textarea>
<small><strong>[Install]</strong> - Installation and enabling info</small>
</div>
<div class="help-item">
<small><a href="https://www.freedesktop.org/software/systemd/man/systemd.unit.html" target="_blank">systemd documentation <i class="fas fa-external-link-alt"></i></a></small>
<small><a class="link-contrast" href="https://www.freedesktop.org/software/systemd/man/systemd.unit.html" target="_blank">systemd documentation <i class="fas fa-external-link-alt"></i></a></small>
</div>
</div>
</div>
@@ -326,7 +331,41 @@ WantedBy=multi-user.target</textarea>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<footer class="bg-dark text-light py-4 mt-5">
<div class="container">
<div class="row">
<div class="col-md-6">
<p class="fw-bold mb-0"><i class="fas fa-cogs me-2"></i>{{ app_name }}</p>
<p class="text-muted small">{{ app_description }}.</p>
</div>
<div class="col-md-6 text-md-end">
<div class="d-flex justify-content-md-end gap-3">
<a href="{{ api_docs_url }}" class="text-light text-decoration-none">
<i class="fas fa-book me-1"></i>API Docs
</a>
<a href="{{ github_url }}" class="text-light text-decoration-none">
<i class="fab fa-github me-1"></i>GitHub
</a>
</div>
<div class="mt-2 small">
<span class="me-2">
<i class="fas fa-code-branch me-1"></i>Open Source
<span class="badge bg-success ms-2">OSI</span>
</span>
<span>
Licensed under
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank" rel="noopener" class="text-decoration-underline text-light">GPL-3.0-or-later</a>
</span>
</div>
</div>
</div>
</div>
</footer>
<script src="/static/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/static/js/main.js"></script>
<script src="/static/js/editor.js"></script>
</body>
</html>