feat(book-detail): wire metadata editor button and add format-group data attr

- Replace showMetadataEditorPlaceholder() toast with showMetadataEditor()
  that opens the metadata editor modal
- Add data-format-group attribute to body for client-side cover generation
- Include @MetadataEditorModal(book) in the page modals section
This commit is contained in:
2026-05-10 11:53:11 -04:00
parent 1ae9e08f43
commit 4a26e79a20
2 changed files with 452 additions and 427 deletions
+10 -2
View File
@@ -19,8 +19,15 @@ templ BookDetail(user User, book handlers.MediaDetail, errorMessage string) {
<script src="/static/htmx.min.js"></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body x-data="bookDetail" class="theme-{ user.Theme }">
<body x-data="bookDetail" class="theme-{ user.Theme }" data-format-group={ book.FormatGroup }>
@Header(user, "/media/{ uuidToString(book.ID) }")
<div class="sticky top-0 z-40 bg-opacity-95 backdrop-blur border-b" style="background-color: var(--bg-primary);">
<div class="w-full px-4 py-3 flex items-center gap-4">
<a id="back-link" href="/dashboard" class="text-sm hover:opacity-80 transition-opacity" style="color: var(--text-secondary); text-decoration: none;">
Back
</a>
</div>
</div>
<div class="xs:w-full md:mx-auto md:container px-4 sm:px-6 lg:px-8 py-8">
<!-- Top Section: Cover + Basic Info + Actions -->
<div class="flex flex-col md:flex-row gap-8 mb-8">
@@ -88,7 +95,7 @@ templ BookDetail(user User, book handlers.MediaDetail, errorMessage string) {
</button>
<!-- Edit Metadata (placeholder) -->
<button
@click="showMetadataEditorPlaceholder()"
@click="showMetadataEditor()"
class="px-6 py-3 rounded-lg border"
style="border-color: var(--border); color: var(--text-primary); background-color: var(--bg-secondary);"
>
@@ -506,6 +513,7 @@ templ BookDetail(user User, book handlers.MediaDetail, errorMessage string) {
<!-- Modals -->
@ProgressSyncModal(user, book)
@NotesHighlightsModal(book)
@MetadataEditorModal(book)
@ErrorToast(errorMessage)
</body>
</html>
File diff suppressed because it is too large Load Diff