From 9c3bee8a7d57df5dac005f1a6e8245a574d8c46c Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Wed, 2 Oct 2019 13:19:02 -0700 Subject: [PATCH] add dates to posts on collections w/ blog format --- posts.go | 2 ++ templates/chorus-collection-post.tmpl | 14 +++++++++----- templates/collection-post.tmpl | 24 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/posts.go b/posts.go index 88730f7..e0d7f2e 100644 --- a/posts.go +++ b/posts.go @@ -1380,12 +1380,14 @@ Are you sure it was ever here?`, IsFound bool IsAdmin bool CanInvite bool + ShowDates bool }{ PublicPost: p, StaticPage: pageForReq(app, r), IsOwner: cr.isCollOwner, IsCustomDomain: cr.isCustomDomain, IsFound: postFound, + ShowDates: c.NewFormat().ShowDates(), } tp.IsAdmin = u != nil && u.IsAdmin() tp.CanInvite = canUserInvite(app.cfg, tp.IsAdmin) diff --git a/templates/chorus-collection-post.tmpl b/templates/chorus-collection-post.tmpl index bab2e31..cda4292 100644 --- a/templates/chorus-collection-post.tmpl +++ b/templates/chorus-collection-post.tmpl @@ -38,15 +38,15 @@ body footer { body#post header { padding: 1em 1rem; } -article time.dt-published { +article time.dt { display: block; +} +article time.dt.published { color: #666; + margin-bottom: 1em; } body#post article h2#title{ margin-bottom: 0.5em; -} -article time.dt-published { - margin-bottom: 1em; } @@ -65,7 +65,11 @@ article time.dt-published { {{template "user-navigation" .}} -
{{if .IsScheduled}}

Scheduled

{{end}}{{if .Title.String}}

{{.FormattedDisplayTitle}}

{{end}}{{/* TODO: check format: if .Collection.Format.ShowDates*/}}
{{.HTMLContent}}
+
+ {{if .IsScheduled}}

Scheduled

{{end}} + {{if .Title.String}}

{{.FormattedDisplayTitle}}

{{end}} + {{if .ShowDates}}{{end}} +
{{.HTMLContent}}
{{ if .Collection.ShowFooterBranding }}