Files
webgit/src/main/resources/templates/changes.html
Sebastiaan de Schaetzen b5097685c7
All checks were successful
Deploy / build (push) Successful in 49s
Put push/pull buttons on one line
2026-02-27 19:29:08 +01:00

74 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="'Staging - ' + ${name}">Staging</title>
</head>
<body>
<h2>Staging</h2>
<p>Branch: <b th:text="${branch}"></b></p>
<table th:if="${commitsAhead != null}" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><span th:text="${commitsAhead}"></span> ahead, <span th:text="${commitsBehind}"></span> behind</td>
<td>
<form method="post" th:action="@{/repo/{name}/push(name=${name})}">
<input type="hidden" name="redirectTo" value="changes">
<input type="submit" value="Push">
</form>
</td>
<td>
<form method="post" th:action="@{/repo/{name}/pull(name=${name})}">
<input type="hidden" name="redirectTo" value="changes">
<input type="submit" value="Pull">
</form>
</td>
</tr>
</table>
<h3>Modified Files (unstaged)</h3>
<form method="post" th:action="@{/repo/{name}/stage(name=${name})}" th:if="${!#lists.isEmpty(modifiedFiles)}">
<table border="1" cellpadding="4" cellspacing="0">
<tr>
<th><input type="checkbox" name="selectAll"></th>
<th>File</th>
</tr>
<tr th:each="file : ${modifiedFiles}">
<td><input type="checkbox" name="files" th:value="${file}"></td>
<td><a th:href="@{'/repo/' + ${name} + '/diff/' + ${file}}" th:text="${file}"></a></td>
</tr>
</table>
<br>
<input type="submit" name="action" value="Stage Selected">
<input type="submit" name="action" value="Rollback Selected">
</form>
<p th:if="${#lists.isEmpty(modifiedFiles)}"><i>No modified files.</i></p>
<h3>Staged Files</h3>
<form method="post" th:action="@{/repo/{name}/unstage(name=${name})}" th:if="${!#lists.isEmpty(stagedFiles)}">
<table border="1" cellpadding="4" cellspacing="0">
<tr>
<th><input type="checkbox" name="selectAll"></th>
<th>File</th>
</tr>
<tr th:each="file : ${stagedFiles}">
<td><input type="checkbox" name="files" th:value="${file}"></td>
<td><a th:href="@{'/repo/' + ${name} + '/diff/' + ${file}}" th:text="${file}"></a></td>
</tr>
</table>
<br>
<input type="submit" value="Unstage Selected">
</form>
<p th:if="${#lists.isEmpty(stagedFiles)}"><i>No staged files.</i></p>
<form method="post" th:action="@{/repo/{name}/commit(name=${name})}" th:if="${!#lists.isEmpty(stagedFiles)}">
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td>Commit message:</td>
<td><input type="text" name="message" size="60"></td>
<td><input type="submit" value="Commit"></td>
</tr>
</table>
</form>
</body>
</html>