<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="fragments/base"
      th:with="lang=${#locale.language}" th:lang="${lang}">

<head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">´
  <title th:text="#{gui.errorpage.msg.title}">An error arise ...  </title>

  <link rel="stylesheet" href="../webcontent/css/bootstrap.min.css" th:href="@{/static/css/bootstrap.min.css}">
  <link rel="stylesheet" href="../webcontent/css/layout.css" th:href="@{/static/css/layout.css}">
  <link rel="stylesheet" href="../webcontent/css/custom.css" th:href="@{/static/css/custom.css}">

  <script src="../webcontent/js/jquery-3.6.0.min.js" th:src="@{/static/js/jquery-3.6.0.min.js}"></script>
  <script src="../webcontent/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"></script>

</head>

<body>

  <!-- page header -->
  <div class="container-fluid hintergrund clearfix"
       th:insert="~{fragments/common_parts.html :: header (showLang='false')}">
  </div>

  <!-- page containt -->
  <div class="container">
    <div class="row text justify-content-center">

      <!-- Error-Page for special cases -->
      <div  th:if="${errorCode == 'auth.21'}"
            class="col-11 col-md-10 col-lg-7" role="main">
        <h1 role="heading" th:text="#{gui.errorpage.msg.title.userstop}">Process stopped</h1>

        <div id="alert_area" class="col-11 mt-3 justify-content-center align-items-center" role="alert">
          <p th:text="${#messages.msg('gui.errorpage.extcode.__${extErrorCode}__')}">Process stopped by user</p>
        </div>
        <div th:if="${supportTicket == null}" class="col">
          <p th:text="${#messages.msg('gui.errorpage.msg.troubleshooting.extcode.__${extErrorCode}__')}">How to fix the error ...  </p>
        </div>
      </div>


      <!-- generic error page -->
      <div  th:unless="${errorCode == 'auth.21'}"
            class="col-11 col-md-10 col-lg-7" role="main">
        <h1 role="heading" th:text="#{gui.errorpage.msg.title}">Error Header</h1>

        <div id="alert_area" class="col-11 mt-3 justify-content-center align-items-center" role="alert">
          <p th:text="#{gui.errorpage.msg.information}">General error information</p>

          <div class="col">
            <h2 th:text="#{gui.errorpage.msg.reason.title}">Error reason</h2>
            <!-- detailed error message -->
            <!--p th:text="${#messages.msgWithParams('__${errorCode}__', '__${errorParams}__')}"></p-->

            <!-- general error message -->
            <p th:text="${#messages.msg('gui.errorpage.extcode.__${extErrorCode}__')}">Error message</p>
          </div>

          <div class="col">
            <h2 th:text="#{gui.errorpage.msg.troubleshooting.title}">Troubleshooting</h2>

            <div th:if="${supportTicket == null}" class="col">
              <p th:text="${#messages.msg('gui.errorpage.msg.troubleshooting.extcode.__${extErrorCode}__')}">How to fix the error ...  </p>
            </div>
            <div th:unless="${supportTicket == null}" class="col">
              <p th:text="#{gui.errorpage.msg.troubleshooting.general.msg.1}">General error information</p>
              <ul>
                <li><a href="mailto:buergerservice.oegv@brz.gv.at"> buergerservice.oegv@brz.gv.at </a></li>
                <li>
                  <a href="tel:004350233770" target="_blank">+43 50 233770</a>
                  <span th:text="#{gui.errorpage.msg.troubleshooting.general.msg.tel}">, erreichbar von Montag bis Freitag, 8:00-16:00</span>
                </li>
              </ul>
              <p th:text="#{gui.errorpage.msg.troubleshooting.general.msg.2}">More General error information</p>
            </div>
          </div>

          <div class="col">
            <h2 th:text="#{gui.errorpage.msg.technical.title}">Technical Infos</h2>

            <ul>
              <li>
                <!-- internal errorCodes -->
                <!--span><b th:text="#{gui.errorpage.msg.errorcode}">Code:</b> <span th:text="${errorCode}"></span></span-->

                <!-- grouped external errorCodes -->
                <span><b th:text="#{gui.errorpage.msg.errorcode}">Code:</b> <span th:text="${extErrorCode}">ErrorCode</span></span>
              </li>

              <li th:unless="${supportTicket == null}">
                <span><b th:text="#{gui.errorpage.msg.transactionId}"> TransactionsId:</b> <span th:text="${supportTicket}">TransactionId</span></span>
              </li>

              <li>
                <span><b th:text="#{gui.errorpage.msg.timestamp}"> Timestamp:</b> <span th:text="${#calendars.format(#calendars.createNow(),'dd-MM-yyyy HH:mm:ss')}">DateTime</span></span>
              </li>

            </ul>
          </div>

          <div class="col mb-2" th:if="${stacktrace}">
            <span><b th:text="#{gui.errorpage.msg.stacktrace}">fullError</b> <span th:text="${stacktrace}">StackTrace</span></span>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- page footer -->
  <footer class="hidden-print"
          th:replace="~{fragments/common_parts.html :: footer}">
  </footer>

</body>
</html>
