diff --git a/contrib/backends/srndv2/src/srnd/model.go b/contrib/backends/srndv2/src/srnd/model.go index 30eee2f..a177f85 100644 --- a/contrib/backends/srndv2/src/srnd/model.go +++ b/contrib/backends/srndv2/src/srnd/model.go @@ -47,6 +47,7 @@ type AttachmentModel interface { type PostModel interface { BaseModel + Brief() string CSSClass() string FrontendPubkey() string MessageID() string diff --git a/contrib/backends/srndv2/src/srnd/model_mem.go b/contrib/backends/srndv2/src/srnd/model_mem.go index 6a09ae5..37ebfcd 100644 --- a/contrib/backends/srndv2/src/srnd/model_mem.go +++ b/contrib/backends/srndv2/src/srnd/model_mem.go @@ -305,6 +305,13 @@ func (self *post) Index() int { return self.index + 1 } +func (self *post) Brief() string { + if len(self.PostMessage) > 140 { + return self.PostMessage[:140] + } + return self.PostMessage +} + func (self *post) NumImages() int { return len(self.Files) } diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index c9b4766..34e6ebb 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -24,16 +24,17 @@ - + {{#sfw}} {{/sfw}} {{^sfw}} {{/sfw}} - - + {{#thread.OP.Attachments}} + + {{/thread.OP.Attachments}} + {{{thread.Navbar}}}