UI: das Repository wird in der Seitenüberschrift per Drop-Down gewählt

Die Link-Leiste neben dem Menü entfällt. An ihrer Stelle steht dort, wo
bisher der Repository-Name stand, eine Auswahlliste der bedienten
Repositories; werkator.js hängt die aktuelle Ansicht (branches, history,
current) an, damit der Wechsel auf derselben Seite bleibt. Mit nur einem
Repository bleibt der Name wie bisher reiner Text.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
mhoennig
2026-09-03 15:26:29 +02:00
co-authored by Claude Fable 5.1
parent e61adfbbaa
commit fe11a339ad
7 changed files with 46 additions and 15 deletions
+9 -9
View File
@@ -16,7 +16,15 @@
<h1 th:fragment="header(title)">
<a class="title-home" th:href="${homeUrl}" href="/" aria-label="Open latest builds"><img src="/favicon.svg" alt=""></a>
<span class="title-text" th:text="${title}">Latest Builds</span>
<span class="repo-name" th:unless="${#strings.isEmpty(repoName)}" th:text="${repoName}">owner/repo</span>
<!-- The repository switcher (ADR 0009): what makes several repositories one UI. It sits
where the repository name sits, because it *is* the repository name — the page's
subject, not a navigation target. Its option values are the repository roots;
werkator.js appends the current view, so switching keeps the reader on the same page.
With a single served repository there is nothing to switch, and the name is plain text. -->
<select th:if="${multiRepo}" id="repo-select" class="repo-select" aria-label="Repository">
<option th:each="r : ${repos}" th:value="${r.url}" th:selected="${r.current}" th:text="${r.name}">werkator</option>
</select>
<span class="repo-name" th:unless="${multiRepo} or ${#strings.isEmpty(repoName)}" th:text="${repoName}">owner/repo</span>
</h1>
<th:block th:fragment="nav(view)">
@@ -32,14 +40,6 @@
<span th:if="${view == 'system'}">System</span>
<a th:unless="${view == 'system'}" href="/system">System</a>
</nav>
<!-- The repository switcher (ADR 0009): what makes several repositories one UI.
With a single served repository there is nothing to switch, and the block is absent. -->
<nav class="repo-switch" th:if="${multiRepo}">
<th:block th:each="r : ${repos}">
<span th:if="${r.current}" th:text="${r.name}" class="repo-current">werkator</span>
<a th:unless="${r.current}" th:href="${r.url}" th:text="${r.name}">other</a>
</th:block>
</nav>
<span class="view-row-actions">
<span id="live-indicator" class="status status-unknown" title="live-update state">static</span>
<button id="reload-button" class="reload-button" type="button" title="Reload view" aria-label="Reload view"></button>