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

Using https://github.com/futurecolors/django-future-url
This commit is contained in:
Rebecca Lovewell 2014-01-15 08:57:57 -05:00
parent ed7278e926
commit 4c912da4ac
9 changed files with 53 additions and 28 deletions

View file

@ -1,3 +1,4 @@
{% load url from future %}
{% load i18n %}
<table class="table table-striped table-bordered table-reviews">
@ -18,7 +19,7 @@
<tr class="{{ proposal.user_vote_css }}">
<td>{{ proposal.number }}</td>
<td>
<a href="{% url review_detail proposal.pk %}">
<a href="{% url 'review_detail' proposal.pk %}">
<small><strong>{{ proposal.speaker }}</strong></small>
<br />
{{ proposal.title }}

View file

@ -1,5 +1,8 @@
{% extends "site_base.html" %}
{% load url from future %}
{% load i18n %}
{% load sitetree %}
@ -60,25 +63,25 @@
{{ section }}
</li>
<li>
<a href="{% url review_section section.section.slug %}">
<a href="{% url 'review_section' section.section.slug %}">
{% trans "All Reviews" %}
</a>
</li>
{% comment %}
<li>
<a href="{% url review_section_assignments section.section.slug %}">
<a href="{% url 'review_section_assignments' section.section.slug %}">
{% trans "Your Assignments" %}
</a>
</li>
{% endcomment %}
<li>
<a href="{% url review_status section.section.slug %}">
<a href="{% url 'review_status' section.section.slug %}">
{% trans "Voting Status" %}
</a>
</li>
{% if request.user.is_staff %}
<li>
<a href="{% url result_notification section.section.slug 'accepted' %}">Result Notification</a>
<a href="{% url 'result_notification' section.section.slug 'accepted' %}">Result Notification</a>
</li>
{% endif %}
{% endfor %}

View file

@ -1,5 +1,8 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% load i18n %}
{% block extra_style %}
@ -13,14 +16,14 @@
{% block body %}
<ul class="nav nav-pills">
<li{% if status == 'accepted' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'accepted' %}">accepted</a>
<li{% if status == 'rejected' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'rejected' %}">rejected</a>
<li{% if status == 'standby' %} class="active"{% endif %}><a href="{% url result_notification section_slug 'standby' %}">standby</a>
<li{% if status == 'accepted' %} class="active"{% endif %}><a href="{% url 'result_notification' section_slug 'accepted' %}">accepted</a>
<li{% if status == 'rejected' %} class="active"{% endif %}><a href="{% url 'result_notification' section_slug 'rejected' %}">rejected</a>
<li{% if status == 'standby' %} class="active"{% endif %}><a href="{% url 'result_notification' section_slug 'standby' %}">standby</a>
</ul>
<h1>Result Notification</h1>
<form method="post" action="{% url result_notification_prepare section_slug status %}">
<form method="post" action="{% url 'result_notification_prepare' section_slug status %}">
{% csrf_token %}
@ -54,7 +57,7 @@
<td><input class="action-select" type="checkbox" name="_selected_action" value="{{ proposal.pk }}"></td>
<td>{{ proposal.number }}</td>
<td>
<a href="{% url review_detail proposal.pk %}">
<a href="{% url 'review_detail' proposal.pk %}">
<small><strong>{{ proposal.speaker }}</strong></small>
<br />
{{ proposal.title }}

View file

@ -1,5 +1,8 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% load i18n %}
{% block body %}
@ -23,7 +26,7 @@
<div class="span6">
<h2>Email</h2>
<form method="post" action="{% url result_notification_send section_slug status %}">
<form method="post" action="{% url 'result_notification_send' section_slug status %}">
{% csrf_token %}
@ -42,7 +45,7 @@
{% include "reviews/_result_notification_prepare_help.html" %}
<button type="submit" class="btn btn-primary">Send {{ proposals|length }} Email{{ proposals|length|pluralize }}</button>
<a class="btn" href="{% url result_notification section_slug status %}">Cancel</a>
<a class="btn" href="{% url 'result_notification' section_slug status %}">Cancel</a>
</form>
</div>
</form>

View file

@ -1,5 +1,8 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% block body %}
<h1>Reviewers</h1>
@ -30,7 +33,7 @@
{% for reviewer in reviewers %}
<tr>
<td>
<a href="{% url review_list_user section_slug reviewer.pk %}">{{ reviewer.get_full_name }}</a>
<a href="{% url 'review_list_user' section_slug reviewer.pk %}">{{ reviewer.get_full_name }}</a>
</td>
<td>
{{ reviewer.total_votes }}

View file

@ -1,5 +1,8 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% block body %}
<h1>Review Assignments</h1>
@ -13,12 +16,12 @@
{% for assignment in assignments %}
<tr>
<td>
<a href="{% url review_detail assignment.proposal.pk %}">
<a href="{% url 'review_detail' assignment.proposal.pk %}">
{{ assignment.proposal.title }}
</a>
</td>
<td>
<form method="post" action="{% url review_assignment_opt_out assignment.pk %}">
<form method="post" action="{% url 'review_assignment_opt_out' assignment.pk %}">
{% csrf_token %}
<input type="submit" value="Opt-out" />
</form>

View file

@ -1,5 +1,8 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% load i18n %}
{% load markitup_tags %}
{% load bootstrap_tags %}
@ -126,7 +129,7 @@
</div>
{% if is_manager %}
<div class="pull-right">
<form class="form-inline" action="{% url review_delete review.id %}" method="POST">
<form class="form-inline" action="{% url 'review_delete' review.id %}" method="POST">
{% csrf_token %}
<button class="btn btn-mini btn-danger" type="submit">Delete</button>
</form>

View file

@ -1,5 +1,8 @@
{% extends "site_base.html" %}
{% load url from future %}
{% load markitup_tags %}
{% load uni_form_tags %}
@ -55,7 +58,7 @@
<h2>Review</h2>
<form method="POST" action="{% url review_review proposal.pk %}" class="uniForm">
<form method="POST" action="{% url 'review_review' proposal.pk %}" class="uniForm">
{% csrf_token %}
<fieldset class="inlineLabels">
{{ review_form|as_uni_form }}
@ -67,7 +70,7 @@
<h2>Comment</h2>
<form method="POST" action="{% url review_comment proposal.pk %}" class="uniForm">
<form method="POST" action="{% url 'review_comment' proposal.pk %}" class="uniForm">
{% csrf_token %}
<fieldset>
{{ comment_form|as_uni_form }}

View file

@ -1,15 +1,18 @@
{% extends "reviews/base.html" %}
{% load url from future %}
{% block body %}
<h1>Voting Status ({{ section_slug }})</h1>
{% if key %}
<div class="breadcrumbs">
<a href="{% url review_status section_slug "positive" %}">Positive</a> |
<a href="{% url review_status section_slug "negative" %}">Negative</a> |
<a href="{% url review_status section_slug "indifferent" %}">Indifferent</a> |
<a href="{% url review_status section_slug "controversial" %}">Controversial</a> |
<a href="{% url review_status section_slug "too_few" %}">Too Few</a>
<a href="{% url 'review_status' section_slug "positive" %}">Positive</a> |
<a href="{% url 'review_status' section_slug "negative" %}">Negative</a> |
<a href="{% url 'review_status' section_slug "indifferent" %}">Indifferent</a> |
<a href="{% url 'review_status' section_slug "controversial" %}">Controversial</a> |
<a href="{% url 'review_status' section_slug "too_few" %}">Too Few</a>
</div>
<div>
@ -42,35 +45,35 @@
<dl>
<dt>
<a href="{% url review_status section_slug "positive" %}">Positive</a>
<a href="{% url 'review_status' section_slug "positive" %}">Positive</a>
<span class="badge">{{ proposals.positive|length }}</span>
</dt>
<dd>
proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and at least one +1 and no &minus;1s
</dd>
<dt>
<a href="{% url review_status section_slug "negative" %}">Negative</a>
<a href="{% url 'review_status' section_slug "negative" %}">Negative</a>
<span class="badge">{{ proposals.negative|length }}</span>
</dt>
<dd>
proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and at least one &minus;1 and no +1s
</dd>
<dt>
<a href="{% url review_status section_slug "indifferent" %}">Indifferent</a>
<a href="{% url 'review_status' section_slug "indifferent" %}">Indifferent</a>
<span class="badge">{{ proposals.indifferent|length }}</span>
</dt>
<dd>
proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and neither a +1 or a &minus;1
</dd>
<dt>
<a href="{% url review_status section_slug "controversial" %}">Controversial</a>
<a href="{% url 'review_status' section_slug "controversial" %}">Controversial</a>
<span class="badge">{{ proposals.controversial|length }}</span>
</dt>
<dd>
proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and both a +1 and &minus;1
</dd>
<dt>
<a href="{% url review_status section_slug "too_few" %}">Too Few Reviews</a>
<a href="{% url 'review_status' section_slug "too_few" %}">Too Few Reviews</a>
<span class="badge">{{ proposals.too_few|length }}</span>
</dt>
<dd>