mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
WIP
This commit is contained in:
parent
ba0b816241
commit
f5fdb73160
@ -453,16 +453,32 @@ public class DefaultDbAdminController {
|
||||
@GetMapping("/settings")
|
||||
public String settings(Model model) {
|
||||
model.addAttribute("activePage", "settings");
|
||||
return "settings";
|
||||
return "settings/settings";
|
||||
}
|
||||
|
||||
@GetMapping("/about")
|
||||
public String about(Model model) {
|
||||
model.addAttribute("activePage", "about");
|
||||
return "about";
|
||||
}
|
||||
|
||||
@GetMapping("/settings/appearance")
|
||||
public String settingsAppearance(Model model) {
|
||||
model.addAttribute("activePage", "settings");
|
||||
return "settings/appearance";
|
||||
}
|
||||
|
||||
@PostMapping("/settings")
|
||||
public String settings(@RequestParam Map<String, String> params, Model model) {
|
||||
String next = params.getOrDefault("next", "settings/settings");
|
||||
|
||||
for (String paramName : params.keySet()) {
|
||||
if (paramName.equals("next")) continue;
|
||||
|
||||
userSettingsRepo.save(new UserSetting(paramName, params.get(paramName)));
|
||||
}
|
||||
model.addAttribute("activePage", "settings");
|
||||
return "settings";
|
||||
return next;
|
||||
}
|
||||
|
||||
private UserAction saveAction(UserAction action) {
|
||||
|
23
src/main/resources/templates/about.html
Normal file
23
src/main/resources/templates/about.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
|
||||
<head th:replace="~{fragments/resources::head}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-light main-wrapper">
|
||||
<nav th:replace="~{fragments/resources :: navbar}"></nav>
|
||||
<div class="d-flex">
|
||||
<div th:replace="~{fragments/resources :: sidebar('entities')}"></div>
|
||||
<div class="main-content bg-lighter">
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-database"></i><span class="align-middle"> Entities</span></h1>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="box">
|
||||
<h3 class="fw-bold">About</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -16,6 +16,9 @@
|
||||
<script th:inline="javascript">
|
||||
let baseUrl = [[ ${baseUrl} ]];
|
||||
</script>
|
||||
<style type="text/css">
|
||||
[( ${userConf.get('additionalCss')} )]
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<th:block th:fragment="alerts">
|
||||
@ -111,7 +114,7 @@
|
||||
<div class="separator"></div>
|
||||
<ul class="sidebar-menu mb-0 pb-0">
|
||||
<li th:class="${#strings.equals(page, 'about') ? 'active' : ''}">
|
||||
<a href="/about">
|
||||
<a th:href="|/${baseUrl}/about|">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="menu-icon">
|
||||
<i class="bi bi-question-circle"></i>
|
||||
|
@ -63,7 +63,6 @@
|
||||
<th>Table</th>
|
||||
<th>Item ID</th>
|
||||
<th>Time</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr th:each="entry : ${page.getResults()}" class="table-data-row align-middle">
|
||||
<td th:text="${entry.getActionType()}">
|
||||
@ -74,13 +73,11 @@
|
||||
</td>
|
||||
<td th:text="${entry.getFormattedDate()}">
|
||||
</td>
|
||||
<td>
|
||||
<!--
|
||||
<a href="#" class="ui-btn btn btn-primary">
|
||||
Diff <i class="text-white bi bi-search"></i>
|
||||
</a>
|
||||
-->
|
||||
</td>
|
||||
<!--
|
||||
<a href="#" class="ui-btn btn btn-primary">
|
||||
Diff <i class="text-white bi bi-search"></i>
|
||||
</a>
|
||||
-->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
50
src/main/resources/templates/settings/appearance.html
Normal file
50
src/main/resources/templates/settings/appearance.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
|
||||
<head th:replace="~{fragments/resources::head}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-light main-wrapper">
|
||||
<nav th:replace="~{fragments/resources :: navbar}"></nav>
|
||||
<div class="d-flex">
|
||||
<div th:replace="~{fragments/resources :: sidebar('entities')}"></div>
|
||||
<div class="main-content bg-lighter">
|
||||
<th:block th:replace="~{fragments/resources :: alerts}"></th:block>
|
||||
<h1 class="fw-bold mb-4"><i class="align-middle bi bi-gear"></i>
|
||||
<span class="align-middle"><a th:href="|/${baseUrl}|">Settings</a></span>
|
||||
</h1>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a th:href="|/${baseUrl}/settings|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> GENERAL
|
||||
</div>
|
||||
</a>
|
||||
<a th:href="|/${baseUrl}/settings/appearance|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> APPEARANCE
|
||||
</div>
|
||||
</a>
|
||||
<div class="inner-navigation-border flex-grow-1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box with-navigation">
|
||||
<h3 class="fw-bold">Appearance</h3>
|
||||
<form th:action="|/${baseUrl}/settings|" method="POST">
|
||||
<input type="hidden" name="next" value="settings/appearance">
|
||||
<label for="additionalCss">Additional CSS</label>
|
||||
<span class="m-0 p-0 text-muted">Additional CSS code that is added automatically to all pages</span>
|
||||
<textarea class="form-control mt-2"
|
||||
id="additionalCss" name="additionalCss" rows="8"
|
||||
th:text="${userConf.get('additionalCss')}"></textarea>
|
||||
<button class="ui-btn btn btn-primary mt-3">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -15,16 +15,16 @@
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="w-100 d-flex inner-navigation">
|
||||
<a href="#" class="active">
|
||||
<a th:href="|/${baseUrl}/settings|" class="active">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-database pe-2"></i> GENERAL
|
||||
</div>
|
||||
</a>
|
||||
<!-- <a href="#">
|
||||
<a th:href="|/${baseUrl}/settings/appearance|">
|
||||
<div class="ui-tab ps-5 pe-5 p-3">
|
||||
<i class="bi bi-table pe-2"></i> DATA
|
||||
<i class="bi bi-table pe-2"></i> APPEARANCE
|
||||
</div>
|
||||
</a> -->
|
||||
</a>
|
||||
<div class="inner-navigation-border flex-grow-1">
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user