Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sentry User Feedback #330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions core/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "public_layout.html" %}
{% load i18n %}
{% load raven %}

{% block head_title %}{% trans "Internal Server Error" %}{% endblock head_title %}

Expand All @@ -9,7 +10,24 @@
<div class="col-md-8">
<h1>{% trans "Internal Server Error" %}</h1>
<h3>{% trans "I'm sorry, that page is currently unavailable due to a server misconfiguration. The server administrator has been notified, and we apologise for any inconvenience." %}</h3>
<div class="row">
<div class="col-md-3 col-md-offset-5">
<button id="#report-sentry" class="btn-flat info text-center">Report Bug</button>
</div>
</div>
</div>
<div class="col-md-2"></div>
</div>

<script src="https://cdn.ravenjs.com/3.18.1/raven.min.js" crossorigin="anonymous"></script>
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
{% if request.sentry.id %}
<script>
document.getElementById('#report-sentry').addEventListener('click', showReportDialog, false);

function showReportDialog() {
Raven.showReportDialog({eventId: '{{ request.sentry.id }}'});
};
</script>
{% endif %}
{% endblock content %}
4 changes: 4 additions & 0 deletions speakerfight/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from django.contrib import admin
from django.contrib.staticfiles.urls import static

from vanilla import TemplateView


urlpatterns = (
url(r'^admin/', admin.site.urls),
Expand All @@ -27,3 +29,5 @@
urlpatterns += (
url(r'^__debug__/', include(debug_toolbar.urls)),
)

handler500 = TemplateView.as_view(template_name='500.html')