pluralise in views and change omittefimages > omittedfiles

merge-requests/208/head
fatchan 5 years ago
parent 1ab48c5dac
commit f2e105dddc
  1. 8
      db/posts.js
  2. 20
      views/mixins/post.pug
  3. 2
      views/pages/board.pug
  4. 2
      views/pages/manage.pug
  5. 2
      views/pages/thread.pug

@ -61,8 +61,8 @@ module.exports = {
//if enough replies, show omitted count
if (thread.replyposts > 5) {
//dont show ALL backlinks on OP for previews on index page
const firstPreviewId = thread.replies[0].postId; //34
const latestPreviewBacklink = thread.backlinks.find(bl => { return bl.postId >= firstPreviewId }); //post with 34
const firstPreviewId = thread.replies[0].postId;
const latestPreviewBacklink = thread.backlinks.find(bl => { return bl.postId >= firstPreviewId });
if (latestPreviewBacklink != null) {
const latestPreviewIndex = thread.backlinks.map(bl => bl.postId).indexOf(latestPreviewBacklink.postId);
thread.previewbacklinks = thread.backlinks.slice(latestPreviewIndex);
@ -70,8 +70,8 @@ module.exports = {
thread.previewbacklinks = [];
}
//cout omitted image and posts
const numPreviewImages = replies.reduce((acc, post) => { return acc + post.files.length }, 0);
thread.omittedimages = thread.replyfiles - numPreviewImages;
const numPreviewFiles = replies.reduce((acc, post) => { return acc + post.files.length }, 0);
thread.omittedfiles = thread.replyfiles - numPreviewFiles;
thread.omittedposts = thread.replyposts - replies.length;
}
}));

@ -47,11 +47,11 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false)
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename}
br
span
| (#{file.mimetype.split('/')[0]}, #{file.sizeString}, #{file.geometryString}
| (#{file.sizeString}, #{file.geometryString}
if file.durationString
| , #{file.durationString}
| )
.post-file-src
.post-file-src(data-type=file.mimetype.split('/')[0])
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
img.file-thumb(src='/img/spoiler.png' width='128' height='128')
@ -76,18 +76,24 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false)
else
pre.post-message !{post.message}
if !post.message && post.files.length === 0
p Post file(s) unlinked
p Post files unlinked
if post.banmessage
p.banmessage USER BANNED FOR THIS POST (#{post.banmessage || 'No reason specified'})
if post.omittedposts || post.omittedimages
p #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=`${postURL}#${post.postId}`) View the full thread]
p.banmessage USER BANNED FOR THIS POST #{post.banmessage ? `(${post.banmessage})` : ''}
if post.omittedposts || post.omittedfiles
p
- const ompo = post.omittedposts;
- const omfi = post.omittedfiles;
| #{ompo} post#{ompo > 1 ? 's' : ''}
| #{omfi > 0 ? ` and ${omfi} image${omfi > 1 ? 's' : ''}` : ''} omitted.
| #[a(href=`${postURL}#${post.postId}`) View the full thread]
if post.previewbacklinks && post.previewbacklinks.length > 0
.replies Replies:
each backlink in post.previewbacklinks
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink.postId}`) >>#{backlink.postId}
|
if post.previewbacklinks.length < post.backlinks.length
| + #{post.backlinks.length-post.previewbacklinks.length} reply link(s) omitted
- const ombls = post.backlinks.length-post.previewbacklinks.length;
| + #{ombls} reply link#{ombls > 1 ? 's' : ''} omitted
else if post.backlinks && post.backlinks.length > 0
.replies Replies:
each backlink in post.backlinks

@ -20,8 +20,8 @@ block content
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
hr(size=1)
form(action='/forms/board/'+board._id+'/actions' method='POST' enctype='application/x-www-form-urlencoded')
hr(size=1)
if threads.length === 0
p No posts.
hr(size=1)

@ -104,7 +104,7 @@ block content
.row
.label
.required *
| All posts still require either a message or file(s)
| All posts still require either a message or file
section.row
.label Min Thread Message Length
input(type='number' name='min_thread_message_length' value=board.settings.minThreadMessageLength placeholder='0-4000')

@ -31,8 +31,8 @@ block content
a(href=`/${board._id}/banners.html`) [Banners]
|
a(href=`/${board._id}/logs.html`) [Logs]
hr(size=1)
form(action=`/forms/board/${board._id}/actions` method='POST' enctype='application/x-www-form-urlencoded')
hr(size=1)
section.thread
+post(thread)
for post in thread.replies

Loading…
Cancel
Save