To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f1f1cea2 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Style error pages

parent 608b9d71
......@@ -165,6 +165,10 @@ Raven.context(() => {
};
});
result['/:language/:404...'] = {
view: () => m(layout, m(Error404)),
};
m.route(document.body, '/', result);
}
......
......@@ -97,6 +97,7 @@
"studydocs.files": "Dateien",
"studydocs.upload": "Dokument(e) hochladen",
"studydocs.uploading": "lädt hoch...",
"studydocs.access_denied": "Studienunterlagen sind nur für ETH Studenten verfügbar.",
"events.searchfield": "Suchtext eingeben...",
"events.price": "Preis",
"events.free": "Gratis",
......@@ -131,6 +132,9 @@
"companies.employees_Switzerland": "in der Schweiz",
"joboffers.searchfield": "Suchtext eingeben...",
"joboffers.not_found": "Jobangebot nicht gefunden",
"joboffers.no_selection": "Kein Jobangebot ausgewählt"
"joboffers.no_selection": "Kein Jobangebot ausgewählt",
"errors.title": "Ups, das ist ein Fehler!",
"errors.access_denied.default_reason": "Diese Seite ist nur für eingeloggte Benutzer verfügbar.",
"errors.not_found.text": "Die gewünschte Seite konnte nicht gefunden werden."
}
}
......@@ -95,8 +95,9 @@
"studydocs.semester": "Semester",
"studydocs.course_year": "Course Year",
"studydocs.files": "Files",
"studydocs.upload": "Upload studydocument(s)",
"studydocs.upload": "Upload study document(s)",
"studydocs.uploading": "Uploading...",
"studydocs.access_denied": "Study documents are available only for ETH students.",
"events.searchfield": "Enter search text...",
"events.price": "Price",
"events.free": "Free",
......@@ -131,7 +132,9 @@
"companies.employees_Switzerland": "in Switzerland",
"joboffers.searchfield": "Enter search text...",
"joboffers.not_found": "Job offer not found",
"joboffers.no_selection": "No job offer selected"
"joboffers.no_selection": "No job offer selected",
"errors.title": "Woops, that's an error!",
"errors.access_denied.default_reason": "This page is accessible only for authenticated users.",
"errors.not_found.text": "The page you are looking for could not be found."
}
}
import m from 'mithril';
import { i18n } from '../models/language';
import { login } from '../models/auth';
import { Button } from '../components';
import translateIcon from './images/translate.svg';
/**
* View to show when a visitor does not have the right permissions to see the content.
......@@ -8,8 +11,21 @@ import { i18n } from '../models/language';
* @return {Error401}
*/
export class Error401 {
static view() {
return m('div', 'This page is only accessible for authenticated users. Please log in.');
static view(vnode) {
let reason;
if (vnode.attrs.reason) {
reason = i18n(vnode.attrs.reason);
} else {
reason = i18n('errors.access_denied.default_reason');
}
return m('div.error-page', [
m('h1', i18n('errors.title')),
m('p', reason),
m(Button, {
label: i18n('Login'),
events: { onclick: () => login() },
}),
]);
}
}
......@@ -21,7 +37,10 @@ export class Error401 {
*/
export class Error404 {
static view() {
return m('div', 'This page does not exist.');
return m('div.error-page', [
m('h1', i18n('errors.title')),
m('p', i18n('errors.not_found.text')),
]);
}
}
......@@ -36,10 +55,19 @@ export class Error404 {
export class TranslationUnavailable {
static view(vnode) {
return m(
'div.translation-unavailable',
i18n('translation unavailable', {
shown_language: i18n(`language.${vnode.attrs.shown_language}`),
})
'div',
{
class: 'translation-unavailable infobox',
},
[
m('img', { src: translateIcon }),
m(
'span',
i18n('translation unavailable', {
shown_language: i18n(`language.${vnode.attrs.shown_language}`),
})
),
]
);
}
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<g id="Bounding_Boxes">
<g id="ui_x5F_spec_x5F_header_copy_3">
</g>
<path fill="none" d="M0,0h24v24H0V0z"/>
</g>
<g id="Outline">
<g id="ui_x5F_spec_x5F_header">
</g>
<path d="M12.87,15.07l-2.54-2.51l0.03-0.03c1.74-1.94,2.98-4.17,3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17
C11.5,7.92,10.44,9.75,9,11.35C8.07,10.32,7.3,9.19,6.69,8h-2c0.73,1.63,1.73,3.17,2.98,4.56l-5.09,5.02L4,19l5-5l3.11,3.11
L12.87,15.07z M18.5,10h-2L12,22h2l1.12-3h4.75L21,22h2L18.5,10z M15.88,17l1.62-4.33L19.12,17H15.88z"/>
</g>
</svg>
@import './colors.less';
@import './dimensions.less';
@import './mediaquery.less';
@import './errors.less';
@import './frontpage.less';
@import './studydocList.less';
@import './legalNotice.less';
......@@ -64,9 +65,19 @@ main {
}
}
#amiv-container {
max-width: @dimension-max-content-width;
display: block;
margin: 0 auto;
font-family: Arial, Helvetica, sans-serif;
.infobox {
width: 100%;
padding: .5em;
background-color: @color-grey;
line-height: 1.5em;
height: 1.5em;
img {
height: 100%;
margin-right: .5em;
}
span {
vertical-align: super;
}
}
@import './colors.less';
.error-page {
text-align: center;
padding-top: 5em;
h1 {
// font-size: 3em;
}
p {
font-size: 1.5em;
color: @color-dark-blue;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment