From 396b29f32d37b83c4bcb110ea14972cb745f3ee7 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 29 Mar 2018 15:35:14 +0100 Subject: [PATCH] Conditionally load SL assets on error pages; adjust styles for OL v2. --- services/web/app/views/general/404.pug | 11 +++---- services/web/app/views/general/500.pug | 30 +++++-------------- .../public/stylesheets/app/error-pages.less | 28 ++++++++++++++--- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/services/web/app/views/general/404.pug b/services/web/app/views/general/404.pug index 8754ba5757..eccd8b31e0 100644 --- a/services/web/app/views/general/404.pug +++ b/services/web/app/views/general/404.pug @@ -4,11 +4,12 @@ block content .content .container .error-container - .error-figure - img.error-img( - src="/img/brand/404-visual.svg" - alt="Not found" - ) + if (settings.brandPrefix !== 'ol-') + .error-figure + img.error-img( + src="/img/brand/404-visual.svg" + alt="Not found" + ) .error-details p.error-status Not found p.error-description #{translate("cant_find_page")} diff --git a/services/web/app/views/general/500.pug b/services/web/app/views/general/500.pug index 4a4ef6a9e3..0a2177d1e8 100644 --- a/services/web/app/views/general/500.pug +++ b/services/web/app/views/general/500.pug @@ -4,33 +4,19 @@ html.full-height(itemscope, itemtype='http://schema.org/Product') title Something went wrong link(rel="icon", href="/favicon.ico") if buildCssPath - link(rel='stylesheet', href=buildCssPath('/style.css')) + link(rel="stylesheet", href=buildCssPath("/" + settings.brandPrefix + "style.css")) link(href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css",rel="stylesheet") body.full-height .content.full-height .container.full-height .error-container.full-height - .error-figure.error-figure-500 - img.error-img( - src="/img/brand/500-visual-socket.svg" - alt="Error" - ) + if (settings.brandPrefix !== 'ol-') + .error-figure.error-figure-500 + img.error-img( + src="/img/brand/500-visual-socket.svg" + alt="Error" + ) .error-details p.error-status Something went wrong, sorry. p.error-description Our staff are probably looking into this, but if it continues, please contact us at #{settings.adminEmail} - a.error-btn(href="/") Home - //- .content - //- .container - //- .row - //- .col-md-8.col-md-offset-2.text-center - //- .page-header - //- h2 Oh dear, something went wrong. - //- if buildImgPath - //- p - //- img(src=buildImgPath("lion-sad-128.png"), alt="Sad Lion") - //- p - //- | Something went wrong with your request, sorry. Our staff are probably looking into this, but if it continues, please contact us at #{settings.adminEmail} - //- p - //- a(href="/") - //- i.fa.fa-arrow-circle-o-left - //- | Take me home + a.error-btn(href="/") Home \ No newline at end of file diff --git a/services/web/public/stylesheets/app/error-pages.less b/services/web/public/stylesheets/app/error-pages.less index 3d575408df..baad3f7a5a 100644 --- a/services/web/public/stylesheets/app/error-pages.less +++ b/services/web/public/stylesheets/app/error-pages.less @@ -7,6 +7,11 @@ display: flex; align-items: center; } + +.error-container.full-height when (@is-overleaf = true) { + margin-top: -(@header-height + @content-margin-vertical) / 2; +} + .error-figure { display: none; flex: 0 0 50%; @@ -56,6 +61,11 @@ flex: 0 1 50%; padding: @line-height-computed * 2; } + + .error-details when (@is-overleaf = true) { + flex-grow: 1; + } + .error-status { font-family: @font-family-serif; margin-bottom: (@line-height-computed / 4); @@ -68,12 +78,13 @@ color: @gray; margin-bottom: @line-height-computed * 2; } - .error-btn { + .error-btn when (@is-overleaf = false) { color: @navbar-default-link-color; border: 2px solid @navbar-default-link-color; - border-radius: @border-radius-base; - font-weight: 700; - line-height: 1; + border-radius: @navbar-btn-border-radius; + font-size: @navbar-btn-font-size; + font-weight: @navbar-btn-font-weight; + line-height: @navbar-btn-line-height; padding: @padding-base-vertical @padding-base-horizontal; &:hover, @@ -83,4 +94,13 @@ background-color: @navbar-default-link-hover-bg; border: 2px solid @navbar-default-link-hover-color; } + } + + .error-btn when (@is-overleaf = true) { + .btn; + .btn-primary; + display: block; + @media (min-width: @screen-sm-min) { + display: inline-block; + } } \ No newline at end of file