change kontor-gin templates
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
Thomas Peetz
2026-09-24 16:06:38 +02:00
parent ba83d70764
commit 131296c644
26 changed files with 333 additions and 419 deletions
+3
View File
@@ -0,0 +1,3 @@
{{ define "footer" }}
<div class="footer">{{ .version }}</div>
{{ end }}
+13
View File
@@ -0,0 +1,13 @@
{{ define "head" }}
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="/public/style/main.css" />
<title>{{ .title }}</title>
</head>
{{ end }}
+37 -10
View File
@@ -1,13 +1,40 @@
{{ define "navbar" }}
<div class="topnav">
<a href="/">Kontor</a>
<a href="/comic/comics">Comics</a>
<a href="/media/files">Media</a>
<a href="/media/lofis">Lofi</a>
{{ if .user }}
<a style="float:right" href="{{ .logout }}">Logout</a></li>
{{ else }}
<a style="float:right" href="{{ .login }}">Login</a></li>
{{ end }}
<div class="container">
<nav class="navbar fixed-top navbar-expand-lg navbar-dark" style="background-color: darkgrey;">
<a class="navbar-brand" href="/">Kontor</a>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-item nav-link" href="/comic/comics">Comics</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Media</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="/media/files">Media Files</a>
<a class="dropdown-item" href="/media/actors">Media Actors</a>
<a class="dropdown-item" href="/media/lofis">Lofi</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/media/files">Media</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/media/lofis">Lofis</a>
</li>
{{ if .user }}
<li class="nav-item">
<a class="nav-link" href="{{ .logout }}">Logout</a>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link" href="{{ .login }}">Login</a>
</li>
{{ end }}
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</ul>
</nav>
</div>
{{ end }}
+56 -49
View File
@@ -1,52 +1,59 @@
{{ define "comics.html" }}
{{ template "main" . }}
{{ end }}
{{ define "comics" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<div class="row">
<form class="form-inline" action="/comic/comics">
<input type="text" placeholder="Search" name="query">
<label>
<input type="checkbox" name="completed" {{ if .completed }}checked{{ end }}>Completed
</label>
<label>
<input type="checkbox" name="order" {{ if .order }}checked{{ end }}>Order
</label>
<button type="submit">Search</button>
<div class="pill-nav"><a href="/comic/comic/add">Add Comic</a></div>
</form>
</div>
<div class="row">
<div class="maincolumn">
<table class="table table-hover">
<thead><tr>
<th scope="col">Title</th>
<th scope="col">Publisher</th>
<th scope="col">Completed</th>
<th colspan="2">Actions</th>
</tr></thead>
<tbody>
{{ range .comics }}
<tr>
<th scope="row"><a href="/comic/comics/{{.ID}}">{{.Title}}</a></th>
{{ if .Publisher }}
<td><a href="/comic/publishers/{{.Publisher.ID}}">{{.Publisher.Name}}</a></td>
{{ else }}
<td>Publisher not set</td>
{{ end }}
<td>
{{ if .Completed }}
<img src="/tick.png" alt="true" width="24" height="24">
{{ else }}
<img src="/cross.png" alt="true" width="24" height="24">
<body>
{{ template "navbar" . }}
<div class="row">
<form class="form-inline" action="/comic/comics">
<input type="text" placeholder="Search" name="query">
<label>
<input type="checkbox" name="completed" {{ if .Completed }}checked{{ end }}>Completed
</label>
<label>
<input type="checkbox" name="order" {{ if .CurrentOrder }}checked{{ end }}>Order
</label>
<button type="submit">Search</button>
<div class="pill-nav"><a href="/comic/comic/add">Add Comic</a></div>
</form>
</div>
<div class="row">
<div class="maincolumn">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Publisher</th>
<th scope="col">Completed</th>
<th colspan="2">Actions</th>
</tr>
</thead>
<tbody>
{{ range .comics }}
<tr>
<th scope="row"><a href="/comic/comics/{{.ID}}">{{.Title}}</a></th>
{{ if .Publisher }}
<td><a href="/comic/publishers/{{.Publisher.ID}}">{{.Publisher.Name}}</a></td>
{{ else }}
<td>Publisher not set</td>
{{ end }}
<td>
{{ if .Completed }}
<img src="/public/icons/tick.png" alt="true" width="24" height="24">
{{ else }}
<img src="/public/icons/cross.png" alt="true" width="24" height="24">
{{ end }}
</td>
<td><a href="/comic/comics/edit/{{.ID}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
<td><a href="/comic/comics/delete/{{.ID}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
</tr>
{{ end }}
</td>
<td><a href="/comic/comics/edit/{{.ID}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
<td><a href="/comic/comics/delete/{{.ID}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</tbody>
</table>
</div>
</div>
{{ template "footer" . }}
</body>
</html>
{{ end }}
+10 -5
View File
@@ -1,7 +1,12 @@
{{ define "home.html" }}
{{ template "main" . }}
{{ end }}
{{ define "home" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<h1>{{ .content }}</h1>
<body>
{{ template "navbar" . }}
<h1>{{ .message }}</h1>
{{ template "footer" . }}
</body>
</html>
{{ end }}
+60 -50
View File
@@ -1,52 +1,62 @@
{{ define "media_lofi.html" }}
{{ template "main" . }}
{{ end }}
{{ define "lofi" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<div class="row">
<form class="form-inline" action="/media/lofi">
<input type="text" placeholder="Search" name="query">
<label>
<input type="checkbox" name="review" {{ if .Review }}checked{{ end }}>Completed
</label>
<label>
<input type="checkbox" name="should_download" {{ if .ShouldDownload }}checked{{ end }}>Order
</label>
<button type="submit">Search</button>
<div class="pill-nav"><a href="/media/lofi/add">Add Lofi</a></div>
</form>
</div>
<div class="row">
<div class="maincolumn">
<table class="table table-hover">
<thead><tr>
<th scope="col">Title</th>
<th scope="col">Publisher</th>
<th scope="col">Completed</th>
<th colspan="2">Actions</th>
</tr></thead>
<tbody>
{{ range .comics }}
<tr>
<th scope="row"><a href="/media/lofi/{{.ID}}">{{.Title}}</a></th>
{{ if .WebLink }}
<td><a href="{{.WebLink}}">{{.Title}}</a></td>
{{ else }}
<td>WebLink not set</td>
{{ end }}
<td>
{{ if .Review }}
<img src="/tick.png" alt="true" width="24" height="24">
{{ else }}
<img src="/cross.png" alt="true" width="24" height="24">
{{ end }}
</td>
<td><a href="/media/lofi/edit/{{.ID}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
<td><a href="/media/lofi/delete/{{.ID}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
<body>
{{ template "navbar" . }}
<div class="row">
<h1>Media Lofi</h1>
</div>
<div class="row">
<form class="form-inline" action="/media/lofis">
<input type="text" placeholder="Search" name="query">
<input>
<input type="checkbox" name="review" {{ if .Review }}checked{{ end }}>Review
</label>
<label>
<input type="checkbox" name="should_download" {{ if .ShouldDownload }}checked{{ end }}>Download
</label>
<button type="submit">Search</button>
<div class="pill-nav"><a href="/media/lofis/add">Add Lofi</a></div>
</form>
</div>
<div class="row">
<div class="maincolumn">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Weblink</th>
<th scope="col">Review</th>
<th colspan="2">Actions</th>
</tr>
</thead>
<tbody>
{{ range .lofis }}
<tr>
<th scope="row"><a href="/media/lofis/{{.ID}}">{{.Title}}</a></th>
{{ if .Url }}
<td><a href="{{.Url}}">{{.Url}}</a></td>
{{ else }}
<td>WebLink not set</td>
{{ end }}
<td>
{{ if .Review }}
<img src="/public/icons/tick.png" alt="true" width="24" height="24">
{{ else }}
<img src="/public/icons/cross.png" alt="true" width="24" height="24">
{{ end }}
</td>
<td><a href="/media/lofis/edit/{{.ID}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
<td><a href="/media/lofis/delete/{{.ID}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
{{ template "footer" . }}
</body>
</html>
{{ end }}
+31 -29
View File
@@ -1,34 +1,36 @@
{{ define "login.html" }}
{{ template "main" . }}
{{ end }}
{{ define "login" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<div class="content">
<form action={{ .login }} method="post">
<body>
{{ template "navbar" . }}
<div class="content">
<form action="{{ .login }}" method="post">
<div class="container" style="border: 1px solid lightgray; border-radius: 3px; padding: 15px;">
{{ if .content }}
<div class="notification is-danger">{{ .message }}</div>
{{ end}}
<div class="container" style="border: 1px solid lightgray; border-radius: 3px; padding: 15px;">
{{ if .content }}
<div class="notification is-danger">{{ .content }}</div>
{{ end}}
<div class="field">
<label class="label">Username</label>
<div class="control">
<input class="input" type="text" placeholder="Enter Username" name="username" required/>
<div class="field">
<label class="label">Username</label>
<div class="control">
<input class="input" type="text" placeholder="Enter Username" name="username" required/>
</div>
</div>
<div class="field">
<label class="label">Passwort</label>
<div class="control">
<input class="input" type="password" placeholder="Enter Password" name="password" required/>
</div>
</div>
<div class="field">
<button class="button is-link">Submit</button>
</div>
</div>
<div class="field">
<label class="label">Passwort</label>
<div class="control">
<input class="input" type="password" placeholder="Enter Password" name="password" required/>
</div>
</div>
<div class="field">
<button class="button is-link">Submit</button>
</div>
</div>
</form>
</div>
</form>
</div>
{{ template "footer" . }}
</body>
</html>
{{ end }}
+12 -5
View File
@@ -1,7 +1,14 @@
{{ define "home.html" }}
{{ template "main" . }}
{{ end }}
{{ define "mediaactors" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<h1>{{ .content }}</h1>
<body>
{{ template "navbar" . }}
<div>
<h1>{{ .message }}</h1>
</div>
{{ template "footer" . }}
</body>
</html>
{{ end }}
+10 -5
View File
@@ -1,7 +1,12 @@
{{ define "mediafiles.html" }}
{{ template "main" . }}
{{ end }}
{{ define "mediafiles" }}
<!doctype html>
<html lang="de">
{{ template "head" . }}
{{ define "content" }}
<h1>{{ .content }}</h1>
<body>
{{ template "navbar" . }}
<h1>{{ .message }}</h1>
{{ template "footer" . }}
</body>
</html>
{{ end }}