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; box-sizing: border-box;
padding: 5px; padding: 5px;
max-width: 100%; max-width: 100%;
margin-bottom: -10px;
} }
.pad-anchor:target .post-container { .anchor:target + .post-container {
background-color: #d6bad0 !important; background-color: #d6bad0 !important;
border: 1px solid #ba9dbf !important; border: 1px solid #ba9dbf !important;
} }
.pad-anchor:before { .anchor {
content: ""; height: 5px;
display: block;
height: 15px;
} }
.post-container.op { .post-container.op {

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

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

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

Loading…
Cancel
Save