This commit is contained in:
@@ -6,6 +6,8 @@ body {
|
|||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: lightgrey;
|
background: lightgrey;
|
||||||
|
padding-top: 56px;
|
||||||
|
padding-bottom: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header/Blog Title */
|
/* Header/Blog Title */
|
||||||
|
|||||||
@@ -89,6 +89,27 @@ func (handler *MediaLoFiHandler) ListPage(c *gin.Context) {
|
|||||||
session := sessions.Default(c)
|
session := sessions.Default(c)
|
||||||
user := session.Get(globals.UserKey)
|
user := session.Get(globals.UserKey)
|
||||||
logger := slog.Get(c)
|
logger := slog.Get(c)
|
||||||
|
var (
|
||||||
|
review bool
|
||||||
|
download bool
|
||||||
|
)
|
||||||
|
paramReview, existsReview := c.GetQuery("review")
|
||||||
|
if existsReview {
|
||||||
|
if paramReview == "on" {
|
||||||
|
review = true
|
||||||
|
} else {
|
||||||
|
review = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paramDownload, existsDownload := c.GetQuery("should_download")
|
||||||
|
if existsDownload {
|
||||||
|
if paramDownload == "on" {
|
||||||
|
download = true
|
||||||
|
} else {
|
||||||
|
download = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lofis, err := handler.Service.List(c.Request.Context())
|
lofis, err := handler.Service.List(c.Request.Context())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("MediaLoFiHandler#ListPage", "error", err.Error())
|
logger.Info("MediaLoFiHandler#ListPage", "error", err.Error())
|
||||||
@@ -102,6 +123,8 @@ func (handler *MediaLoFiHandler) ListPage(c *gin.Context) {
|
|||||||
"message": "MediaFiles...",
|
"message": "MediaFiles...",
|
||||||
"lofis": lofis,
|
"lofis": lofis,
|
||||||
"user": user,
|
"user": user,
|
||||||
|
"isReview": review,
|
||||||
|
"isDownload": download,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{ define "footer" }}
|
{{ define "footer" }}
|
||||||
<footer class="mt-auto py-3 bg-light fixed-bottom">
|
<footer class="mt-auto py-3 bg-light fixed-bottom mt-auto">
|
||||||
<div class="container text-center">
|
<div class="container text-center">
|
||||||
<span class="text-muted">{{ .version }}</span>
|
<span class="text-muted">{{ .version }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{ define "navbar" }}
|
{{ define "navbar" }}
|
||||||
<!-- 1. Kopfzeile & Navigation -->
|
<!-- 1. Kopfzeile & Navigation -->
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color:darkgrey;">
|
<nav class="navbar navbar-expand-lg navbar-dark fixed-top" style="background-color:darkgrey;">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="#">Kontor</a>
|
<a class="navbar-brand" href="#">Kontor</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
<html lang="de">
|
<html lang="de">
|
||||||
{{ template "head" . }}
|
{{ template "head" . }}
|
||||||
|
|
||||||
<body class="d-flex flex-column h-100">
|
<body>
|
||||||
{{ template "navbar" . }}
|
{{ template "navbar" . }}
|
||||||
<!-- 2. Hauptbereich -->
|
<main>
|
||||||
<main class="flex-shrink-0">
|
|
||||||
<div class="container my-4">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<h1>Media Lofi</h1>
|
<h1>Media Lofi</h1>
|
||||||
@@ -21,28 +19,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form class="form-inline" action="/media/lofis">
|
<form class="form-inline" action="/web/media-lofis">
|
||||||
<input type="text" placeholder="Search" name="query">
|
<input type="text" placeholder="Search" name="query">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="review" {{ if .Review }}checked{{ end }}>Review
|
<input type="checkbox" name="review" {{if .isReview}}checked{{end}}>Review
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="should_download" {{ if .ShouldDownload }}checked{{ end }}>Download
|
<input type="checkbox" name="should_download" {{if .isDownload}}checked{{end}}>Download
|
||||||
</label>
|
</label>
|
||||||
<button type="submit">Search</button>
|
<button type="submit">Search</button>
|
||||||
<div class="pill-nav"><a href="/media/lofis/add">Add Lofi</a></div>
|
<div class="pill-nav"><a href="/web/media-lofis/add">Add Lofi</a></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead><tr>
|
||||||
<tr>
|
|
||||||
<th scope="col">Title</th>
|
<th scope="col">Title</th>
|
||||||
<th scope="col">Weblink</th>
|
<th scope="col">Weblink</th>
|
||||||
<th scope="col">Review</th>
|
<th scope="col">Review</th>
|
||||||
<th colspan="2">Actions</th>
|
<th colspan="2">Actions</th>
|
||||||
</tr>
|
</tr></thead>
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range .lofis }}
|
{{ range .lofis }}
|
||||||
<tr>
|
<tr>
|
||||||
@@ -66,7 +62,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
{{ template "footer" . }}
|
{{ template "footer" . }}
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
{{ template "navbar" . }}
|
{{ template "navbar" . }}
|
||||||
|
<main>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form class="form-inline" action="/web/files">
|
<form class="form-inline" action="/web/files">
|
||||||
<input type="text" placeholder="Search" name="query">
|
<input type="text" placeholder="Search" name="query">
|
||||||
@@ -63,18 +64,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ template "footer" . }}
|
</main>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
{{ template "navbar" . }}
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
<h1>{{ .message }}</h1>
|
|
||||||
<h1>{{ .message }}</h1>
|
|
||||||
<h1>{{ .message }}</h1>
|
|
||||||
<h1>{{ .message }}</h1>
|
|
||||||
</div>
|
|
||||||
{{ template "footer" . }}
|
{{ template "footer" . }}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user