ui update: move from boostrap to daisyui

This commit is contained in:
2025-01-10 18:52:40 +01:00
parent 38d4f1ad38
commit 1efa264f07
3 changed files with 44 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
serv:
DB_DRIVER="postgres" DB_URL="user=crow password=4LlKpnQ2RZPzL13BSpkW4k dbname=crowsnest host=10.99.0.3 port=5432 sslmode=disable" go run cmd/frontend/*
DB_DRIVER="postgres" DB_URL="user=crow password=4LlKpnQ2RZPzL13BSpkW4k dbname=crowsnest host=192.168.0.2 port=5432 sslmode=disable" go run cmd/frontend/*
crawl:
DB_DRIVER="postgres" DB_URL="user=crow password=4LlKpnQ2RZPzL13BSpkW4k dbname=crowsnest host=192.168.0.2 port=5432 sslmode=disable" go run cmd/crawler/main.go
summ:

View File

@@ -1,19 +1,19 @@
{{ define "content" }}
<div class="content container">
<div class="content">
{{ range . }}
<div class="card p-2 m-4">
<div class="card bg-base-300 my-5 shadow-lg">
<div class="card-body">
<h5 class="card-title">{{ .Title }}</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">
<span class="badge text-bg-secondary">{{ .ShortSource }}</span>
<span class="badge text-bg-secondary">{{ .PublishDate }}</span>
<h2 class="card-title">{{ .Title }}</h2>
<p class="">
<span class="badge badge-outline">{{ .ShortSource }}</span>
<span class="badge badge-outline">{{ .PublishDate }}</span>
{{if .AiSummarized}}
<span class="badge text-bg-success">ai summary</span>
<span class="badge badge-outline">ai summary</span>
{{end}}
</h6>
</p>
<p class="card-text">{{ .Summary }}</p>
<a href="{{ .SourceUrl }}" class="card-link">Link</a>
<a href="{{ .SourceUrl }}" class="link">Link</a>
</div>
</div>
{{ end }}

View File

@@ -1,25 +1,49 @@
{{ define "base" }}
<!DOCTYPE html>
<html lang="de">
<html lang="de" data-theme="dark">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/unpoly@3.9.5/unpoly.min.css">
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.23/dist/full.min.css" rel="stylesheet" type="text/css" />
<body>
<nav class="navbar sticky-top bg-dark">
<div class="container-fluid">
<a class="navbar-brand text-light">crowsnest</a>
<form class="d-flex" role="search" method="post" action="/up/search" up-submit up-autosubmit up-target=".content">
<input name="search" class="form-control me-2" type="search" placeholder="Suche" aria-label="Suche">
<button class="btn btn-outline-success" type="submit">Suchen</button>
</form>
<nav class="fixed top-0 z-50 w-full p-4">
<div class="navbar bg-base-300 rounded-box drop-shadow-md">
<div class="flex-1">
<a href="/" class="btn btn-ghost text-xl">crowsnest</a>
<ul class="menu menu-horizontal">
<li><a class="active">Artikel</a></li>
<li><a>Themen</a></li>
</ul>
</div>
<div class="flex-none pe-4">
<form role="search" method="post" action="/up/search" up-submit up-autosubmit up-target=".content">
<label class="input input-bordered input-sm flex items-center gap-2">
<input name="search" type="search" class="grow" placeholder="Suche" />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="h-4 w-4 opacity-70">
<path
fill-rule="evenodd"
d="M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"
clip-rule="evenodd" />
</svg>
</label>
</form>
</div>
</div>
</nav>
<div class="container mx-auto px-4 mt-28">
{{ template "content" . }}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/unpoly@3.9.5/unpoly.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
</body>
</html>
{{ end }}