style rewrite

This commit is contained in:
bronku 2026-06-10 20:42:06 +02:00
parent 8c7067d5d9
commit 7c756e87c1
8 changed files with 737 additions and 376 deletions

View file

@ -1,16 +1,32 @@
<header> <!doctype html>
<h1>Login</h1> <html lang="en">
</header> <head>
<main> <meta charset="UTF-8" />
<title>Login</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="/static/fontawesome/css/fontawesome.min.css">
<link rel="stylesheet" href="/static/fontawesome/css/solid.css">
</head>
<body class="login-page">
<div class="login-card">
<div class="login-icon">
<i class="fa-solid fa-birthday-cake"></i>
</div>
<h1>Zaloguj się</h1>
<form method="post"> <form method="post">
<label>Login</label>
<label> <label>
<span>Login</span>
<input type="text" name="login" /> <input type="text" name="login" />
</label> </label>
<label>Password</label>
<label> <label>
<span>Hasło</span>
<input type="password" name="password" /> <input type="password" name="password" />
</label> </label>
<button type="submit">login</button> <button type="submit">Zaloguj się</button>
</form> </form>
</main> </div>
</body>
</html>

View file

@ -86,6 +86,7 @@ func (h *Server) order(r *http.Request) (any, int, error) {
url := strings.Split(r.URL.String(), "/") url := strings.Split(r.URL.String(), "/")
if len(url) < 3 || url[2] == "" { if len(url) < 3 || url[2] == "" {
data.Order.Date = time.Now()
return data, http.StatusOK, nil return data, http.StatusOK, nil
} }

View file

@ -1,18 +1,26 @@
:root { :root {
--primary-color: #ff6b6b; --surface: #fff8f0;
--primary-light: #ffeded; --surface-container-low: #faf3e7;
--primary-dark: #e64c4c; --surface-container-highest: #eae2d2;
--text-color: #333333; --primary: #8c4d50;
--text-light: #666666; --primary-container: #fcacaf;
--background-color: #f8f9fa; --primary-hover: #7a3f42;
--white: #ffffff; --on-background: #363227;
--border-color: #e4e9ec; --on-surface: #363227;
--hover-color: #f5f5f5; --on-surface-variant: #645f52;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1); --outline-variant: #b9b1a3;
--bottom-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1); --secondary-container: #e0f5cb;
--font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; --on-secondary-container: #4c5e3e;
--nav-height: 4rem;
--border-radius: 48px;
--small-radius: 24px;
--small-border-radius: 8px;
--max-content-width: 80rem;
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
--transition: 0.2s ease; --transition: 0.2s ease;
--radius: 6px; --transition-slow: 0.3s ease;
} }
* { * {
@ -22,26 +30,42 @@
} }
body { body {
font-family: var(--font-main); font-family: "Plus Jakarta Sans", sans-serif;
color: var(--text-color); color: var(--on-background);
background-color: var(--background-color); background-color: var(--surface);
display: flex; display: flex;
width: 100%; width: 100%;
line-height: 1.6; line-height: 1.6;
} }
/* Sidebar */ @keyframes fadeInUp {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideDown {
from { opacity: 0; max-height: 0; }
to { opacity: 1; max-height: 500px; }
}
aside { aside {
min-width: 4.5rem; min-width: 5rem;
max-width: 4.5rem; max-width: 5rem;
background-color: var(--primary-color); background-color: var(--surface-container-low);
height: 100vh; height: 100vh;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
border-right: 1px solid var(--border-color); box-shadow: var(--shadow-md);
box-shadow: var(--shadow);
z-index: 10; z-index: 10;
border-radius: 0 var(--small-radius) var(--small-radius) 0;
border-right: 1px solid var(--outline-variant);
animation: fadeIn 0.3s ease;
} }
nav { nav {
@ -49,233 +73,332 @@ nav {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-top: 2rem; padding-top: 2rem;
gap: 1.5rem; gap: 0.5rem;
height: 100%; height: 100%;
} }
nav>a { nav > a {
color: var(--white); color: var(--on-surface-variant);
text-decoration: none; text-decoration: none;
font-size: 1.5rem; font-size: 1.3rem;
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 50%; border-radius: var(--small-border-radius);
transition: background-color var(--transition); transition: all var(--transition);
position: relative; position: relative;
} }
nav>a:hover { nav > a:hover {
background-color: var(--primary-dark); background-color: var(--primary-container);
color: var(--primary);
transform: scale(1.1);
} }
nav>a:last-child { nav > a:active {
transform: scale(0.95);
}
nav > a:last-child {
margin-top: auto; margin-top: auto;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
nav>a>i { nav > a > i {
text-decoration: none; text-decoration: none;
color: var(--white); color: inherit;
} }
/* Tooltip for sidebar icons */ nav > a::after {
nav>a::after {
content: attr(data-title); content: attr(data-title);
position: absolute; position: absolute;
left: 120%; left: 120%;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
background-color: var(--text-color); background-color: var(--on-background);
color: var(--white); color: var(--surface);
padding: 0.3rem 0.8rem; padding: 0.4rem 0.8rem;
border-radius: var(--radius); border-radius: var(--small-border-radius);
font-size: 0.8rem; font-size: 0.8rem;
font-weight: 500;
white-space: nowrap; white-space: nowrap;
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition: opacity var(--transition); transition: all var(--transition-slow);
z-index: 1; z-index: 1;
box-shadow: var(--shadow-sm);
} }
nav>a:hover::after { nav > a:hover::after {
opacity: 1; opacity: 1;
left: 130%;
} }
/* Main content area */
.app-body { .app-body {
flex: 1; flex: 1;
margin-left: 4.5rem; margin-left: 5rem;
padding: 0; padding: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100dvh; height: 100dvh;
overflow-x: hidden; overflow-x: hidden;
animation: fadeInUp 0.35s ease;
} }
header { header {
background-color: var(--white); background-color: var(--surface);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--outline-variant);
padding: 1rem 2rem; padding: 1rem 2rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 5; z-index: 5;
transition: box-shadow var(--transition);
} }
h1 { header h1 {
font-size: 1.8rem; font-family: "Plus Jakarta Sans", sans-serif;
font-weight: 600; font-size: 1.5rem;
color: var(--primary-color); font-weight: 700;
color: var(--on-background);
letter-spacing: -0.02em;
} }
main { main {
flex: 1; flex: 1;
padding: 2rem; padding: 1.5rem 2rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; gap: 0.75rem;
gap: 1.5rem; overflow-y: auto;
overflow: hidden; min-height: 0;
max-width: var(--max-content-width);
width: 100%;
margin: 0 auto;
}
.toolbar {
display: flex;
gap: 0.75rem;
align-items: center;
flex-wrap: wrap;
} }
/* Search form */
.search-container { .search-container {
background-color: var(--white); background-color: var(--surface);
border-radius: var(--radius); border: 1px solid var(--outline-variant);
padding: 1.25rem; border-radius: var(--small-radius);
padding: 1rem 1.25rem;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1rem; gap: 0.75rem;
align-items: flex-end; align-items: flex-end;
box-shadow: var(--shadow); box-shadow: var(--shadow-sm);
transition: box-shadow var(--transition);
}
.search-container:hover {
box-shadow: var(--shadow-md);
} }
.search-box { .search-box {
flex: 1; flex: 1;
min-width: 250px; min-width: 200px;
position: relative; position: relative;
} }
.search-box input { .search-box input {
width: 100%; width: 100%;
padding: 0.75rem 1rem 0.75rem 2.5rem; padding: 0.5rem 1rem 0.5rem 2.5rem;
border: 1px solid var(--border-color); border: 1px solid var(--outline-variant);
border-radius: var(--radius); border-radius: var(--small-border-radius);
font-size: 1rem; font-size: 0.85rem;
transition: border-color var(--transition); font-family: inherit;
background-color: var(--surface);
color: var(--on-surface);
transition: all var(--transition);
}
.search-box input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(140, 77, 80, 0.12);
} }
.search-box::before { .search-box::before {
content: "🔍"; content: "\f002";
font-family: "Font Awesome 6 Free";
font-weight: 900;
position: absolute; position: absolute;
left: 1rem; left: 1rem;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
color: var(--text-light); color: var(--on-surface-variant);
font-size: 0.8rem;
pointer-events: none;
} }
.search-container label:not(.search-box) { .search-container label:not(.search-box) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.3rem;
font-size: 0.9rem; font-size: 0.75rem;
color: var(--text-light); font-weight: 600;
color: var(--on-surface-variant);
} }
.search-container input[type="date"] { .search-container input[type="date"] {
padding: 0.75rem; padding: 0.5rem 0.75rem;
border: 1px solid var(--border-color); border: 1px solid var(--outline-variant);
border-radius: var(--radius); border-radius: var(--small-border-radius);
min-width: 160px; min-width: 140px;
font-family: inherit;
font-size: 0.8rem;
background-color: var(--surface);
color: var(--on-surface);
transition: all var(--transition);
} }
.search-container input:focus { .search-container input[type="date"]:focus {
outline: none; outline: none;
border-color: var(--primary-color); border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1); box-shadow: 0 0 0 3px rgba(140, 77, 80, 0.12);
}
.btn-primary {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.55rem 1.3rem;
background-color: var(--primary);
color: #fff;
border: none;
border-radius: var(--border-radius);
font-size: 0.85rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
text-decoration: none;
transition: all var(--transition);
white-space: nowrap;
}
.btn-primary:hover {
background-color: var(--primary-hover);
color: #fff;
transform: scale(1.02);
}
.btn-primary:active {
transform: scale(0.97);
} }
/* Table styling */
#results-table { #results-table {
background-color: var(--white); background-color: var(--surface);
border-radius: var(--radius); border: 1px solid var(--outline-variant);
box-shadow: var(--shadow); border-radius: var(--small-radius);
/* overflow: hidden; */ box-shadow: var(--shadow-sm);
margin-top: 1rem; overflow: hidden;
transition: box-shadow var(--transition);
}
#results-table:hover {
box-shadow: var(--shadow-md);
} }
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
font-size: 0.95rem; font-size: 0.85rem;
} }
thead { thead {
border-bottom: 1px solid var(--border-color); border-bottom: 2px solid var(--outline-variant);
background-color: var(--white); background-color: var(--surface-container-low);
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1; z-index: 1;
box-shadow: 0 2px 0 var(--border-color);
}
tbody th {
font-weight: 300;
color: var(--text-color);
} }
thead th { thead th {
color: var(--text-light); color: var(--on-surface-variant);
font-weight: 100; font-weight: 600;
font-size: rem; font-size: 0.7rem;
font-size: 0.8rem; text-transform: uppercase;
/* box-shadow: var(--bottom-shadow); */ letter-spacing: 0.05em;
padding: 0.75rem 1rem;
} }
tbody th {
font-weight: 400;
color: var(--on-surface);
}
th { th {
text-align: left; text-align: left;
padding: 1rem; padding: 0.75rem 1rem;
/* color: var(--primary-dark); */
} }
td { td {
padding: 1rem; padding: 0.75rem 1rem;
} }
th:first-child, th:first-child,
td:first-child { td:first-child {
padding-left: 1.5rem; padding-left: 1.25rem;
} }
th:last-child, th:last-child,
td:last-child { td:last-child {
padding-right: 1.5rem; padding-right: 1.25rem;
}
tr {
transition: background-color var(--transition);
} }
tr.clickable { tr.clickable {
cursor: pointer; cursor: pointer;
transition: background-color var(--transition);
} }
tr.clickable:hover { tr.clickable:hover {
background-color: var(--hover-color); background-color: var(--surface-container-low);
} }
tr.active { tr.active {
background-color: var(--primary-light); background-color: var(--primary-container);
}
tr:not(:last-child) {
border-bottom: 1px solid var(--outline-variant);
}
.status-badge {
display: inline-block;
padding: 0.15rem 0.55rem;
border-radius: 999px;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.status-accepted {
background-color: #fff3e0;
color: #e65100;
}
.status-done {
background-color: #e8f5e9;
color: #2e7d32;
} }
/* Order details */
.details-content { .details-content {
background-color: var(--hover-color); background-color: var(--surface-container-low);
padding: 0 !important; padding: 0 !important;
} }
@ -286,53 +409,110 @@ tr.active {
.details-content th { .details-content th {
background-color: transparent; background-color: transparent;
font-weight: normal; font-weight: 500;
} }
/* Links */
a { a {
text-decoration: none; text-decoration: none;
color: var(--text-light); color: var(--on-surface-variant);
transition: color var(--transition);
}
a:hover {
color: var(--primary);
} }
tr a { tr a {
text-decoration: none;
font-weight: 600;
color: var(--primary);
}
tr a:hover {
text-decoration: underline; text-decoration: underline;
color: var(--primary-color);
} }
.order { .order {
flex-grow: 1; display: grid;
display: flex; grid-template-columns: 1fr 1fr;
flex-direction: row; gap: 0.75rem;
width: 100%; width: 100%;
padding: 1.5rem; align-content: start;
background-color: var(--white);
border-radius: var(--radius);
box-shadow: var(--shadow);
height: 100%;
} }
.order div { .order > div {
flex-grow: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.65rem;
background-color: var(--surface);
border: 1px solid var(--outline-variant);
border-radius: var(--small-border-radius);
padding: 1rem 1.25rem;
transition: box-shadow var(--transition);
} }
.order>div { .order > div:hover {
flex-basis: 0; box-shadow: var(--shadow-sm);
flex-shrink: 0;
} }
.order-contents>*:first-child, .order > div:last-child:nth-child(odd) {
.order-contents>*:last-child { grid-column: 1 / -1;
flex-grow: 0;
} }
.order label { .order label {
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
flex-direction: row; gap: 0.2rem;
align-items: center; font-size: 0.75rem;
font-weight: 600;
color: var(--on-surface-variant);
}
input, select {
padding: 0.45rem 0.7rem;
border: 1px solid var(--outline-variant);
border-radius: var(--small-border-radius);
font-size: 0.85rem;
font-family: inherit;
background-color: var(--surface);
color: var(--on-surface);
transition: all var(--transition);
}
input:focus, select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(140, 77, 80, 0.12);
}
button[type="submit"] {
padding: 0.5rem 1.5rem;
background-color: var(--primary);
color: #fff;
border: none;
border-radius: var(--border-radius);
font-size: 0.85rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: all var(--transition);
align-self: flex-start;
}
button[type="submit"]:hover {
background-color: var(--primary-hover);
transform: scale(1.02);
}
button[type="submit"]:active {
transform: scale(0.97);
}
.order h2 {
font-size: 1rem;
font-weight: 700;
color: var(--on-background);
letter-spacing: -0.01em;
} }
.scrollable { .scrollable {
@ -340,20 +520,162 @@ tr a {
min-height: 0; min-height: 0;
} }
/* Responsive adjustments */ #basket_table button, .order table button {
padding: 0.3rem 0.5rem;
background-color: var(--primary-container);
color: var(--primary);
border: none;
border-radius: var(--small-border-radius);
cursor: pointer;
font-size: 0.75rem;
transition: all var(--transition);
}
#basket_table button:hover, .order table button:hover {
background-color: var(--primary);
color: #fff;
transform: scale(1.05);
}
#basket_table button:active, .order table button:active {
transform: scale(0.95);
}
#total-price {
font-size: 1.2rem;
font-weight: 700;
color: var(--primary);
}
.order table {
font-size: 0.8rem;
}
.order table th {
padding: 0.35rem 0.5rem;
}
.htmx-request {
opacity: 0.7;
pointer-events: none;
transition: opacity var(--transition);
}
.login-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 100dvh;
background-color: var(--surface-container-low);
}
.login-card {
background-color: var(--surface);
border: 1px solid var(--outline-variant);
border-radius: var(--small-radius);
padding: 2.5rem;
box-shadow: var(--shadow-lg);
width: 100%;
max-width: 26rem;
position: relative;
overflow: hidden;
}
.login-card::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, var(--primary), var(--primary-container));
}
.login-icon {
display: flex;
justify-content: center;
margin-bottom: 1.5rem;
font-size: 2.5rem;
color: var(--primary);
}
.login-card h1 {
font-family: "Plus Jakarta Sans", sans-serif;
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
color: var(--on-background);
text-align: center;
letter-spacing: -0.02em;
}
.login-card form {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.login-card label {
display: flex;
flex-direction: column;
gap: 0.35rem;
font-size: 0.85rem;
font-weight: 600;
color: var(--on-surface-variant);
}
.login-card button {
padding: 0.75rem 2rem;
background-color: var(--primary);
color: #fff;
border: none;
border-radius: var(--border-radius);
font-size: 1rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: all var(--transition);
margin-top: 0.5rem;
}
.login-card button:hover {
background-color: var(--primary-hover);
transform: scale(1.02);
}
.login-card button:active {
transform: scale(0.97);
}
@media (max-width: 1024px) {
.order {
grid-template-columns: 1fr;
}
.order > div:last-child:nth-child(odd) {
grid-column: 1;
}
}
@media (max-width: 768px) { @media (max-width: 768px) {
.toolbar {
flex-direction: column;
align-items: stretch;
}
.search-container { .search-container {
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
} }
.search-container>* { .search-container > * {
width: 100%; width: 100%;
} }
aside { aside {
min-width: 3.5rem; min-width: 3.5rem;
max-width: 3.5rem; max-width: 3.5rem;
border-radius: 0 var(--small-border-radius) var(--small-border-radius) 0;
} }
.app-body { .app-body {
@ -363,6 +685,22 @@ tr a {
nav a { nav a {
width: 2.5rem; width: 2.5rem;
height: 2.5rem; height: 2.5rem;
font-size: 1.2rem; font-size: 1.1rem;
}
main {
padding: 1rem;
}
header {
padding: 0.75rem 1rem;
}
header h1 {
font-size: 1.15rem;
}
.order > div {
padding: 0.85rem 1rem;
} }
} }

View file

@ -1,36 +1,34 @@
{{define "title"}} {{define "title"}}
Cake {{.ID}} Ciasto {{if .ID}}#{{.ID}}{{else}}nowe{{end}}
{{end}} {{end}}
{{define "main"}} {{define "main"}}
<main> <main>
<form method="post"> <form method="post" class="order">
<div> <div>
<h2>Info</h2> <h2>Informacje o cieście</h2>
<label>
<input hidden="hidden" name="id" value="{{.ID}}"> <input hidden="hidden" name="id" value="{{.ID}}">
</label> <label>Nazwa
<label>name</label>
<label>
<input type="text" name="name" value="{{.Name}}"> <input type="text" name="name" value="{{.Name}}">
</label> </label>
<label>price</label> <label>Cena (gr)
<label>
<input type="number" name="price" min="0" value="{{.Price}}"> <input type="number" name="price" min="0" value="{{.Price}}">
</label> </label>
<label>category</label> <label>Kategoria
<label for="category"></label><select name="category" id="category" > <select name="category" id="category">
<option {{ if eq .Category "common" }}selected{{ end }} value="common">common</option> <option {{ if eq .Category "common" }}selected{{ end }} value="common">common</option>
<option {{ if eq .Category "christmas" }}selected{{ end }} value="christmas">christmas</option> <option {{ if eq .Category "christmas" }}selected{{ end }} value="christmas">christmas</option>
<option {{ if eq .Category "easter" }}selected{{ end }} value="easter">easter</option> <option {{ if eq .Category "easter" }}selected{{ end }} value="easter">easter</option>
<option {{ if eq .Category "donuts" }}selected{{ end }} value="donuts">donuts</option> <option {{ if eq .Category "donuts" }}selected{{ end }} value="donuts">donuts</option>
</select> </select>
<label>availability</label> </label>
<label for="availability"></label><select name="availability" id="availability" > <label>Dostępność
<option {{ if eq .Availability "available" }}selected{{ end }} value="available">available</option> <select name="availability" id="availability">
<option {{ if eq .Availability "unavailable" }}selected{{ end }} value="unavailable">unavailable</option> <option {{ if eq .Availability "available" }}selected{{ end }} value="available">dostępne</option>
<option {{ if eq .Availability "unavailable" }}selected{{ end }} value="unavailable">niedostępne</option>
</select> </select>
</label>
<button type="submit">Zapisz ciasto</button>
</div> </div>
<button type="submit">submit</button>
</form> </form>
</main> </main>
{{end}} {{end}}

View file

@ -1,25 +1,37 @@
{{define "title"}} {{define "title"}}
Cakes Ciasta
{{end}} {{end}}
{{define "main"}} {{define "main"}}
<main> <main>
<div class="toolbar">
<a href="/cake" class="btn-primary">
<i class="fa-solid fa-plus"></i>
Nowe ciasto
</a>
</div>
<div id="results-table" class="scrollable">
<table> <table>
<thead>
<tr> <tr>
<th></th> <th></th>
<th>Name</th> <th>Nazwa</th>
<th>Price</th> <th>Cena</th>
<th>Category</th> <th>Kategoria</th>
<th>Availability</th> <th>Dostępność</th>
</tr> </tr>
</thead>
<tbody>
{{range .}} {{range .}}
<tr> <tr>
<th><a href="/cake/{{.ID}}">edit</a></th> <th><a href="/cake/{{.ID}}">Edytuj</a></th>
<th>{{.Name}}</th> <th>{{.Name}}</th>
<th>{{.Price}}</th> <th>{{.Price}} PLN</th>
<th>{{.Category}}</th> <th>{{.Category}}</th>
<th>{{.Availability}}</th> <th>{{.Availability}}</th>
</tr> </tr>
{{end}} {{end}}
</tbody>
</table> </table>
</div>
</main> </main>
{{end}} {{end}}

View file

@ -5,6 +5,9 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>{{template "title" .}}</title> <title>{{template "title" .}}</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="/static/htmx2.04.js" defer></script> <script src="/static/htmx2.04.js" defer></script>
<script src="/static/order.js" ></script> <script src="/static/order.js" ></script>
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="/static/style.css">

View file

@ -9,12 +9,9 @@
<main> <main>
<form method="post" class="order"> <form method="post" class="order">
{{with .Order}} {{with .Order}}
<div class="order-contents">
<div> <div>
<h2>Dane zamówienia</h2> <h2>Dane zamówienia</h2>
<label>
<input hidden="hidden" name="id" value="{{.ID}}"> <input hidden="hidden" name="id" value="{{.ID}}">
</label>
<label>Imię <label>Imię
<input type="text" name="name" value="{{.Name}}"> <input type="text" name="name" value="{{.Name}}">
</label> </label>
@ -44,33 +41,32 @@
</label> </label>
</div> </div>
<div> <div>
<h2>Dodane Ciasta</h2> <h2>Dodane ciasta</h2>
<div class="scrollable"> <div class="scrollable" style="flex:1">
<table id="basket_table" > <table id="basket_table">
</table> </table>
</div> </div>
<ul id="basket" class="scrollable"> <ul id="basket" class="scrollable">
</ul> </ul>
</div> </div>
<div> <div>
<h2>Podsumowanie</h2>
<label> <label>
<small>Total:</small><br> <small>Do zapłaty:</small>
<p id="total-price">100PLN</p> <span id="total-price">100 PLN</span>
</label> </label>
<button type="submit">Zapisz</button> <button type="submit">Zapisz</button>
</div> </div>
</div>
{{end}} {{end}}
{{with .Catalogue}} {{with .Catalogue}}
<div> <div class="catalog-section">
<h2>Katalog</h2> <h2>Katalog</h2>
<div class="scrollable"> <div class="scrollable">
<table> <table>
{{range .}} {{range .}}
<tr> <tr>
<th>{{.Name}}<br><small>{{.Category}} (#{{.ID}})</small></th> <th>{{.Name}}<br><small>{{.Category}} (#{{.ID}})</small></th>
<th>{{.Price}}PLN</th> <th>{{.Price}} PLN</th>
<th> <th>
<button type=button onClick="addCake({{.ID}},{{.Name}}, {{.Price}}, 1)"> <button type=button onClick="addCake({{.ID}},{{.Name}}, {{.Price}}, 1)">
<i class="fa-solid fa-plus"></i> <i class="fa-solid fa-plus"></i>

View file

@ -3,6 +3,12 @@ Zamówienia
{{end}} {{end}}
{{define "main"}} {{define "main"}}
<main> <main>
<div class="toolbar">
<a href="/order" class="btn-primary">
<i class="fa-solid fa-plus"></i>
Nowe zamówienie
</a>
</div>
<form class="search-container" hx-get="/orders/search" hx-target="#results-table" <form class="search-container" hx-get="/orders/search" hx-target="#results-table"
hx-trigger="keyup delay:500ms, change"> hx-trigger="keyup delay:500ms, change">
<label>Data początkowa <label>Data początkowa
@ -16,15 +22,6 @@ Zamówienia
{{template "orders-table" .Orders}} {{template "orders-table" .Orders}}
</div> </div>
</main> </main>
<style>
.hidden {
display: none;
}
.active {
background-color: #e6f2ff;
}
</style>
{{end}} {{end}}
{{define "orders-table"}} {{define "orders-table"}}
<table id="orders_table"> <table id="orders_table">
@ -46,9 +43,9 @@ Zamówienia
<th>{{.Location}}</th> <th>{{.Location}}</th>
<th>{{.Date.Format "2006-01-02"}}</th> <th>{{.Date.Format "2006-01-02"}}</th>
<th>{{.Total}} PLN</th> <th>{{.Total}} PLN</th>
<th>{{.Status}}</th> <th><span class="status-badge status-{{.Status}}">{{.Status}}</span></th>
</tr> </tr>
<tr class="hidden"> <tr class="hidden details-row">
<td colspan="6" class="details-content"> <td colspan="6" class="details-content">
{{template "order_info" .}} {{template "order_info" .}}
</td> </td>