Skip to content

Commit

Permalink
Merge pull request #624 from epfl-si/feature/404-page-template
Browse files Browse the repository at this point in the history
404 page template
  • Loading branch information
xentenza authored Jan 17, 2023
2 parents 4c06150 + ac518d8 commit 79fea5f
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/components/entrypoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@
@import 'pages/people-detail/people-detail';
@import 'pages/blog-single/blog-single';
@import 'pages/study-plan-course/study-plan-course';
@import 'pages/error-404/error-404';
@import 'pages/event-list/event-list';
2 changes: 1 addition & 1 deletion assets/components/organisms/header/header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</a>
<ul aria-hidden="true" class="nav-header d-none d-xl-flex">
{% for head in header %}
<li id="menu-item-{{ loop.index }}" {% if loop.index == 2 %} class="current-menu-item"{% endif %}>
<li id="menu-item-{{ loop.index }}" {% if ( loop.index == 2 ) and ( showCurrentMenuItem|default(true) ) %} class="current-menu-item"{% endif %}>
{% if language == 'fr' %}
<a class="nav-item" href="{{ head.url_fr }}">{{ head.name_fr }}</a>
{% endif %}
Expand Down
12 changes: 12 additions & 0 deletions assets/components/pages/error-404/error-404.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

.error-title {
color: $red;
font-size: 12vw;
margin-bottom: .75rem;
text-align: center;
}

.error-404 .search-form {
margin: 0 auto;
max-width: 50rem;
}
50 changes: 50 additions & 0 deletions assets/components/pages/error-404/error-404.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% set isSpecial = true %}
{% if language is not defined %}{% set language = 'en' %}{% endif %}

{% extends "@templates/base/base.twig" %}

{% block header %}
{% include '@organisms/header/header.twig' with { long_nav_lang: true, showCurrentMenuItem: false } %}
{% endblock %}

{% block main %}
<main id="main" role="main" class="content">

{% block content %}
<section class="error-404 not-found">
<div class="page-content container">
<p class="h1 mt-4 error-title">404</p>
<h1 class="h3 text-center">
{% if language == 'fr' %}
Cette page est introuvable.
{% elseif language == 'en' %}
That page can't be found.
{% elseif language == 'de' %}
Diese Seite konnte nicht gefunden werden.
{% endif %}
</h1>
<div class="mt-5 pt-2">
<form action="#" class="border-0 p-0">
<div class="search-form mt-1 input-group">
{% if language == 'fr' %}
<label for="search" class="sr-only">Rechercher sur le site</label>
<input type="text" class="form-control" name="search" placeholder="Rechercher sur le site" >
<button type="submit" class="d-none d-xl-block btn btn-primary input-group-append">Valider</button>
{% elseif language == 'en' %}
<label for="search" class="sr-only">Search on the site</label>
<input type="text" class="form-control" name="search" placeholder="Search on the site" >
<button type="submit" class="d-none d-xl-block btn btn-primary input-group-append">Validate</button>
{% elseif language == 'de' %}
<label for="search" class="sr-only">Suchen</label>
<input type="text" class="form-control" name="search" placeholder="Suchen" >
<button type="submit" class="d-none d-xl-block btn btn-primary input-group-append">Bestätigen</button>
{% endif %}
</div>
</form>
</div>
</div>
</section>
{% endblock %}

</main>
{% endblock %}
2 changes: 2 additions & 0 deletions assets/components/pages/error-404/error-404.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: error-404
title: Error 404

0 comments on commit 79fea5f

Please sign in to comment.