mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
59 lines
1.2 KiB
Plaintext
59 lines
1.2 KiB
Plaintext
package main
|
|
|
|
import "html/template"
|
|
|
|
type NotePageParams struct {
|
|
BaseEventPageParams
|
|
OpenGraphParams
|
|
HeadParams
|
|
|
|
Details DetailsParams
|
|
Content template.HTML
|
|
Cover string
|
|
Subject string
|
|
TitleizedContent string
|
|
Clients []ClientReference
|
|
}
|
|
|
|
templ noteInnerBlock(params NotePageParams) {
|
|
if params.Event.subject != "" {
|
|
<h1 class="text-2xl" itemprop="headline">{ params.Event.subject }</h1>
|
|
} else {
|
|
<h1 class="hidden">
|
|
{ params.Event.author.ShortName() } on Nostr: { params.TitleizedContent }
|
|
</h1>
|
|
}
|
|
if params.Cover != "" {
|
|
<img src={ params.Cover } alt={ params.Alt } class="mt-1"/>
|
|
}
|
|
<!-- main content -->
|
|
<div dir="auto" class="leading-6" itemprop="articleBody">
|
|
@templ.Raw(params.Content)
|
|
</div>
|
|
}
|
|
|
|
templ noteTemplate(params NotePageParams, isEmbed bool) {
|
|
<!DOCTYPE html>
|
|
if isEmbed {
|
|
@embeddedPageTemplate(
|
|
params.Event,
|
|
params.NeventNaked,
|
|
isEmbed,
|
|
) {
|
|
@noteInnerBlock(params)
|
|
}
|
|
} else {
|
|
@eventPageTemplate(
|
|
params.TitleizedContent,
|
|
params.OpenGraphParams,
|
|
params.HeadParams,
|
|
params.Clients,
|
|
params.Details,
|
|
params.Event,
|
|
isEmbed,
|
|
) {
|
|
@noteInnerBlock(params)
|
|
}
|
|
}
|
|
}
|