dont use object tag unnecessarily, deleted file display properly in catalog and other minor style changes

merge-requests/208/head
fatchan 5 years ago
parent 455acc9298
commit f9ec124d61
  1. 1
      gulp/res/css/style.css
  2. 2
      helpers/files/imagethumbnail.js
  3. 8
      models/forms/deletepost.js
  4. 2
      views/includes/boardheader.pug
  5. 4
      views/mixins/catalogtile.pug
  6. 2
      views/mixins/post.pug
  7. 2
      views/pages/manage.pug

@ -117,6 +117,7 @@ object {
}
.catalog-thumb {
display: block;
box-shadow: 0 0 3px black;
width: 64px;
height: 64px;

@ -6,9 +6,7 @@ module.exports = (filename) => {
return new Promise((resolve, reject) => {
gm(`${uploadDirectory}img/${filename}`)
.noProfile()
.resize(128, 128)
// .quality(30)
.write(`${uploadDirectory}img/thumb-${filename.split('.')[0]}.jpg`, function (err) {
if (err) {
return reject(err);

@ -26,7 +26,7 @@ module.exports = async (req, res, next, posts, board) => {
threadPosts = await Posts.getMultipleThreadPosts(board, threadPostIds);
} else {
//otherwise we fetch posts from threads on different boards separarely
//TODO: combine queries from the same board, or ideally construct a large $or query so this can be tackled in a single db query
//TODO: use bulkwrite or construct a large $or query so this can be tackled in a single db query
await Promise.all(threads.map(async thread => {
//for each thread, fetch all posts from the matching board and thread matching the threads postId
const currentThreadPosts = await Posts.getThreadPosts(thread.board, thread.postId);
@ -42,12 +42,6 @@ module.exports = async (req, res, next, posts, board) => {
const postMongoIds = allPosts.map(post => Mongo.ObjectId(post._id))
const deletedPosts = await Posts.deleteMany(postMongoIds).then(result => result.deletedCount);
//get filenames from all the posts
let fileNames = [];
allPosts.forEach(post => {
fileNames = fileNames.concat(post.files.map(x => x.filename))
})
//hooray!
return { message:`Deleted ${threads.length} threads and ${deletedPosts-threads.length} posts` };

@ -1,5 +1,5 @@
section.board-header
object.board-banner(data=`/banners?board=${board._id}` width='300' height='100')
img.board-banner(src=`/banners?board=${board._id}` width='300' height='100')
br
a.no-decoration(href=`/${board._id}/index.html`)
h1.board-title /#{board._id}/ - #{board.name}

@ -5,9 +5,11 @@ mixin catalogtile(board, post, truncate)
.post-file-src
a(href=postURL)
if post.spoiler
object(data='/img/spoiler.png' width='64' height='64')
img(src='/img/spoiler.png' width='64' height='64')
else
object.catalog-thumb(data=`/img/thumb-${post.files[0].filename.split('.')[0]}.jpg` width='64' height='64')
img(src='/img/deleted.png' width='64' height='64')
br
header.post-info
if post.sticky
img(src='/img/sticky.svg' height='12')

@ -57,7 +57,7 @@ mixin post(post, truncate, manage=false, globalmanage=false)
.post-file-src
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
object.file-thumb(data='/img/spoiler.png' width='128' height='128')
img.file-thumb(src='/img/spoiler.png' width='128' height='128')
else if file.hasThumb
object.file-thumb(data=`/img/thumb-${file.filename.split('.')[0]}.jpg`)
img(src='/img/deleted.png')

@ -70,7 +70,7 @@ block content
each banner in board.banners
label.banner-check
input(type='checkbox' name='checkedbanners[]' value=banner)
object.board-banner(data=`/banner/${board._id}/${banner}` width='300' height='100')
img.board-banner(src=`/banner/${board._id}/${banner}` width='300' height='100')
input(type='submit', value='delete')
hr(size=1)
h4.no-m-p Reports:

Loading…
Cancel
Save