reference #16 this is reply and image count, and move 'open thread' button to top for mobile

merge-requests/208/head
fatchan 5 years ago
parent 8e378bb160
commit 2791385a8b
  1. 2
      gulp/dist/css/style.css
  2. 5
      gulp/res/css/style.css
  3. 7
      models/forms/make-post.js
  4. 12
      views/mixins/catalogtile.pug
  5. 2
      views/mixins/post.pug

@ -1 +1 @@
body{font-family:arial,helvetica,sans-serif;font-size:10pt;background:#eef2ff;flex:1;display:flex;flex-direction:column;min-height:100vh;margin:0}.code{border-left:10px solid #b7c5d9;display:block;padding-left:5px;font-family:monospace;margin:.5em 0}.pages{padding:10px;margin:10px 0}.pages a{text-decoration:none}object{object-fit:contain}.board-header{display:flex;flex-direction:column;align-items:center}.catalog-tile-button{width:100%;line-height:30px;float:left;background:#b7c5d9;text-decoration:none;color:#000}.catalog-tile-content{padding:5px}.catalog-tile{margin:2px;text-align:center;max-height:300px;width:250px;overflow:hidden;overflow-y:auto;border:2px solid #b7c5d9;box-sizing:border-box}.no-m-p{margin:0;padding:0}.catalog-thumb{box-shadow:0 0 3px #000;min-width:64px;min-height:64px;object-fit:cover}.catalog{display:flex;align-items:flex-start;justify-content:space-evenly;flex-flow:row wrap}.spoiler{background:#000}.spoiler:hover{color:#fff}.mode{background-color:red;color:#fff;font-weight:700;text-align:center}.reports{background:#fca!important;border-color:#c97!important;border-width:1px 0;border-style:solid none}.redtext{color:maroon}.greentext{color:green}blockquote a{color:#d00}blockquote{word-break:break-all;white-space:pre-wrap}span{margin-right:5px}.action-wrapper,.form-wrapper,.thread{display:flex;flex-direction:column;align-items:flex-start}.form-wrapper{align-items:center;margin:10px 0}.actions,.pages,.post-container{background:#d6daf0;border-color:#b7c5d9;border-width:0 1px 1px 0;border-style:none solid solid none}.actions{max-width:100%;display:flex;flex-direction:column;margin:2px 0;padding:2px}.action-wrapper{display:flex;flex-direction:column;align-items:flex-start}.actions label{margin:2px 0}.toggle-label:hover{box-shadow:inset 0 0 100px 100px rgba(255,255,255,.25)}.toggle-label{background:#d6daf0;padding:10px;border-radius:3px;text-align:center;border:1px solid #d3d3d3;max-width:100%;box-sizing:border-box}.toggle{display:none}.toggle:checked+*{display:flex}.form-post{display:flex;flex-direction:column;max-width:100%;margin-top:10px}.togglable{display:none}.user-id{text-shadow:#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px;color:#fff;padding:0 2px}.post-check{position:relative;top:3px;margin:-3px 1px!important}.post-files{float:left;margin-right:10px}.post-data{margin-top:-10px;padding-top:10px}.post-file{display:inline-flex;flex-direction:column;margin:0 4px;padding:2px 0}.post-file-info{text-align:center;margin:2px;margin-top:0;max-width:128px;word-break:break-all}.post-file-src{margin:0 auto}input textarea{padding:8px}.no-resize{resize:none}.container{padding:10px}.board-title{color:#af0a0f;font:bolder 28px Tahoma,sans-serif;letter-spacing:-2px;text-align:center;margin:0}.no-decoration{text-decoration:none;color:#fff}.banner-check{display:flex;align-items:center}.board-banner{margin:10px;max-width:100%}.board-description{text-align:center;margin:0}.ban,.post-container{box-sizing:border-box;margin:2px 0;padding:2px;max-width:100%}.post-container:target{background-color:#d6bad0!important;border-color:#ba9dbf}.post-container.op{background:0 0;border:none;width:100%}.post-subject{color:#0f0c5d;font-weight:700}.post-capcode{font-weight:700;color:red}.post-name,.post-tripcode{color:#117743}.post-name{font-weight:700}.catalog-tile-content .post-info,.post-container.op .post-info{background:0 0}.post-info{margin:-2px;padding:2px;padding-left:1px}.post-info *{margin-bottom:0;margin-top:-2px}.navbar{border-bottom:1px solid #d3d3d3}.nav-item{line-height:50px;text-decoration:none;float:left;background:#d6daf0;padding-left:10px;padding-right:10px;border-right:1px solid #d3d3d3}.left{float:left}.clear-both{clear:both}.right{float:right}.nav-item:hover{box-shadow:inset 0 0 100px 100px rgba(255,255,255,.25)}.footer{border-top:1px solid #d3d3d3;text-align:center;flex-shrink:0;margin-top:auto;line-height:50px}input[type=password],input[type=text],textarea{border:1px solid #a9a9a9;font-size:inherit;font-family:arial,helvetica,sans-serif;margin:0;flex-grow:1}.postform-section{display:flex;margin-bottom:1px}.postform-label{padding:3px;border:1px solid #000;min-width:80px;background:#98e;display:flex;justify-content:center;flex-direction:column;font-weight:700;margin-right:1px}.boards-table{margin:0 auto}hr{color:#d3d3d3}@media only screen and (max-width:800px){input{height:30px}.form-post{width:100%}.form-login{width:100%}blockquote{margin:1em}.post-check{top:2px;margin-left:2px!important;height:8px}.post-container{width:100%;border:none}.catalog-tile{overflow-y:hidden}.boards-table{width:100%}.post-info{background-color:#b7c5d9;width:100%}}
body{font-family:arial,helvetica,sans-serif;font-size:10pt;background:#eef2ff;flex:1;display:flex;flex-direction:column;min-height:100vh;margin:0}.code{border-left:10px solid #b7c5d9;display:block;padding-left:5px;font-family:monospace;margin:.5em 0}.pages{padding:10px;margin:10px 0}.pages a{text-decoration:none}object{object-fit:contain}.board-header{display:flex;flex-direction:column;align-items:center}.catalog-tile-button{width:100%;line-height:30px;float:left;background:#b7c5d9;text-decoration:none;color:#000;margin-bottom:5px}.catalog-tile-content{padding:5px}.catalog-tile{margin:2px;text-align:center;max-height:300px;width:250px;overflow:hidden;overflow-y:auto;border:2px solid #b7c5d9;box-sizing:border-box}.no-m-p{margin:0;padding:0}.catalog-thumb{box-shadow:0 0 3px #000;min-width:64px;min-height:64px;object-fit:cover}.catalog{display:flex;align-items:flex-start;justify-content:space-evenly;flex-flow:row wrap}.spoiler{background:#000}.spoiler:hover{color:#fff}.mode{background-color:red;color:#fff;font-weight:700;text-align:center}.reports{background:#fca!important;border-color:#c97!important;border-width:1px 0;border-style:solid none}.redtext{color:maroon}.greentext{color:green}blockquote a{color:#d00}.op blockquote{margin:1em}blockquote{word-break:break-all;white-space:pre-wrap}span{margin-right:5px}.action-wrapper,.form-wrapper,.thread{display:flex;flex-direction:column;align-items:flex-start}.form-wrapper{align-items:center;margin:10px 0}.actions,.pages,.post-container{background:#d6daf0;border-color:#b7c5d9;border-width:0 1px 1px 0;border-style:none solid solid none}.actions{max-width:100%;display:flex;flex-direction:column;margin:2px 0;padding:2px}.action-wrapper{display:flex;flex-direction:column;align-items:flex-start}.actions label{margin:2px 0}.toggle-label:hover{box-shadow:inset 0 0 100px 100px rgba(255,255,255,.25)}.toggle-label{background:#d6daf0;padding:10px;border-radius:3px;text-align:center;border:1px solid #d3d3d3;max-width:100%;box-sizing:border-box}.toggle{display:none}.toggle:checked+*{display:flex}.form-post{display:flex;flex-direction:column;max-width:100%;margin-top:10px}.togglable{display:none}.user-id{text-shadow:#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px,#000 0 0 1px;color:#fff;padding:0 2px}.post-check{position:relative;top:3px;margin:-3px 1px!important}.post-files{float:left;margin-right:10px}.post-data{margin-top:-10px;padding-top:10px}.post-file{display:inline-flex;flex-direction:column;margin:0 4px;padding:2px 0}.post-file-info{text-align:center;margin:2px;margin-top:0;max-width:128px;word-break:break-all}.post-file-src{margin:0 auto}input textarea{padding:8px}.no-resize{resize:none}.container{padding:10px}.board-title{color:#af0a0f;font:bolder 28px Tahoma,sans-serif;letter-spacing:-2px;text-align:center;margin:0}.no-decoration{text-decoration:none;color:#fff}.banner-check{display:flex;align-items:center}.board-banner{margin:10px;max-width:100%}.board-description{text-align:center;margin:0}.ban,.post-container{box-sizing:border-box;margin:2px 0;padding:2px;max-width:100%}.post-container:target{background-color:#d6bad0!important;border-color:#ba9dbf}.post-container.op{background:0 0;border:none;width:100%}.post-subject{color:#0f0c5d;font-weight:700}.post-capcode{font-weight:700;color:red}.post-name,.post-tripcode{color:#117743}.post-name{font-weight:700}.catalog-tile-content .post-info,.post-container.op .post-info{background:0 0}.post-info{margin:-2px;padding:2px;padding-left:1px}.post-info *{margin-bottom:0;margin-top:-2px}.navbar{border-bottom:1px solid #d3d3d3}.nav-item{line-height:50px;text-decoration:none;float:left;background:#d6daf0;padding-left:10px;padding-right:10px;border-right:1px solid #d3d3d3}.left{float:left}.clear-both{clear:both}.right{float:right}.nav-item:hover{box-shadow:inset 0 0 100px 100px rgba(255,255,255,.25)}.footer{border-top:1px solid #d3d3d3;text-align:center;flex-shrink:0;margin-top:auto;line-height:50px}input[type=password],input[type=text],textarea{border:1px solid #a9a9a9;font-size:inherit;font-family:arial,helvetica,sans-serif;margin:0;flex-grow:1}.postform-section{display:flex;margin-bottom:1px}.postform-label{padding:3px;border:1px solid #000;min-width:80px;background:#98e;display:flex;justify-content:center;flex-direction:column;font-weight:700;margin-right:1px}.boards-table{margin:0 auto}hr{color:#d3d3d3}@media only screen and (max-width:800px){input{height:30px}.form-post{width:100%}.form-login{width:100%}blockquote{margin:1em}.post-check{top:2px;margin-left:2px!important;height:8px}.post-container{width:100%;border:none}.catalog-tile{overflow-y:hidden}.boards-table{width:100%}.post-info{background-color:#b7c5d9;width:100%}}

@ -43,6 +43,7 @@ object {
background: #B7C5D9;
text-decoration: none;
color: black;
margin-bottom: 5px;
}
.catalog-tile-content {
@ -113,6 +114,10 @@ blockquote a {
color: #d00;
}
.op blockquote {
margin: 1em;
}
blockquote {
word-break: break-all;
white-space: pre-wrap;

@ -134,14 +134,15 @@ module.exports = async (req, res, next, numFiles) => {
const fullUserIdHash = crypto.createHash('sha256').update(salt + ip + req.params.board).digest('hex');
const userId = fullUserIdHash.substring(fullUserIdHash.length-6);
let name = req.body.name;
let name = null;
let tripcode = null;
let capcode = null;
if (name && name.length > 0) {
if (req.body.name && req.body.name.length > 0) {
// get matches with named groups for name, trip and capcode in 1 regex
const matches = name.match(nameRegex);
const matches = req.body.name.match(nameRegex);
if (matches && matches.groups) {
const groups = matches.groups;
console.log(groups)
//name
if (groups.name) {
name = groups.name

@ -1,5 +1,9 @@
mixin catalogtile(board, post, truncate)
article(class='catalog-tile')
- const postURL = `/${board._id}/thread/${post.postId}#${post.postId}`
a.catalog-tile-button(href=postURL) Open Thread
if post.subject
span: a.no-decoration.post-subject(href=postURL) #{post.subject}
.catalog-tile-content
if post.files.length > 0
.post-file-src
@ -9,9 +13,9 @@ mixin catalogtile(board, post, truncate)
else
object.catalog-thumb(data=`/img/thumb-${post.files[0].filename.split('.')[0]}.png` width='64' height='64')
header.post-info
if post.subject
span: a.no-decoration.post-subject(href=`/${board._id}/thread/${post.postId}#${post.postId}`) #{post.subject}
span: a(href=`/${board._id}/thread/${post.postId}#${post.postId}`) ##{post.postId}
span: a(href=postURL) ##{post.postId}
span Replies: #{post.replyposts}
span Images: #{post.replyimages}
br
if post.message
blockquote.no-m-p.post-message !{post.message}
a.catalog-tile-button(href=`/${board._id}/thread/${post.postId}#${post.postId}`) Open Thread

@ -51,7 +51,7 @@ mixin post(post, truncate, manage=false, globalmanage=false)
}
if truncated
blockquote.post-message !{truncatedMessage}
blockquote.left Message too long. #[a(href=postURL) Click here] to view the full text.
blockquote.left.clear-both Message too long. #[a(href=postURL) View the full text]
else
blockquote.post-message !{post.message}
else

Loading…
Cancel
Save