Skip to content

Commit

Permalink
Adds error 404 and 403 pages to base-theme
Browse files Browse the repository at this point in the history
Relates with:
  • Loading branch information
duarte-miranda committed Jan 24, 2025
1 parent 37920f6 commit 42676b4
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 3 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Improvement: Adds 403 and 404 error pages [#qubIT-Omnis-8252]

2.12.2 (05-11-2024)
2.12.1 (24-10-2024)
- Improvement: Adds tweaks to general.css [#qubIT-Support-810]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ label.orLoginWith=Or login with
label.quality.mode=Quality Environment: All changes made will be lost on the next update
label.development.mode=Development Environment
label.database.last.tick=Data from:
label.database.last.tick=Data from:
title.not.found = Resource Not Found
title.not.authorized = Unauthorized
error.not.authorized = You are not authorized to view this information.
error.not.found = Resource not found
error.not.found.message = Please verify the URL and that you are allowed to view the selected content or try again later.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
link.helpdeskReport = Apoio Fenix (Formulário)
label.helpdesk.form = Formulário de Suporte
label.helpdesk.form.welcome = Este formulário serve para contactar o suporte técnico do sistema. Utilize-o se detectou um erro, tem uma sugestão/pedido ou uma dúvida de utilização.
label.helpdesk.form.welcome = Este formulário serve para contactar o suporte técnico do sistema. Utilize-o se detectou um erro, tem uma sugestão/pedido ou uma dívida de utilização.
label.helpdesk.report.subject = Assunto
label.helpdesk.report.description = Descrição
label.helpdesk.report.description.tooltip = Seja o mais detalhado possível na descrição do problema. Se está a reportar um erro indique os passos necessários para o reproduzir, o resultado esperado e o resultado ocorrido.
label.helpdesk.report.type = Tipo
label.helpdesk.report.type.error = Erro
label.helpdesk.report.type.request = Pedido
label.helpdesk.report.type.question = Dúvida
label.helpdesk.report.type.question = Dívida
label.helpdesk.report.attachment = Anexo
label.helpdesk.report.attachment.file.too.large = O tamanho do anexo carregado excede o tamanho máximo (5MB)!
label.helpdesk.report.attachment.tooltip = De forma a ajudar a equipa de suporte a entender de forma mais precisa a situação reportada, anexe um ficheiro (com o máximo de 5 MB) que ilustre o problema identificado.
Expand Down Expand Up @@ -36,3 +36,10 @@ label.orLoginWith=Ou fazer login com
label.quality.mode=Ambiente de Qualidade: As alterações realizadas serão perdidas na próxima actualização
label.development.mode=Ambiente de Desenvolvimento
label.database.last.tick=Dados de:

title.not.found = Recurso Não Encontrado
title.not.authorized = Não autorizado

error.not.authorized = Não tem autorização para visualizar esta informação.
error.not.found = O recurso que procura não foi encontrado
error.not.found.message = Por favor verifique que o URL está correcto e que tem permissão para aceder ao conteúdo, ou tente mais tarde.
98 changes: 98 additions & 0 deletions base-theme/src/main/webapp/themes/ulisboa/403.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!--
Copyright © 2002 Instituto Superior Técnico
This file is part of FenixEdu Academic.
FenixEdu Academic is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FenixEdu Academic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with FenixEdu Academic. If not, see <http://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>

<head>
<title>
{{i18n('resources.ULisboaThemeResources', 'title.not.authorized')}}
</title>
<link href="{{contextPath}}/bennu-core/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font: 16px 'Roboto', sans-serif;
font-weight:100;
color: #617383;
background-color: #F1F1F1;
}
.container {
margin: 60px auto 0 auto;
max-width: 700px;
background-color: white;
padding: 30px;
border-radius: 7px;
}
.content { margin-top: 25px; }
@media (max-width: 767px) {
.title > * {
text-align: center !important;
}
img {
padding-bottom: 5px;
}
}
.title {
border-bottom: 1px solid #eee;
font-size: 22px;
padding-bottom: 15px;
}
</style>
</head>

<body>
<div class="container">
<div class="title row">
<div class="col-sm-6 text-right col-sm-push-6">
{% if logoResource != null %}
<img src="{{contextPath}}/portalImage?resourceId={{ logoResource.externalId }}"/>
{% else %}
<img src="{{contextPath}}/api/bennu-portal/configuration/logo"/>
{% endif %}
</div>
<div class="col-sm-6 col-sm-pull-6">
{{i18n('resources.ULisboaThemeResources', 'title.not.authorized')}}
</div>
</div>
<div class="content">
<p>{{i18n('resources.ULisboaThemeResources', 'error.not.authorized')}}</p>
<br />
{% if currentUser is empty %}
<p><a id="goToLogin" href="{{loginPage}}">Login</a></p>
<script>
var link = document.getElementById("goToLogin");
var href = link.href;
var callback = window.location.href;
if (callback != null) {
callback = callback.split("#")[0];
link.href= href + "?callback=" + callback;
}else {
link.href = href;
}

</script>
{% else %}
<p><a href="{{contextPath}}">{{basicLocalization.back()}}</a></p>
{% endif %}
</div>
</div>
</body>
97 changes: 97 additions & 0 deletions base-theme/src/main/webapp/themes/ulisboa/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!--
Copyright © 2002 Instituto Superior Técnico
This file is part of FenixEdu Academic.
FenixEdu Academic is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FenixEdu Academic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with FenixEdu Academic. If not, see <http://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>

<head>
<title>
{{i18n('resources.ULisboaThemeResources', 'title.not.found')}}
</title>
<link href="{{contextPath}}/bennu-core/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font: 16px 'Roboto', sans-serif;
font-weight:100;
color: #617383;
background-color: #F1F1F1;
}
.container {
margin: 60px auto 0 auto;
max-width: 700px;
background-color: white;
padding: 30px;
border-radius: 7px;
}
.content { margin-top: 25px; }
@media (max-width: 767px) {
.title > * {
text-align: center !important;
}
img {
padding-bottom: 5px;
}
}
.title {
border-bottom: 1px solid #eee;
font-size: 22px;
padding-bottom: 15px;
}
</style>
</head>

<body>
<div class="container">
<div class="title row">
<div class="col-sm-6 text-right col-sm-push-6">
{% if logoResource != null %}
<img src="{{contextPath}}/portalImage?resourceId={{ logoResource.externalId }}"/>
{% else %}
<img src="{{contextPath}}/api/bennu-portal/configuration/logo"/>
{% endif %}
</div>
<div class="col-sm-6 col-sm-pull-6">
{{i18n('resources.ULisboaThemeResources', 'error.not.found')}}
</div>
</div>
<div class="content">
<p>{{i18n('resources.ULisboaThemeResources', 'error.not.found.message')}}</p>
<br/>
{% if currentUser is empty %}
<p><a id="goToLogin" href="{{loginPage}}">Login</a></p>
<script>
var link = document.getElementById("goToLogin");
var href = link.href;
var callback = window.location.href;
if (callback != null) {
callback = callback.split("#")[0];
link.href= href + "?callback=" + callback;
}else {
link.href = href;
}
</script>
{% else %}
<p><a href="{{contextPath}}">{{basicLocalization.back()}}</a></p>
{% endif %}
</div>
</div>
</body>

0 comments on commit 42676b4

Please sign in to comment.