{% extends 'layout_printable.html.twig' %}
{% block javascripts %}
{{ parent() }}
<style>
.main-container {
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
}
.error-section {
background-color: #ffdddd;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
margin-bottom: 20px;
width: 80%;
}
.form-container {
background-color: #ffffff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 800px;
}
.user-info {
text-align: center;
padding-bottom: 30px;
}
.user-info > h3 {
margin: 0;
}
.request-url {
border: none;
outline: none;
}
label {
font-weight: lighter;
font-size: 12px;
}
input, textarea {
width: 100%;
padding: 10px;
margin-bottom: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error-footer span {
display: block;
color: red;
font-size: 14px;
margin-bottom: 5px;
}
.error-footer span a {
color: blue;
}
.error-footer a {
color: red;
text-decoration: underline;
}
.btn-green {
background-color: #5bbc84; color: #fff;
border: none;
padding: 0.5rem 1rem;
border-radius: 3px;
cursor: pointer;
}
.url {
display: flex;
align-content: center;
}
.url input {
padding: 0;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
var emailInput = document.getElementById('error_form_email_first');
var confirmEmailInput = document.getElementById('error_form_email_second');
var submitButton = document.querySelector('#errorSubmitForm button');
var errorMessage = document.getElementById('error_message');
function validateAndEnableSubmit() {
var emailValue = emailInput.value.trim();
var confirmEmailValue = confirmEmailInput.value.trim();
if (emailValue !== '' && confirmEmailValue !== '' && emailValue === confirmEmailValue) {
submitButton.removeAttribute('disabled');
errorMessage.textContent = '';
} else {
submitButton.setAttribute('disabled', 'disabled');
errorMessage.textContent = 'Emails do not match';
}
}
emailInput.addEventListener('input', validateAndEnableSubmit);
confirmEmailInput.addEventListener('input', validateAndEnableSubmit);
});
</script>
{% endblock %}
{% block content %}
<div class="main-container">
<div class="error-section">
<h2 style="color: #e34646;">
Error: {{ statusCode }}
{% if statusCode == 500 %}
Internal Server Error
{% elseif statusCode == 404 %}
Not Found
{% elseif statusCode == 403 %}
Forbidden
{% elseif statusCode == 401 %}
Unauthorized
{% elseif statusCode == 400 %}
Bad Request
{% else %}
Unknown Error
{% endif %}
</h2>
<h3 style="color: #d85555; font-weight: normal">Message : {{ exception.message }}</h3>
</div>
{% if app.user %}
<div class="form-container">
<div class="user-info">
<h3>{{ app.user.email }}</h3>
<h3>{{ app.user.type }}</h3>
</div>
{{ form_start(form, {'attr': {'id': 'errorSubmitForm' ,'action': path('error_submt')}}) }}
<div class="url">
<span >URL:</span>
<input type="text" name="request-url" class="request-url" value=" {{ app.request.uri }}" readonly>
</div>
<div class="form-column">
{{ form_row(form.message) }}
</div>
<span>Screenshots or Other files</span>
<div class="form-column">
{{ form_row(form.image) }}
</div>
<div class="form-column">
{{ form_row(form.email) }}
<p style="padding: 0; margin: 0">We will use this email to contact you about any updates on your request.</p>
</div>
<p id="error_message" style="color: red;"></p>
<input type="hidden" name="exception_error" value="{{ exception }}">
<input type="hidden" name="exception_file" value="{{ exception.file }}">
<input type="hidden" name="exception_message" value="{{ exception. message }}">
<input type="hidden" name="exception_code" value="{{ statusCode }}">
<div class="form-column">
<button class="btn-green " type="submit" disabled>Submit</button>
</div>
{{ form_end(form) }}
<div class="error-footer">
<span>This is custom error, please file a support ticket with screenshots of error by clicking <a href="#">here</a></span>
<p>We've been notified about this issue and we'll take a look at it shortly. thank you for your patience.</p>
</div>
</div>
{% else %}
<span>Go to home page <a href="{{ path('app_home') }}">click here</a></span>
{% endif %}
</div>
{% endblock %}