Browse Source

Conditionally load SL assets on error pages; adjust styles for OL v2.

Paulo Reis 8 years ago
parent
commit
396b29f32d

+ 6 - 5
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")}

+ 8 - 22
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

+ 24 - 4
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;
+			}
 		}