check if custom temaplates

This commit is contained in:
fz 2024-11-05 17:37:30 +01:00
parent 24c965c92d
commit 5d4568de1d
7 changed files with 9 additions and 183 deletions

View File

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}" xmlns:th="https://www.thymeleaf.org">
<head>
<th:block th:insert="~{fragments/common :: head(title=#{error.404.head})}"></th:block>
</head>
<body>
<div id="page-container">
<div id="content-wrap">
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
<div class="container">
<div th:insert="~{fragments/errorBanner.html :: errorBanner}"></div>
<div class="bg-card text-center">
<h1 class="display-2" th:text="#{oops}"></h1>
<p class="lead" th:if="${param.status == '404'}" th:text="#{error.404.1}"></p>
<p class="lead" th:unless="${param.status == '404'}" th:text="#{error.404.2}"></p>
<br>
<h2 th:text="#{error.needHelp}"></h2>
<p>If you're still having trouble, don't hesitate to reach out to us for help. You can submit a ticket:</p>
<div id="button-group">
<a href="https://konfuzio.com/support" id="github-button" class="btn btn-primary" target="_blank">Submit a ticket</a>
</div>
<a th:href="@{'/'}" id="home-button" class="home-button btn btn-primary" th:text="#{goHomepage}"></a>
</div>
</div>
</div>
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
</div>
</body>
</html>

View File

@ -1,75 +0,0 @@
<th:block th:fragment="errorBanner">
<br th:if="${message}">
<div id="errorContainer" th:if="${message}" class="alert alert-danger alert-dismissible alert-container fade show" role="alert">
<div class="alert-header d-flex">
<span class="alert-heading" th:text="'Error: ' + ${status} + ' ' + ${error}"></span>
<!-- <button type="button" class="btn btn-danger" th:if="${trace}" onclick="toggletrace()" th:text="#{error.showStack}"></button> -->
<!-- <button type="button" class="btn btn-secondary" th:if="${trace}" onclick="copytrace()" th:text="#{error.copyStack}"></button> -->
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="dismissError()">
<span class="material-symbols-rounded">
close
</span>
</button>
</div>
<p th:text="${message} + ' for path: ' + ${path}"></p>
<!-- Stack trace section -->
<div id="trace" th:if="${trace}" style="max-height: 0; overflow: hidden;">
<div>
<pre id="traceContent" th:text="${trace}"></pre>
</div>
<!-- Buttons to submit a ticket on GitHub and join Discord server -->
<a href="https://konfuzoi.com/support" id="github-button" target="_blank" th:text="#{error.github}"></a>
<!-- <a href="https://discord.gg/Cn8pWhQRxZ" id="discord-button" target="_blank" th:text="#{joinDiscord}"></a> -->
</div>
</div>
<script>
var traceVisible = false;
function toggletrace() {
var traceDiv = document.getElementById("trace");
if (!traceVisible) {
traceDiv.style.maxHeight = "500px";
traceVisible = true;
} else {
traceDiv.style.maxHeight = "0px";
traceVisible = false;
}
adjustContainerHeight();
}
function copytrace() {
var flip = false
if (!traceVisible) {
toggletrace()
flip = true
}
var traceContent = document.getElementById("traceContent");
var range = document.createRange();
range.selectNode(traceContent);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
if (flip) {
toggletrace()
}
}
function dismissError() {
var errorContainer = document.getElementById("errorContainer");
errorContainer.style.display = "none";
errorContainer.style.height = "0";
}
function adjustContainerHeight() {
var errorContainer = document.getElementById("errorContainer");
var traceDiv = document.getElementById("trace");
if (traceVisible) {
errorContainer.style.height = errorContainer.scrollHeight - traceDiv.scrollHeight + traceDiv.offsetHeight + "px";
} else {
errorContainer.style.height = "auto";
}
}
</script>
</th:block>

View File

@ -1,52 +0,0 @@
<th:block th:fragment="errorBannerPerPage">
<div id="errorContainer" class="alert alert-danger alert-dismissible fade show" role="alert" style="display: none;">
<h4 class="alert-heading" th:text="#{error}"></h4>
<p></p>
<!-- <button type="button" class="btn btn-danger" onclick="toggletrace()" th:text="#{error.showStack}"></button> -->
<!-- <button type="button" class="btn btn-secondary" onclick="copytrace()" th:text="#{error.copyStack}"></button> -->
<button type="button" class="btn btn-info" onclick="showHelp()" th:text="#{help}"></button>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="dismissError()">
<span class="material-symbols-rounded">
close
</span>
</button>
<!-- Stack trace section -->
<div id="trace" style="max-height: 0; overflow: hidden;">
<div>
<pre id="traceContent"></pre>
</div>
</div>
</div>
<div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document" id="helpModalDialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="helpModalLabel" th:text="#{help}"></h5>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="dismissError()">
<span class="material-symbols-rounded">
close
</span>
</button>
</div>
<div class="modal-body">
<div class="container">
<div id="support-section">
<h1 class="display-2" th:text="#{oops}"></h1>
<p class="lead" th:text="#{error.sorry}"></p>
<br>
<h2 th:text="#{error.needHelp}"></h2>
<p>"If you're still having trouble, don't hesitate to reach out to us for help. You can submit a ticket:"</p>
<div id="button-group">
<a href="https://konfuzio.com/support" id="github-button" target="_blank">"Submit a ticket"</a>
</div>
<a th:href="@{'/'}" class="home-button" th:text="#{goHomepage}"></a>
<a data-bs-dismiss="modal" class="home-button" th:text="#{close}"></a>
</div>
</div>
</div>
</div>
</div>
</div>
<script th:src="@{'/js/errorBanner.js'}"></script>
</th:block>

View File

@ -1,9 +0,0 @@
<div th:fragment="footer">
<footer id="footer" class="text-center py-3">
<!-- <a href="https://github.com/Frooodle/Stirling-PDF" target="_blank" class="mx-1" title="Visit Github Repository"><img src="images/github.svg"></img></a>
<a href="https://hub.docker.com/r/frooodle/s-pdf" target="_blank" class="mx-1" title="See Docker Hub"><img src="images/docker.svg"></img></a>
<a href="https://discord.gg/Cn8pWhQRxZ" target="_blank" class="mx-1" title="Join Discord Channel"><img src="images/discord.svg"></img></a>
<a href="https://github.com/sponsors/Frooodle" target="_blank" class="mx-1" title="Donate"><img src="images/suit-heart-fill.svg"></img></a>-->
<div th:if="${@appName} != 'Stirling PDF'" class="mt-2" style="color: grey;">License</div>
</footer>
</div>

View File

@ -16,10 +16,9 @@
<p class="lead" th:unless="${param.status == '404'}" th:text="#{error.404.2}"></p>
<br>
<h2 th:text="#{error.needHelp}"></h2>
<p th:text="#{error.contactTip}"></p>
<p>If you're still having trouble, don't hesitate to reach out to us for help. You can submit a ticket:</p>
<div id="button-group">
<a href="https://github.com/Stirling-Tools/Stirling-PDF/issues" id="github-button" class="btn btn-primary" target="_blank" th:text="#{error.github}"></a>
<a href="https://discord.gg/Cn8pWhQRxZ" id="discord-button" class="btn btn-primary" target="_blank" th:text="#{joinDiscord}"></a>
<a href="https://konfuzio.com/support" id="github-button" class="btn btn-primary" target="_blank">Submit a ticket</a>
</div>
<a th:href="@{'/'}" id="home-button" class="home-button btn btn-primary" th:text="#{goHomepage}"></a>
</div>
@ -28,4 +27,4 @@
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
</div>
</body>
</html>
</html>

View File

@ -19,8 +19,8 @@
<pre id="traceContent" th:text="${trace}"></pre>
</div>
<!-- Buttons to submit a ticket on GitHub and join Discord server -->
<a href="https://github.com/Stirling-Tools/Stirling-PDF/issues" id="github-button" target="_blank" th:text="#{error.github}"></a>
<a href="https://discord.gg/Cn8pWhQRxZ" id="discord-button" target="_blank" th:text="#{joinDiscord}"></a>
<a href="https://konfuzio.com/support" id="github-button" target="_blank" th:text="#{error.github}"></a>
<!-- <a href="https://discord.gg/Cn8pWhQRxZ" id="discord-button" target="_blank" th:text="#{joinDiscord}"></a> -->
</div>
</div>
<script>

View File

@ -2,20 +2,14 @@
<div id="errorContainer" class="alert alert-danger alert-dismissible fade show" role="alert" style="display: none;">
<h4 class="alert-heading" th:text="#{error}"></h4>
<p></p>
<button type="button" class="btn btn-danger" onclick="toggletrace()" th:text="#{error.showStack}"></button>
<button type="button" class="btn btn-secondary" onclick="copytrace()" th:text="#{error.copyStack}"></button>
<!-- <button type="button" class="btn btn-danger" onclick="toggletrace()" th:text="#{error.showStack}"></button> -->
<!-- <button type="button" class="btn btn-secondary" onclick="copytrace()" th:text="#{error.copyStack}"></button> -->
<button type="button" class="btn btn-info" onclick="showHelp()" th:text="#{help}"></button>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close" onclick="dismissError()">
<span class="material-symbols-rounded">
close
</span>
</button>
<!-- Stack trace section -->
<div id="trace" style="max-height: 0; overflow: hidden;">
<div>
<pre id="traceContent"></pre>
</div>
</div>
</div>
<div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
@ -36,10 +30,9 @@
<p class="lead" th:text="#{error.sorry}"></p>
<br>
<h2 th:text="#{error.needHelp}"></h2>
<p th:text="#{error.contactTip}"></p>
<p>"If you're still having trouble, don't hesitate to reach out to us for help. You can submit a ticket:"</p>
<div id="button-group">
<a href="https://github.com/Stirling-Tools/Stirling-PDF/issues" id="github-button" target="_blank" th:text="#{error.githubSubmit}"></a>
<a href="https://discord.gg/Cn8pWhQRxZ" id="discord-button" target="_blank" th:text="#{error.discordSubmit}"></a>
<a href="https://konfuzio.com/support" id="github-button" target="_blank">"Submit a ticket"</a>
</div>
<a th:href="@{'/'}" class="home-button" th:text="#{goHomepage}"></a>
<a data-bs-dismiss="modal" class="home-button" th:text="#{close}"></a>