From bf60927c2e23d8678a06298d72e91ebdf9f34b61 Mon Sep 17 00:00:00 2001 From: Wingy Date: Tue, 3 Dec 2019 16:42:51 -0500 Subject: [PATCH] Print! --- static/css/main.css | 8 ++++++++ views/layout.pug | 37 +++++++++++++++++++++++++------------ views/wishlist.pug | 19 ++++++++++++++++++- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index adefb06..7e91441 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -48,4 +48,12 @@ img.emoji { vertical-align: middle; width: 2em !important; height: 2em !important; +} + +.print { + display: none; +} +@media print { + .notprint { display: none; } + .print { display: block; } } \ No newline at end of file diff --git a/views/layout.pug b/views/layout.pug index 743945d..51a9089 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -24,15 +24,28 @@ html(lang='en') link(rel='stylesheet', href='/libraries/animate.min.css') link(rel='stylesheet', href='/css/main.css') body - include includes/navbar.pug - div.content.has-navbar-fixed-top#pageContent - div(style='margin-top: 1.5em;') - section.section - div.container.is-marginless.fullwidth - block title - if title - h1= config.siteTitle + ' - ' + title - else if title !== false - h1 #{config.siteTitle} - include includes/messages.pug - block content \ No newline at end of file + .print + .content + section.section + .container.is-marginless.fullwidth + block print + style. + .print { display: none !important; } + .notprint { display: block !important; } + @media print { + .notprint-padding { display: none; } + nav { display: none} + } + .notprint + include includes/navbar.pug + div.content.has-navbar-fixed-top#pageContent + div.notprint-padding(style='margin-top: 1.5em;') + section.section + div.container.is-marginless.fullwidth + block title + if title + h1= config.siteTitle + ' - ' + title + else if title !== false + h1 #{config.siteTitle} + include includes/messages.pug + block content \ No newline at end of file diff --git a/views/wishlist.pug b/views/wishlist.pug index 48bbae6..2ed04c9 100644 --- a/views/wishlist.pug +++ b/views/wishlist.pug @@ -178,4 +178,21 @@ block content .field .control input.button(type='submit' value=(req.user._id === req.params.user ? 'Add item to wishlist' : 'Pledge item')) - script(src='/js/wishlist.js') \ No newline at end of file + script(src='/js/wishlist.js') + +block print + h1 #{req.params.user}'s Wishlist + each item, index in wishlist.filter(item => item.addedBy === req.params.user) + .print-gift + if index > 0 + hr(style='background-color: black;') + .columns + .column.is-4 + span.is-block.is-size-4.ugc= item.name + span.is-block.is-size-5.ugc.has-text-grey= item.url + .column + span.is-block.is-size-5 Added by: #{item.addedBy} + if item.note + br + .box + span.is-block.is-size-5.ugc= item.note