{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load compress %}

{% block breadcrumbs %}
<li><a href="{% url 'home' %}">{% trans "Internal Server Error" %}</a></li>
{% endblock %}

{% block content %}
<h2>{% trans "Server Error" %}</h2>

{% if sentry_event_id %}

  <p>
    {% blocktrans with error_id=sentry_event_id %}The server had serious problems serving your request, and this error has been recorded as {{ error_id }}.{% endblocktrans %}
  </p>

  {% if sentry_dsn %}
    <script src="{% static "vendor/sentry.js" %}"></script>

    <script>
      Sentry.init({ dsn: '{{ sentry_dsn }}' });
      Sentry.showReportDialog({
        {% if request.user.is_authenticated %}
          user: { name: "{{ user.full_name}}", email: "{{ user.email}}" },
        {% endif %}
        eventId: '{{ sentry_event_id }}'
      })
    </script>
  {% endif %}

{% else %}

  <p>
    {% blocktrans %}The server had serious problems serving your request. You might want to contact server admins in case the error persists.{% endblocktrans %}
  </p>

{% endif %}

{% endblock %}
