templates/bundles/TwigBundle/Exception/error.html.twig line 1

Open in your IDE?
  1. {% extends 'layout_printable.html.twig' %}
  2. {% block javascripts %}
  3.     {{ parent() }}
  4.     <style>
  5.         .main-container {
  6.             display: flex;
  7.             flex-direction: column;
  8.             align-items: center;
  9.             height: 100vh;
  10.         }
  11.         .error-section {
  12.             background-color: #ffdddd;
  13.             padding: 20px;
  14.             border-radius: 5px;
  15.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  16.             text-align: center;
  17.             margin-bottom: 20px;
  18.             width: 80%;
  19.         }
  20.         .form-container {
  21.             background-color: #ffffff;
  22.             padding: 20px;
  23.             border-radius: 5px;
  24.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  25.             width: 800px;
  26.         }
  27.         .user-info {
  28.             text-align: center;
  29.             padding-bottom: 30px;
  30.         }
  31.         .user-info > h3 {
  32.             margin: 0;
  33.         }
  34.         .request-url {
  35.             border: none;
  36.             outline: none;
  37.         }
  38.         label {
  39.             font-weight: lighter;
  40.             font-size: 12px;
  41.         }
  42.         input, textarea {
  43.             width: 100%;
  44.             padding: 10px;
  45.             margin-bottom: 12px;
  46.             border: 1px solid #ccc;
  47.             border-radius: 4px;
  48.             box-sizing: border-box;
  49.         }
  50.         .error-footer span {
  51.             display: block;
  52.             color: red;
  53.             font-size: 14px;
  54.             margin-bottom: 5px;
  55.         }
  56.         .error-footer span a {
  57.             color: blue;
  58.         }
  59.         .error-footer a {
  60.             color: red;
  61.             text-decoration: underline;
  62.         }
  63.         .btn-green {
  64.             background-color: #5bbc84; color: #fff;
  65.             border: none;
  66.             padding: 0.5rem 1rem;
  67.             border-radius: 3px;
  68.             cursor: pointer;
  69.         }
  70.         .url {
  71.             display: flex;
  72.             align-content: center;
  73.         }
  74.         .url input {
  75.             padding: 0;
  76.         }
  77.     </style>
  78.     <script>
  79.         document.addEventListener('DOMContentLoaded', function () {
  80.             var emailInput = document.getElementById('error_form_email_first');
  81.             var confirmEmailInput = document.getElementById('error_form_email_second');
  82.             var submitButton = document.querySelector('#errorSubmitForm button');
  83.             var errorMessage = document.getElementById('error_message');
  84.             function validateAndEnableSubmit() {
  85.                 var emailValue = emailInput.value.trim();
  86.                 var confirmEmailValue = confirmEmailInput.value.trim();
  87.                 if (emailValue !== '' && confirmEmailValue !== '' && emailValue === confirmEmailValue) {
  88.                     submitButton.removeAttribute('disabled');
  89.                     errorMessage.textContent = '';
  90.                 } else {
  91.                     submitButton.setAttribute('disabled', 'disabled');
  92.                     errorMessage.textContent = 'Emails do not match';
  93.                 }
  94.             }
  95.             emailInput.addEventListener('input', validateAndEnableSubmit);
  96.             confirmEmailInput.addEventListener('input', validateAndEnableSubmit);
  97.         });
  98.     </script>
  99. {% endblock %}
  100. {% block content %}
  101.     <div class="main-container">
  102.         <div class="error-section">
  103.             <h2 style="color: #e34646;">
  104.                 Error: {{ statusCode }}
  105.                 {% if statusCode == 500 %}
  106.                     Internal Server Error
  107.                 {% elseif statusCode == 404 %}
  108.                     Not Found
  109.                 {% elseif statusCode == 403 %}
  110.                     Forbidden
  111.                 {% elseif statusCode == 401 %}
  112.                     Unauthorized
  113.                 {% elseif statusCode == 400 %}
  114.                     Bad Request
  115.                 {% else %}
  116.                     Unknown Error
  117.                 {% endif %}
  118.             </h2>
  119.             <h3 style="color: #d85555; font-weight: normal">Message : {{ exception.message }}</h3>
  120.         </div>
  121.         {% if app.user %}
  122.             <div class="form-container">
  123.                 <div class="user-info">
  124.                     <h3>{{ app.user.email }}</h3>
  125.                     <h3>{{ app.user.type }}</h3>
  126.                 </div>
  127.                 {{ form_start(form, {'attr': {'id': 'errorSubmitForm' ,'action': path('error_submt')}}) }}
  128.                 <div class="url">
  129.                     <span >URL:</span>
  130.                     <input type="text" name="request-url" class="request-url" value=" {{ app.request.uri }}" readonly>
  131.                 </div>
  132.                 <div class="form-column">
  133.                     {{ form_row(form.message) }}
  134.                 </div>
  135.                 <span>Screenshots or Other files</span>
  136.                 <div class="form-column">
  137.                     {{ form_row(form.image) }}
  138.                 </div>
  139.                 <div class="form-column">
  140.                     {{ form_row(form.email) }}
  141.                     <p style="padding: 0; margin: 0">We will use this email to contact you about any updates on your request.</p>
  142.                 </div>
  143.                 <p id="error_message" style="color: red;"></p>
  144.                 <input type="hidden" name="exception_error" value="{{ exception }}">
  145.                 <input type="hidden" name="exception_file" value="{{ exception.file }}">
  146.                 <input type="hidden" name="exception_message" value="{{ exception. message }}">
  147.                 <input type="hidden" name="exception_code" value="{{ statusCode }}">
  148.                 <div class="form-column">
  149.                     <button class="btn-green " type="submit" disabled>Submit</button>
  150.                 </div>
  151.                 {{ form_end(form) }}
  152.                 <div class="error-footer">
  153.                     <span>This is custom error, please file a support ticket with screenshots of error by clicking <a href="#">here</a></span>
  154.                     <p>We've been notified about this issue and we'll take a look at it shortly. thank you for your patience.</p>
  155.                 </div>
  156.             </div>
  157.         {% else %}
  158.             <span>Go to home page <a href="{{ path('app_home') }}">click here</a></span>
  159.         {% endif %}
  160.     </div>
  161. {% endblock %}