From 024f773a7cc60fc16e528d59e2de31cb7c999501 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 9 Mar 2018 07:01:33 -0500 Subject: [PATCH] add bumplock css --- contrib/backends/srndv2/src/srnd/model_mem.go | 4 ++++ contrib/static/krane.css | 5 +++++ contrib/templates/placebo/board.mustache | 6 +++++- contrib/templates/placebo/thread.mustache | 5 ++++- contrib/templates/placebo/ukko.mustache | 6 +++++- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/model_mem.go b/contrib/backends/srndv2/src/srnd/model_mem.go index 827d0ed..1ca0b5b 100644 --- a/contrib/backends/srndv2/src/srnd/model_mem.go +++ b/contrib/backends/srndv2/src/srnd/model_mem.go @@ -731,6 +731,10 @@ func (self *thread) HasOmittedImages() bool { return self.truncatedImageCount > 0 } +func (self *thread) BumpLock() bool { + return len(self.Posts) >= BumpLimit +} + func (self *thread) Update(db Database) { root := self.Posts[0].MessageID() self.Posts = append([]PostModel{self.Posts[0]}, db.GetThreadReplyPostModels(self.prefix, root, 0, 0)...) diff --git a/contrib/static/krane.css b/contrib/static/krane.css index 29daef1..3a10531 100644 --- a/contrib/static/krane.css +++ b/contrib/static/krane.css @@ -528,3 +528,8 @@ background-repeat: repeat; font-weight: bold; margin-left: none; } + +.bumplock { + background: red; + filter: saturate(0.5); +} diff --git a/contrib/templates/placebo/board.mustache b/contrib/templates/placebo/board.mustache index b5661c9..b53f6b9 100644 --- a/contrib/templates/placebo/board.mustache +++ b/contrib/templates/placebo/board.mustache @@ -41,8 +41,12 @@
{{{form}}} {{#board.Threads}} - {{#Truncate}} + {{#BumpLock}} +
+ {{^BumpLock}}
+ {{/BumpLock}} + {{#Truncate}} {{{OP.RenderPost}}}
{{MissingPostCount}} posts excluded
{{#Replies}} diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index 49f3545..cce0ed4 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -39,8 +39,11 @@
{{thread.Board}}

{{{form}}} - + {{#thread.BumpLock}} +
+ {{^thread.BumpLock}}
+ {{/thread.BumpLock}} {{{thread.OP.RenderPost}}} {{#thread.Replies}} {{{RenderPost}}} diff --git a/contrib/templates/placebo/ukko.mustache b/contrib/templates/placebo/ukko.mustache index 002de02..cf08f7a 100644 --- a/contrib/templates/placebo/ukko.mustache +++ b/contrib/templates/placebo/ukko.mustache @@ -45,8 +45,12 @@ {{/next}}
{{#threads}} - {{#Truncate}} + {{#BumpLock}} +
+ {{^BumpLock}}
+ {{/BumpLock}} + {{#Truncate}} Posted on {{Board}}
{{{OP.RenderTruncatedPost}}}