Work on making partials for views

This commit is contained in:
mitteneer 2025-05-08 18:17:45 -04:00
parent 4758885c68
commit 153ea869e0
9 changed files with 102 additions and 132 deletions

View file

@ -1,3 +1,8 @@
@zig {
const ColumnChoices = []const enum{song, album, artist, artistlist, scrobbles, date};
const columns: ColumnChoices = &.{.song, .scrobbles};
}
<html>
<head>
<meta charset="UTF-8">
@ -5,15 +10,6 @@
<body>
@partial partials/header
<h1>{{.album}}</h1>
<table>
<tr>
<th>Name</th>
@for (.songs) |song| {
<tr>
<td class=cell><a href="/songs/{{song.url}}">{{song.name}}</a></td>
<td class=cell>{{song.scrobbles}}</td>
</tr>
}
</table>
@partial partials/newtable(T: ColumnChoices, table_data: .songs, columns: columns)
</body>
</html>