Use {% load url from future %} in team templates

Using https://github.com/futurecolors/django-future-url
This commit is contained in:
Rebecca Lovewell 2014-01-15 08:59:55 -05:00
parent 41aab58d7b
commit b2f41b81f4

View file

@ -1,5 +1,8 @@
{% extends "site_base.html" %} {% extends "site_base.html" %}
{% load url from future %}
{% load bootstrap_tags %} {% load bootstrap_tags %}
{% block head_title %}{{ team.name }}{% endblock %} {% block head_title %}{{ team.name }}{% endblock %}
@ -9,21 +12,21 @@
<div class="span12"> <div class="span12">
<div class="pull-right"> <div class="pull-right">
{% if can_join %} {% if can_join %}
<form method="post" action="{% url team_join team.slug %}"> <form method="post" action="{% url 'team_join' team.slug %}">
{% csrf_token %} {% csrf_token %}
<input type="submit" class="btn btn-primary" value="join"> <input type="submit" class="btn btn-primary" value="join">
</form> </form>
{% endif %} {% endif %}
{% if can_leave %} {% if can_leave %}
<form method="post" action="{% url team_leave team.slug %}"> <form method="post" action="{% url 'team_leave' team.slug %}">
{% csrf_token %} {% csrf_token %}
<input type="submit" class="btn" value="leave"> <input type="submit" class="btn" value="leave">
</form> </form>
{% endif %} {% endif %}
{% if can_apply %} {% if can_apply %}
<form method="post" action="{% url team_apply team.slug %}"> <form method="post" action="{% url 'team_apply' team.slug %}">
{% csrf_token %} {% csrf_token %}
<input type="submit" class="btn btn-primary" value="apply"> <input type="submit" class="btn btn-primary" value="apply">
</form> </form>
@ -44,7 +47,7 @@
<tr> <tr>
<td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td> <td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td>
<td> <td>
<form style="margin: 0;" method="post" action="{% url team_demote membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">demote</button></form> <form style="margin: 0;" method="post" action="{% url 'team_demote' membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">demote</button></form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -57,7 +60,7 @@
<tr> <tr>
<td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td> <td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td>
<td> <td>
<form style="margin: 0;" method="post" action="{% url team_promote membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">promote</button></form> <form style="margin: 0;" method="post" action="{% url 'team_promote' membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">promote</button></form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -70,8 +73,8 @@
<tr> <tr>
<td>{{ membership.user.email }}</td> <td>{{ membership.user.email }}</td>
<td> <td>
<form style="margin: 0; float: left;" method="post" action="{% url team_accept membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">accept</button></form> <form style="margin: 0; float: left;" method="post" action="{% url 'team_accept' membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">accept</button></form>
<form style="margin: 0; float: left;" method="post" action="{% url team_reject membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">reject</button></form> <form style="margin: 0; float: left;" method="post" action="{% url 'team_reject' membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">reject</button></form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}