package web import "fmt" import "strconv" import "strings" import "time" import "net/http" import "github.com/invopop/ctxi18n/i18n" import "git.arav.su/Arav/justguestbook" import "git.arav.su/Arav/dwelling-home/pkg/util" templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCount, pageCur int64, r *http.Request) { @base(i18n.T(ctx, "base.section.guestbook"), i18n.T(ctx, "guestbook.description"), "guestbook, personal", "/guestbook", r, guestbookHead()) {

@templ.Raw(i18n.T(ctx, "guestbook.form.quote-usage", i18n.M{"sign":">"}))
CAPTCHA @templ.Raw(i18n.T(ctx, "guestbook.form.captcha-validity", i18n.M{"valid":"10"}))
for _, entry := range entries {
{{ created_tz := util.ToClientTimezone(entry.Created, r).Format("Monday _2 January 2006 15:04:05 -07:00") }} {{ website := "" }} if !entry.HideWebsite { {{ website = entry.Website }} } { strconv.FormatInt(entry.ID, 10) } { i18n.T(ctx, "guestbook.post.by") } { entry.Name } { website } { i18n.T(ctx, "guestbook.post.on") }
for _, line := range strings.Split(entry.Message, "\n") {

0 && line[0] == '>' { class="quote" }>{ line }

} if entry.Reply != nil {
{{ reply_created_tz := util.ToClientTimezone(entry.Reply.Created, r).Format("Monday _2 January 2006 15:04:05 -07:00") }} { i18n.T(ctx, "guestbook.post.reply") } { owner } { i18n.T(ctx, "guestbook.post.on") }
for _, line := range strings.Split(entry.Reply.Message, "\n") {

0 && line[0] == '>' { class="quote" }>@templ.Raw(line)

}
}
} if len(entries) == 0 {

{ i18n.T(ctx, "guestbook.post.no-posts") }

}
if pageCount > 1 {
for n := int64(1); n <= pageCount; n++ { {{ strN := strconv.FormatInt(n, 10) }} if n == pageCur {  { strN } {{ continue }} } }