-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlayout.html
More file actions
137 lines (116 loc) · 3.63 KB
/
layout.html
File metadata and controls
137 lines (116 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Product Catalog{% endblock %}</title>
<!-- Pico CSS (semantic, classless framework) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
<!-- HTMX 2.x -->
<script src="https://unpkg.com/htmx.org@2.0.8"></script>
<style>
/* Minimal custom CSS - let Pico handle most styling */
:root {
--pico-form-element-spacing-vertical: 0.35rem;
--pico-form-element-spacing-horizontal: 0.75rem;
--pico-font-size: 1rem;
}
.htmx-indicator {
display: none;
}
.htmx-request .htmx-indicator {
display: inline-block;
}
/* Product grid layout */
.product-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
/* Product cards */
article.product-card {
margin: 0;
}
article.product-card img {
width: 100%;
height: 200px;
object-fit: cover;
margin-bottom: 0;
}
article.product-card footer {
padding: 1rem;
}
.card-flex {
display: flex;
flex-direction: column;
height: 100%;
}
.card-footer-flex {
display: flex;
flex-direction: column;
flex: 1 1 auto;
height: 100%;
}
.card-content-flex {
flex: 1 1 auto;
}
.button-group {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin: 0.5rem 0 0 0;
padding: 0;
min-width: 0;
}
.button-group>* {
flex: 1 1 auto;
min-width: 100px;
margin-bottom: 0;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
}
</style>
{% block head %}{% endblock %}
</head>
<body>
<!-- Navigation - Pico styles nav ul li automatically -->
<nav class="container">
<ul>
<li><strong>🛍️ Product Catalog</strong></li>
</ul>
<ul>
<li><a href="/shop/products">Products</a></li>
<li><a href="/shop/stats">Stats</a></li>
{% if username %}
<li>{{ username }}{% if roles is not empty %} <mark>{{ roles }}</mark>{% endif %}</li>
<li>
<button type="button" class="secondary"
onclick="fetch('/logout', { method: 'POST', credentials: 'include' }).then(() => window.location.href = '/login')">Logout</button>
</li>
{% else %}
<li>
<form action="/login" method="get" style="display:inline;">
<button type="submit" class="secondary">Login</button>
</form>
</li>
{% endif %}
</ul>
</nav>
<!-- Main Content - Pico provides container spacing -->
<main class="container">
{% block main %}{% endblock %}
</main>
<!-- Footer - Pico provides footer styling -->
<footer class="container">
<small>
<strong>Product Catalog</strong> powered by <a href="https://github.com/SoftInstigate/facet">Facet</a> ·
Example Application
</small>
</footer>
{% block script %}{% endblock %}
</body>
</html>