fix(templates): use expression attributes and fix indentation
Convert string-interpolation attributes (value="{ x }") to templ
expression attributes (value={ x }) for IDs, paths, and titles, and
fix indentation in header.templ and progress.templ.
This commit is contained in:
+11
-11
@@ -33,7 +33,7 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag
|
||||
<div class="flex gap-6">
|
||||
<div class="flex-shrink-0">
|
||||
<img
|
||||
src="{ item.CoverImagePath }"
|
||||
src={ item.CoverImagePath }
|
||||
alt="Cover"
|
||||
class="w-24 h-32 object-cover rounded"
|
||||
onerror="this.src='/static/placeholder-book.svg'"
|
||||
@@ -63,18 +63,18 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Current Position</p>
|
||||
<p style="color: var(--text-primary)">
|
||||
if item.FormatGroup == "reflowable" {
|
||||
if item.EstimatedPages > 0 {
|
||||
{ fmt.Sprintf("Page %d of %d (est.)", item.CurrentPage, item.EstimatedPages) }
|
||||
<p style="color: var(--text-secondary)">Current Position</p>
|
||||
<p style="color: var(--text-primary)">
|
||||
if item.FormatGroup == "reflowable" {
|
||||
if item.EstimatedPages > 0 {
|
||||
{ fmt.Sprintf("Page %d of %d (est.)", item.CurrentPage, item.EstimatedPages) }
|
||||
} else {
|
||||
{ fmt.Sprintf("%.1f%%", item.ProgressPercentage) }
|
||||
}
|
||||
} else {
|
||||
{ fmt.Sprintf("%.1f%%", item.ProgressPercentage) }
|
||||
{ fmt.Sprintf("%d / %d", item.CurrentPage, item.TotalPages) }
|
||||
}
|
||||
} else {
|
||||
{ fmt.Sprintf("%d / %d", item.CurrentPage, item.TotalPages) }
|
||||
}
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Last Updated</p>
|
||||
|
||||
Reference in New Issue
Block a user