Skip to content

Commit

Permalink
fix: fixed invoice printing/PDF receipts, fixed home page on tablet a…
Browse files Browse the repository at this point in the history
…nd mobile
  • Loading branch information
titanism committed Sep 29, 2023
1 parent 83fa56b commit 7347e93
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/models/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async function getPDFReceipt(
const options = {
debug: config.env !== 'production',
pageSize: 'letter',
background: true,
background: false,
imageDpi: 600,
// NOTE: there is a bug with min-width and max-width
// <https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4375>
Expand Down
2 changes: 1 addition & 1 deletion app/views/_nav.pug
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ nav.navbar.navbar-expand-lg.fixed-top(
data-target=isRegisterOrLogin ? false : "#modal-log-in"
)= t("Log in")
if ctx.pathWithoutLocale !== '/register'
li.list-inline-item.d-none.d-sm-inline-block.d-lg-none
li.list-inline-item.d-inline-block.d-lg-none
a.btn.btn-sm.btn-success.text-uppercase.font-weight-bold(
href=l("/register"),
data-toggle=isRegisterOrLogin ? false : "modal-anchor",
Expand Down
24 changes: 11 additions & 13 deletions app/views/home.pug
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,20 @@ block body
.col-12.col-lg-6
h1.mb-3
= t("Free, private, and secure email for custom domains.")
p
p.d-none.d-md-block
!= t('For <span class="notranslate">%d</span> years and counting, we are the go-to email service for hundreds of thousands of creators, developers, and businesses.', dayjs().endOf("year").diff(dayjs("1/1/17", "M-D/YY"), "year"))
= " "
!= t('Send and receive email as <span class="notranslate font-weight-bold text-nowrap">you@yourdomain.com</span>.')
.d-block
ul.list-inline.mb-3
li.list-inline-item
a.btn.btn-success.btn-lg.font-weight-bold.text-uppercase(
href=l("/register"),
data-toggle="modal-anchor",
data-target="#modal-sign-up"
)
= t("Try for free")
a.btn.btn-success.btn-lg.font-weight-bold.text-uppercase.mb-3(
href=l("/register"),
data-toggle="modal-anchor",
data-target="#modal-sign-up"
)
= t("Try for free")
.d-none.d-md-block
include _feature-list
ul.list-inline
li.list-inline-item
li.list-inline-item.d-block.d-md-inline.mb-3.mb-md-0
a.btn(
class=isBot(ctx.get("User-Agent")) ? "btn-dark" : "btn-outline-light",
href=isBot(ctx.get("User-Agent")) ? l("/private-business-email") : l("/private-business-email?pricing=true")
Expand All @@ -128,7 +126,7 @@ block body
= t("Features and Pricing")
else
= t("See all features")
li.list-inline-item
li.list-inline-item.d-block.d-md-inline
if isBot(ctx.get('User-Agent'))
a.btn.btn-dark(
href="https://www.youtube.com/watch?v=N6zjv40zuIY",
Expand All @@ -139,7 +137,7 @@ block body
= " "
= t("Watch Video")
else
a.btn.btn-outline-light.d-inline-block(
a.btn.btn-outline-light(
role="button",
data-toggle="modal",
data-target="#modal-watch-video",
Expand Down
4 changes: 2 additions & 2 deletions app/views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ html.h-100.no-js(
body.d-flex.flex-column.min-h-100.app(
role="document",
onload=isBot(ctx.get("User-Agent")) ? "if (typeof lazyload === 'function') { lazyload(); }" : false,
id=ctx.pathWithoutLocale === "/" && !isBot(ctx.get("User-Agent")) ? "freddy" : "",
id=!isPDF && ctx.pathWithoutLocale === "/" && !isBot(ctx.get("User-Agent")) ? "freddy" : "",
data-ignore-hash-change=ctx.pathWithoutLocale === "/" ? true : false
)
//- Safari has performance issues
//- <https://stackoverflow.com/a/40463096>
- const isSafari = /^((?!chrome|android|crios|fxios).)*safari/i.test(ctx.get("User-Agent"));
if (!isSafari && ctx.pathWithoutLocale === '/' && !isBot(ctx.get('User-Agent')))
if (!isPDF && !isSafari && ctx.pathWithoutLocale === '/' && !isBot(ctx.get('User-Agent')))
#stars.user-select-none
#rocket.user-select-none
#waving.user-select-none
Expand Down
2 changes: 1 addition & 1 deletion assets/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function navbarScroll() {

if (el && $nav.length > 0) {
navbarScroll();
$(window).scroll(debounce(navbarScroll, 250));
$(window).scroll(debounce(navbarScroll, 125));
$('#navbar-header')
.on('show.bs.collapse', navbarScroll)
.on('hide.bs.collapse', navbarScroll);
Expand Down
16 changes: 8 additions & 8 deletions test/web/snapshots/index.js.md

Large diffs are not rendered by default.

Binary file modified test/web/snapshots/index.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions test/web/snapshots/otp.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.5f4516c8.js" integrity="sha256-MPkTfM8ZXbOY7nqVtkDokiHSxv6PiFDoOmipE52F1p0=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.69906625.js" integrity="sha256-/iwLqi4nrP8PuA0nJ16ojRuEnSFAVMhfPq8EhQSbvMA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`

## GET otp/keys > successful

Expand All @@ -52,4 +52,4 @@ Generated by [AVA](https://avajs.dev).
window._confirmPromptHTML = "Please confirm if you wish to continue.";␊
</script><script defer="defer">window.LOCALE = "en";␊
</script><script defer="defer">window.API_URL = "http://localhost:4000";␊
</script><script defer="defer" src="http://example.com:3000/js/build.5f4516c8.js" integrity="sha256-MPkTfM8ZXbOY7nqVtkDokiHSxv6PiFDoOmipE52F1p0=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
</script><script defer="defer" src="http://example.com:3000/js/build.69906625.js" integrity="sha256-/iwLqi4nrP8PuA0nJ16ojRuEnSFAVMhfPq8EhQSbvMA=" crossorigin="anonymous"></script><script defer="defer" data-domain="forwardemail.net" src="https://plausible.io/js/plausible.js"></script></body></html>`
Binary file modified test/web/snapshots/otp.js.snap
Binary file not shown.

0 comments on commit 7347e93

Please sign in to comment.