Skip to content

Commit

Permalink
Merge pull request getsentry#809 from eternicode/django-1.5-url-tag
Browse files Browse the repository at this point in the history
Django 1.5 compatibility: url tag
  • Loading branch information
dcramer committed Feb 28, 2013
2 parents 72b353b + b9b787e commit 0ded17f
Show file tree
Hide file tree
Showing 81 changed files with 328 additions and 247 deletions.
3 changes: 2 additions & 1 deletion example/templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

Expand All @@ -6,7 +7,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="NONE,NOARCHIVE">
<link href="{% url sentry-media "sentry" "styles/global.min.css" %}" rel="stylesheet" type="text/css"/>
<link href="{% url 'sentry-media' "sentry" "styles/global.min.css" %}" rel="stylesheet" type="text/css"/>
<title>{% block title %}Sentry{% endblock %}</title>
{% block meta %}
{% endblock %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/layout.html" %}

{% load url from future %}
{% load i18n %}

{% block title %}{% trans "Page Not Found" %} | {{ block.super }}{% endblock %}
Expand All @@ -13,6 +14,6 @@
<h2>{% trans "Page Not Found" %}</h2>
</div>
<p class="alert-message notice">{% trans "The page you are looking for was not found." %}</p>
<p><a href="{% url sentry %}">{% trans "Return to the dashboard" %}</a></p>
<p><a href="{% url 'sentry' %}">{% trans "Return to the dashboard" %}</a></p>
</section>
{% endblock %}
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/account/appearance.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/account/base.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}
Expand All @@ -9,7 +10,7 @@
{% block breadcrumb %}
{{ block.super }}
<li class="divider"></li>
<li><a href="{% url sentry-account-settings %}">{% trans "Account" %}</a></li>
<li><a href="{% url 'sentry-account-settings' %}">{% trans "Account" %}</a></li>
{% endblock %}

{% block heading %}
Expand Down
11 changes: 6 additions & 5 deletions src/sentry/templates/sentry/account/base.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% extends "sentry/layout.html" %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Settings" %} | {{ block.super }}{% endblock %}

{% block page_header %}
<ul class="breadcrumb">
<li><a href="{% url sentry %}" class="dashboard-btn" title="{% trans "Dashboard" %}"><i aria-hidden="true" class="icon-list"></i></a></li>
<li><a href="{% url 'sentry' %}" class="dashboard-btn" title="{% trans "Dashboard" %}"><i aria-hidden="true" class="icon-list"></i></a></li>
<li class="divider"></li>
<li><a href="#">{% trans "Settings" %}</a></li>
{% block breadcrumb %}{% endblock %}
Expand All @@ -34,9 +35,9 @@
{% block sidebar %}
<ul class="nav nav-list">
<li class="nav-header">{% trans "Settings" %}</li>
<li{% if page == 'settings' %} class="active"{% endif %}><a href="{% url sentry-account-settings %}">{% trans "Account" %}</a></li>
<li{% if page == 'appearance' %} class="active"{% endif %}><a href="{% url sentry-account-settings-appearance %}">{% trans "Appearance" %}</a></li>
<li{% if page == 'notifications' %} class="active"{% endif %}><a href="{% url sentry-account-settings-notifications %}">{% trans "Notifications" %}</a></li>
<li{% if page == 'identities' %} class="active"{% endif %}><a href="{% url sentry-account-settings-identities %}">{% trans "Identities" %}</a></li>
<li{% if page == 'settings' %} class="active"{% endif %}><a href="{% url 'sentry-account-settings' %}">{% trans "Account" %}</a></li>
<li{% if page == 'appearance' %} class="active"{% endif %}><a href="{% url 'sentry-account-settings-appearance' %}">{% trans "Appearance" %}</a></li>
<li{% if page == 'notifications' %} class="active"{% endif %}><a href="{% url 'sentry-account-settings-notifications' %}">{% trans "Notifications" %}</a></li>
<li{% if page == 'identities' %} class="active"{% endif %}><a href="{% url 'sentry-account-settings-identities' %}">{% trans "Identities" %}</a></li>
</ul>
{% endblock %}
7 changes: 4 additions & 3 deletions src/sentry/templates/sentry/account/identities.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/account/base.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}
Expand All @@ -9,7 +10,7 @@
{% block breadcrumb %}
{{ block.super }}
<li class="divider"></li>
<li><a href="{% url sentry-account-settings-identities %}">{% trans "Identities" %}</a></li>
<li><a href="{% url 'sentry-account-settings-identities' %}">{% trans "Identities" %}</a></li>
{% endblock %}

{% block heading %}
Expand All @@ -35,7 +36,7 @@
<tr>
<td>{{ identity.provider|title }}</td>
<td style="text-align: center;">
<a href="{% url socialauth_disconnect_individual identity.provider identity.id %}?next={% filter urlencode %}{% absolute_uri %}{% endfilter %}">Disconnect</a>
<a href="{% url 'socialauth_disconnect_individual' identity.provider identity.id %}?next={% filter urlencode %}{% absolute_uri %}{% endfilter %}">Disconnect</a>
</td>
</tr>
{% endfor %}
Expand All @@ -48,7 +49,7 @@
</fieldset>
<ul class="auth-options">
{% for engine in AUTH_PROVIDERS %}
<li><a href="{% url socialauth_associate_begin engine %}?next={% filter urlencode %}{% absolute_uri %}{% endfilter %}" class="auth-{{ engine }}">Identify with {{ engine|title }}</a></li>
<li><a href="{% url 'socialauth_associate_begin' engine %}?next={% filter urlencode %}{% absolute_uri %}{% endfilter %}" class="auth-{{ engine }}">Identify with {{ engine|title }}</a></li>
{% endfor %}
</ul>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/account/notifications.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/account/base.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}
Expand All @@ -9,7 +10,7 @@
{% block breadcrumb %}
{{ block.super }}
<li class="divider"></li>
<li><a href="{% url sentry-account-settings-notifications %}">{% trans "Notifications" %}</a></li>
<li><a href="{% url 'sentry-account-settings-notifications' %}">{% trans "Notifications" %}</a></li>
{% endblock %}

{% block heading %}
Expand Down
5 changes: 3 additions & 2 deletions src/sentry/templates/sentry/account/recover/failure.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/layout.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}

Expand All @@ -13,7 +14,7 @@
<div class="page-header">
<h2>{% trans "Recover Account" %}</h2>
</div>
{% url sentry-recover-account as link %}
{% url 'sentry-recover-account' as link %}
<p>{% blocktrans %}We were unable to confirm your identity. Either the link you followed is invalid, or it has expired. You can always <a href="{{ link }}">try again</a>.{% endblocktrans %}</p>
</section>
{% endblock %}
{% endblock %}
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/account/settings.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/account/base.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}
Expand All @@ -9,7 +10,7 @@
{% block breadcrumb %}
{{ block.super }}
<li class="divider"></li>
<li><a href="{% url sentry-account-settings %}">{% trans "Account" %}</a></li>
<li><a href="{% url 'sentry-account-settings' %}">{% trans "Account" %}</a></li>
{% endblock %}

{% block heading %}
Expand Down
15 changes: 8 additions & 7 deletions src/sentry/templates/sentry/admin/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/layout.html" %}

{% load url from future %}
{% load i18n %}

{% block title %}{% trans "Admin" %} | {{ block.super }}{% endblock %}
Expand All @@ -14,8 +15,8 @@
{% block sidebar %}
<h6>{% trans "Overview" %}</h6>
<ul class="nav nav-tabs nav-stacked">
<li{% block admin-nav-projects %}{% endblock %}><a href="{% url sentry-admin-projects %}">{% trans "Projects" %}</a></li>
<li{% block admin-nav-users %}{% endblock %}><a href="{% url sentry-admin-users %}">{% trans "Users" %}</a></li>
<li{% block admin-nav-projects %}{% endblock %}><a href="{% url 'sentry-admin-projects' %}">{% trans "Projects" %}</a></li>
<li{% block admin-nav-users %}{% endblock %}><a href="{% url 'sentry-admin-users' %}">{% trans "Users" %}</a></li>
</ul>

{% with PLUGINS.for_site as plugins %}
Expand All @@ -24,7 +25,7 @@ <h6>{% trans "Plugins" %}</h6>
<ul class="nav nav-tabs nav-stacked">
{% for p in PLUGINS.for_site %}
<li{% if plugin and plugin.slug == p.slug %} class="active"{% endif %}>
<a href="{% url sentry-admin-configure-plugin p.slug %}">{{ p.get_conf_title }}</a>
<a href="{% url 'sentry-admin-configure-plugin' p.slug %}">{{ p.get_conf_title }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -33,13 +34,13 @@ <h6>{% trans "Plugins" %}</h6>

<h6>{% trans "Server Status" %}</h6>
<ul class="nav nav-tabs nav-stacked">
<li{% block admin-nav-status %}{% endblock %}><a href="{% url sentry-admin-status %}">{% trans "Environment" %}</a></li>
<li{% block admin-nav-packages %}{% endblock %}><a href="{% url sentry-admin-packages-status %}">{% trans "Packages" %}</a></li>
<li{% block admin-nav-mail %}{% endblock %}><a href="{% url sentry-admin-mail-status %}">{% trans "Mail" %}</a></li>
<li{% block admin-nav-status %}{% endblock %}><a href="{% url 'sentry-admin-status' %}">{% trans "Environment" %}</a></li>
<li{% block admin-nav-packages %}{% endblock %}><a href="{% url 'sentry-admin-packages-status' %}">{% trans "Packages" %}</a></li>
<li{% block admin-nav-mail %}{% endblock %}><a href="{% url 'sentry-admin-mail-status' %}">{% trans "Mail" %}</a></li>
</ul>
<h6>{% trans "Statistics" %}</h6>
<ul class="nav nav-tabs nav-stacked">
<li{% block admin-nav-stats %}{% endblock %}><a href="{% url sentry-admin-stats %}">{% trans "Overview" %}</a></li>
<li{% block admin-nav-stats %}{% endblock %}><a href="{% url 'sentry-admin-stats' %}">{% trans "Overview" %}</a></li>
</ul>
{% endblock %}

Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/admin/plugins/configure.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% extends "sentry/admin/base.html" %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}Configure {{ title }} | {{ block.super }}{% endblock %}

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-configure-plugin plugin.slug %}">Configure {{ title }}</a></li>
<li><a href="{% url 'sentry-admin-configure-plugin' plugin.slug %}">Configure {{ title }}</a></li>
{% endblock %}

{% block inner %}
Expand Down
7 changes: 4 additions & 3 deletions src/sentry/templates/sentry/admin/projects/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/admin/base.html" %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}
{% load sentry_admin_helpers %}
Expand All @@ -10,7 +11,7 @@

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-projects %}">{% trans "Projects" %}</a></li>
<li><a href="{% url 'sentry-admin-projects' %}">{% trans "Projects" %}</a></li>
{% endblock %}

{% block main %}
Expand Down Expand Up @@ -50,9 +51,9 @@
{% for project, avg_events in project_list.paginator.objects|with_event_counts %}
<tr>
<td>
<strong>{{ project.name }}</strong> <a href="{% url sentry-stream project.team.slug project.slug %}">[view]</a><br/>
<strong>{{ project.name }}</strong> <a href="{% url 'sentry-stream' project.team.slug project.slug %}">[view]</a><br/>
{% if project.owner %}
<small>Owned by <a href="{% url sentry-admin-edit-user project.owner.pk %}">
<small>Owned by <a href="{% url 'sentry-admin-edit-user' project.owner.pk %}">
{% if project.owner.email %}
{{ project.owner.email }}
{% else %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/admin/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

{% block admin-nav-stats %} class="active"{% endblock %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Stats" %} | {{ block.super }}{% endblock %}

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-stats %}">{% trans "Stats" %}</a></li>
<li><a href="{% url 'sentry-admin-stats' %}">{% trans "Stats" %}</a></li>
{% endblock %}

{% block inner %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/admin/status/env.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

{% block admin-nav-status %} class="active"{% endblock %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Server Status" %} | {{ block.super }}{% endblock %}

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-status %}">{% trans "Server Status" %}</a></li>
<li><a href="{% url 'sentry-admin-status' %}">{% trans "Server Status" %}</a></li>
{% endblock %}

{% block inner %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/admin/status/mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{% block admin-nav-queue %} class="active"{% endblock %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}
Expand All @@ -10,7 +11,7 @@

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-mail-status %}">{% trans "Mail Configuration" %}</a></li>
<li><a href="{% url 'sentry-admin-mail-status' %}">{% trans "Mail Configuration" %}</a></li>
{% endblock %}

{% block inner %}
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/templates/sentry/admin/status/packages.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

{% block admin-nav-packages %} class="active"{% endblock %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Packages" %} | {{ block.super }}{% endblock %}

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-packages-status %}">{% trans "Packages" %}</a></li>
<li><a href="{% url 'sentry-admin-packages-status' %}">{% trans "Packages" %}</a></li>
{% endblock %}

{% block inner %}
Expand Down
7 changes: 4 additions & 3 deletions src/sentry/templates/sentry/admin/users/edit.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/admin/users/list.html" %}

{% load url from future %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_admin_helpers %}
Expand All @@ -10,7 +11,7 @@
{% block breadcrumb %}
{{ block.super }}
<li class="divider"></li>
<li><a href="{% url sentry-admin-edit-user the_user.pk %}">{{ the_user.username }}</a></li>
<li><a href="{% url 'sentry-admin-edit-user' the_user.pk %}">{{ the_user.username }}</a></li>
{% endblock %}

{% block main %}
Expand All @@ -24,7 +25,7 @@
<fieldset class="form-actions">
<button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>
{% if the_user.id != request.user.id %}
<a href="{% url sentry-admin-remove-user the_user.pk %}" class="btn btn-danger">{% trans "Remove User" %}</a>
<a href="{% url 'sentry-admin-remove-user' the_user.pk %}" class="btn btn-danger">{% trans "Remove User" %}</a>
{% else %}
<a href="#" class="btn disabled btn-danger">{% trans "Cannot remove yourself" %}</a>
{% endif %}
Expand All @@ -49,7 +50,7 @@ <h3>{% trans "Projects" %}</h3>
{% for project, avg_events in project_list|with_event_counts %}
<tr>
<td>
{{ project.name }} <a href="{% url sentry-stream project.team.slug project.slug %}">[view]</a>
{{ project.name }} <a href="{% url 'sentry-stream' project.team.slug project.slug %}">[view]</a>
</a>
</td>
<td style="text-align:center; vertical-align:middle;">
Expand Down
7 changes: 4 additions & 3 deletions src/sentry/templates/sentry/admin/users/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "sentry/admin/base.html" %}

{% load url from future %}
{% load i18n %}
{% load sentry_helpers %}

Expand All @@ -9,11 +10,11 @@

{% block breadcrumb %}
<li class="divider"></li>
<li><a href="{% url sentry-admin-users %}">{% trans "Users" %}</a></li>
<li><a href="{% url 'sentry-admin-users' %}">{% trans "Users" %}</a></li>
{% endblock %}

{% block page_header %}
<a href="{% url sentry-admin-new-user %}" class="btn pull-right btn-primary">{% trans "Create a new user" %}</a>
<a href="{% url 'sentry-admin-new-user' %}" class="btn pull-right btn-primary">{% trans "Create a new user" %}</a>
{{ block.super }}
{% endblock %}

Expand Down Expand Up @@ -48,7 +49,7 @@
{% for user in user_list.paginator.objects %}
<tr>
<td>
<a href="{% url sentry-admin-edit-user user.pk %}">
<a href="{% url 'sentry-admin-edit-user' user.pk %}">
{{ user.username }}
</a>
{% if not user.is_active %}
Expand Down
Loading

0 comments on commit 0ded17f

Please sign in to comment.