Skip to content

Commit

Permalink
Merge pull request #10 from qub-it/NewFeature/20250122/AddsErrorCodeP…
Browse files Browse the repository at this point in the history
…ages

Adds error 404 and 403 pages to base-theme
  • Loading branch information
duarte-miranda authored Feb 7, 2025
2 parents 1cdf26e + 7b622f8 commit 90b6f62
Show file tree
Hide file tree
Showing 6 changed files with 490 additions and 145 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- Improvement: Updates 500 error page with js support form submission [#qubIT-Omnis-8481]
- Improvement: Adds 403 and 404 error pages [#qubIT-Omnis-8252]
- Improvement: Adds default userNotFound html [#qubIT-Omnis-8411]

2.12.2 (05-11-2024)
- Refactor: Replaces calls to helpdesk report controller with calls to default support request handler [#qubIT-Support-8445]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,22 @@ 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:

label.error.backButtonCaption=Back to Homepage

#Error 403 labels
title.not.authorized = Unauthorized
error.not.authorized = You are not authorized to view this information.

#Error 404 labels
title.not.found = Resource Not Found
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.

#Error 500 labels
label.error.occurred=An error occured
label.error.occurred.detail=An unexpected error occured. We're sorry for the inconvenience. Please try again later.
label.error.500.successSupportSubmition=Report sent successfully!
label.error.500.errorSupportSubmition=Report submition failed, please try again.
label.error.500.reportError=Send us the error
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,21 @@ 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:

label.error.backButtonCaption=Voltar à página inicial

#Error 403 labels
title.not.authorized = Não autorizado
error.not.authorized = Não tem autorização para visualizar esta informação.

#Error 404 labels
title.not.found = Recurso Não Encontrado
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.

#Error 500 labels
label.error.occurred=Ocorreu um erro
label.error.occurred.detail=Aconteceu um erro inesperado. Lamentos qualquer inconveniente causado. Por favor, tente mais tarde.
label.error.500.successSupportSubmition=Pedido submetido com sucesso!
label.error.500.errorSupportSubmition=Pedido não enviado, por favor tente novamente.
label.error.500.reportError=Envie-nos o erro
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="{{fullLoginPath}}">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="{% if contexPath is empty %}/{% else %}{{contextPath}}{% endif %}">{{i18n('resources.ULisboaThemeResources', 'label.error.backButtonCaption')}}</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="{{fullLoginPath}}">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="{% if contexPath is empty %}/{% else %}{{contextPath}}{% endif %}">{{i18n('resources.ULisboaThemeResources', 'label.error.backButtonCaption')}}</a></p>
{% endif %}
</div>
</div>
</body>
Loading

0 comments on commit 90b6f62

Please sign in to comment.