padded anchors were too big and didnt look good for threads

merge-requests/208/head
fatchan 5 years ago
parent 1ead7e26c3
commit ab7086dd59
  1. 9
      gulp/res/css/style.css
  2. 198
      views/mixins/post.pug
  3. 10
      views/pages/board.pug
  4. 6
      views/pages/catalog.pug
  5. 10
      views/pages/thread.pug

@ -416,18 +416,15 @@ input textarea {
box-sizing: border-box;
padding: 5px;
max-width: 100%;
margin-bottom: -10px;
}
.pad-anchor:target .post-container {
.anchor:target + .post-container {
background-color: #d6bad0 !important;
border: 1px solid #ba9dbf !important;
}
.pad-anchor:before {
content: "";
display: block;
height: 15px;
.anchor {
height: 5px;
}
.post-container.op {

@ -1,104 +1,104 @@
mixin post(post, truncate, manage=false, globalmanage=false)
.pad-anchor(id=post.postId)
article(class='post-container '+(post.thread ? '' : 'op'))
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`;
header.post-info
if globalmanage
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id)
else
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId)
|
if !post.thread
if post.sticky
img(src='/img/sticky.svg' height='12' title='Stickied')
|
if post.saged
img(src='/img/saged.svg' height='12' title='Permasaged')
|
if post.locked
img(src='/img/locked.svg' height='12' title='Locked')
|
if post.subject
span.post-subject #{post.subject}
.anchor(id=post.postId)
article(class='post-container '+(post.thread ? '' : 'op'))
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`;
header.post-info
if globalmanage
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id)
else
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId)
|
if !post.thread
if post.sticky
img(src='/img/sticky.svg' height='12' title='Stickied')
|
if post.email
a(href=`mailto:${post.email}`)
span.post-name #{post.name}
else
span.post-name #{post.name}
|
if post.tripcode
span.post-tripcode #{post.tripcode}
if post.saged
img(src='/img/saged.svg' height='12' title='Permasaged')
|
if post.capcode
span.post-capcode #{post.capcode}
if post.locked
img(src='/img/locked.svg' height='12' title='Locked')
|
span #{post.date.toLocaleString()}
if post.subject
span.post-subject #{post.subject}
|
if post.userId
span.user-id(style=`background: #${post.userId}`) #{post.userId}
|
span: a(href=postURL) No.#{post.postId}
if !post.thread
|
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply]
.post-data
if post.files.length > 0
.post-files
each file in post.files
.post-file
span.post-file-info
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename}
br
span
| (#{file.sizeString}, #{file.geometryString}
if file.durationString
| , #{file.durationString}
| )
.post-file-src
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
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')
else
object.file-thumb(data=`/img/${file.filename}`)
img(src='/img/deleted.png')
if post.message
if truncate
-
const splitPost = post.message.split('\n');
const messageLines = splitPost.length;
let truncatedMessage = post.message;
if (messageLines > 10) {
truncatedMessage = splitPost.slice(0, 10).join('\n');
} else if (post.message.length > 1000) {
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, '');
}
pre.post-message !{truncatedMessage}
if truncatedMessage !== post.message
blockquote Message too long. #[a(href=postURL) View the full text]
else
pre.post-message !{post.message}
if post.banmessage
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage})
if post.omittedposts || post.omittedimages
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread]
if post.backlinks && post.backlinks.length > 0
.replies Replies:
each backlink in post.backlinks
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) &gt;&gt;#{backlink}
|
if manage === true
each report in post.reports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}
if globalmanage === true
each report in post.globalreports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}
if post.email
a(href=`mailto:${post.email}`)
span.post-name #{post.name}
else
span.post-name #{post.name}
|
if post.tripcode
span.post-tripcode #{post.tripcode}
|
if post.capcode
span.post-capcode #{post.capcode}
|
span #{post.date.toLocaleString()}
|
if post.userId
span.user-id(style=`background: #${post.userId}`) #{post.userId}
|
span: a(href=postURL) No.#{post.postId}
if !post.thread
|
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply]
.post-data
if post.files.length > 0
.post-files
each file in post.files
.post-file
span.post-file-info
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename}
br
span
| (#{file.sizeString}, #{file.geometryString}
if file.durationString
| , #{file.durationString}
| )
.post-file-src
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
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')
else
object.file-thumb(data=`/img/${file.filename}`)
img(src='/img/deleted.png')
if post.message
if truncate
-
const splitPost = post.message.split('\n');
const messageLines = splitPost.length;
let truncatedMessage = post.message;
if (messageLines > 10) {
truncatedMessage = splitPost.slice(0, 10).join('\n');
} else if (post.message.length > 1000) {
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, '');
}
pre.post-message !{truncatedMessage}
if truncatedMessage !== post.message
blockquote Message too long. #[a(href=postURL) View the full text]
else
pre.post-message !{post.message}
if post.banmessage
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage})
if post.omittedposts || post.omittedimages
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread]
if post.backlinks && post.backlinks.length > 0
.replies Replies:
each backlink in post.backlinks
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) &gt;&gt;#{backlink}
|
if manage === true
each report in post.reports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}
if globalmanage === true
each report in post.globalreports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}

@ -10,11 +10,11 @@ block content
include ../includes/postform.pug
br
include ../includes/stickynav.pug
.pad-anchor#top
nav.pages
include ../includes/pages.pug
a(href=`/${board._id}/catalog.html`) [Catalog]
|
.anchor#top
nav.pages
include ../includes/pages.pug
a(href=`/${board._id}/catalog.html`) [Catalog]
|
hr(size=1)
form(action='/forms/board/'+board._id+'/actions' method='POST' enctype='application/x-www-form-urlencoded')
if threads.length === 0

@ -10,9 +10,9 @@ block content
include ../includes/postform.pug
br
include ../includes/stickynav.pug
.pad-anchor#top
nav.pages
a(href=`/${board._id}/index.html`) [Return]
.anchor#top
nav.pages
a(href=`/${board._id}/index.html`) [Return]
hr(size=1)
if threads.length === 0
p No posts.

@ -21,11 +21,11 @@ block content
include ../includes/postform.pug
br
include ../includes/stickynav.pug
.pad-anchor#top
nav.pages
a(href=`/${board._id}/index.html`) [Return]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
.anchor#top
nav.pages
a(href=`/${board._id}/index.html`) [Return]
|
a(href=`/${board._id}/catalog.html`) [Catalog]
hr(size=1)
form(action=`/forms/board/${board._id}/actions` method='POST' enctype='application/x-www-form-urlencoded')
section.thread

Loading…
Cancel
Save