Skip to content

Commit

Permalink
Fix the cyclic login path in error pages
Browse files Browse the repository at this point in the history
Relates with: #qubIT-Omnis-8478
  • Loading branch information
duarte-miranda committed Feb 4, 2025
1 parent 42676b4 commit 734dc6d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ label.quality.mode=Quality Environment: All changes made will be lost on the nex
label.development.mode=Development Environment
label.database.last.tick=Data from:

title.not.found = Resource Not Found
title.not.authorized = Unauthorized
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
Expand Up @@ -37,9 +37,20 @@ label.quality.mode=Ambiente de Qualidade: As altera
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
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.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
4 changes: 2 additions & 2 deletions base-theme/src/main/webapp/themes/ulisboa/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<p>{{i18n('resources.ULisboaThemeResources', 'error.not.authorized')}}</p>
<br />
{% if currentUser is empty %}
<p><a id="goToLogin" href="{{loginPage}}">Login</a></p>
<p><a id="goToLogin" href="{{contextPath}}/{{loginPage}}">Login</a></p>
<script>
var link = document.getElementById("goToLogin");
var href = link.href;
Expand All @@ -91,7 +91,7 @@

</script>
{% else %}
<p><a href="{{contextPath}}">{{basicLocalization.back()}}</a></p>
<p><a href="{{contextPath}}">{{i18n('resources.ULisboaThemeResources', 'label.error.backButtonCaption')}}</a></p>
{% endif %}
</div>
</div>
Expand Down
60 changes: 30 additions & 30 deletions base-theme/src/main/webapp/themes/ulisboa/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,38 +60,38 @@
</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 }}"/>
<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="{{contextPath}}/{{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 %}
<img src="{{contextPath}}/api/bennu-portal/configuration/logo"/>
<p><a href="{{contextPath}}">{{i18n('resources.ULisboaThemeResources', 'label.error.backButtonCaption')}}</a></p>
{% 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 734dc6d

Please sign in to comment.