Replace branch dropdown with table listing each branch
Show branches in a table with a Checkout button per row. The current branch is shown in bold with '(current)' and has no checkout button. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -6,26 +6,25 @@
|
||||
<body>
|
||||
<h2>Branches</h2>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<h3>Branches</h3>
|
||||
<table border="1" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td>Current branch:</td>
|
||||
<td><b th:text="${currentBranch}"></b></td>
|
||||
<th>Branch</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Switch Branch</h3>
|
||||
<form method="post" th:action="@{/repo/{name}/checkout(name=${name})}">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<tr th:each="b : ${branches}">
|
||||
<td>
|
||||
<select name="branch">
|
||||
<option th:each="b : ${branches}" th:value="${b}" th:text="${b}" th:selected="${b == currentBranch}"></option>
|
||||
</select>
|
||||
<b th:if="${b == currentBranch}" th:text="${b} + ' (current)'"></b>
|
||||
<span th:unless="${b == currentBranch}" th:text="${b}"></span>
|
||||
</td>
|
||||
<td>
|
||||
<form th:unless="${b == currentBranch}" method="post" th:action="@{/repo/{name}/checkout(name=${name})}">
|
||||
<input type="hidden" name="branch" th:value="${b}">
|
||||
<input type="submit" value="Checkout">
|
||||
</form>
|
||||
</td>
|
||||
<td><input type="submit" value="Checkout"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<h3>Create New Branch</h3>
|
||||
<form method="post" th:action="@{/repo/{name}/new-branch(name=${name})}">
|
||||
|
||||
Reference in New Issue
Block a user