Named URL tweaks for Django 1.5 compatibility
This commit is contained in:
parent
a1703b3127
commit
e77176bc4f
6 changed files with 15 additions and 16 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
<p> {{ list.name }} is gone.</p>
|
||||
|
||||
<a href="{% url todo-lists %}">Return to lists</a>
|
||||
<a href="{% url 'todo-lists' %}">Return to lists</a>
|
||||
|
||||
{% else %}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
|||
</form>
|
||||
|
||||
|
||||
<a href="{% url todo-incomplete_tasks list.id list_slug %}">Return to list: {{ list.name }}</a>
|
||||
<a href="{% url 'todo-incomplete_tasks' list.id list_slug %}">Return to list: {{ list.name }}</a>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<h3>{{ group.grouper }}</h3>
|
||||
<ul>
|
||||
{% for item in group.list %}
|
||||
<li><a class="todo" href="{% url todo-incomplete_tasks item.id item.slug %}">{{ item.name }} </a> ({{ item.incomplete_tasks.count }}/{{ item.item_set.count }})</li>
|
||||
<li><a class="todo" href="{% url 'todo-incomplete_tasks' item.id item.slug %}">{{ item.name }} </a> ({{ item.incomplete_tasks.count }}/{{ item.item_set.count }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
@ -35,6 +35,6 @@
|
|||
|
||||
</div>
|
||||
|
||||
<p><a href="{% url todo-add_list %}">Create new todo list</a></p>
|
||||
<p><a href="{% url 'todo-add_list' %}">Create new todo list</a></p>
|
||||
|
||||
{% endblock %}
|
|
@ -20,10 +20,10 @@
|
|||
<div class="post_list">
|
||||
|
||||
{% for f in found_items %}
|
||||
<p><strong><a href="{% url todo-task_detail f.id %}">{{ f.title }}</a></strong><br />
|
||||
<p><strong><a href="{% url 'todo-task_detail' f.id %}">{{ f.title }}</a></strong><br />
|
||||
|
||||
<span class="minor">
|
||||
On list: <a href="{% url todo-incomplete_tasks f.list.id f.list.slug %}">{{ f.list }}</a><br />
|
||||
On list: <a href="{% url 'todo-incomplete_tasks' f.list.id f.list.slug %}">{{ f.list }}</a><br />
|
||||
Assigned to: {{ f.assigned_to }} (created by: {{ f.created_by }})<br />
|
||||
Complete: {{ f.completed|yesno:"Yes,No" }}
|
||||
</span>
|
||||
|
|
|
@ -11,7 +11,7 @@ function order_tasks(data) {
|
|||
// data in a list. We pass that list as an object called "data" to a Django view
|
||||
// to save the re-ordered data into the database.
|
||||
|
||||
$.post("{% url todo-reorder_tasks %}", data, "json");
|
||||
$.post("{% url 'todo-reorder_tasks' %}", data, "json");
|
||||
return false;
|
||||
};
|
||||
|
||||
|
@ -118,7 +118,7 @@ $(document).ready(function() {
|
|||
{% for task in task_list %}
|
||||
<tr class="{% cycle 'row1' 'row2' %}" id="{{ task.id }}">
|
||||
<td><input type="checkbox" name="mark_done" value="{{ task.id }}" id="mark_done_{{ task.id }}"> </td>
|
||||
<td><a href="{% url todo-task_detail task.id %}">{{ task.title|truncatewords:20 }}</a></td>
|
||||
<td><a href="{% url 'todo-task_detail' task.id %}">{{ task.title|truncatewords:20 }}</a></td>
|
||||
<td>{{ task.created_date|date:"m/d/Y" }}</td>
|
||||
<td>
|
||||
{% if task.overdue_status %}<span class="overdue">{% endif %}
|
||||
|
@ -132,7 +132,7 @@ $(document).ready(function() {
|
|||
|
||||
</td>
|
||||
{% ifequal list_slug "mine" %}
|
||||
<td><a href="{% url todo-incomplete_tasks task.list.id task.list.slug %}">{{ task.list }}</a></td>
|
||||
<td><a href="{% url 'todo-incomplete_tasks' task.list.id task.list.slug %}">{{ task.list }}</a></td>
|
||||
{% endifequal %}
|
||||
|
||||
<td><input type="checkbox" name="del_task" value="{{ task.id }}" id="del_task_{{ task.id }}"> </td>
|
||||
|
@ -141,7 +141,7 @@ $(document).ready(function() {
|
|||
</table>
|
||||
<p><input type="submit" name="mark_tasks_done" value="Continue..." class="todo-button"></p>
|
||||
|
||||
<p><a class="todo" href="{% url todo-completed_tasks list_id list_slug %}">View completed tasks</a></p>
|
||||
<p><a class="todo" href="{% url 'todo-completed_tasks' list_id list_slug %}">View completed tasks</a></p>
|
||||
{% endifequal %}
|
||||
|
||||
{% ifequal view_completed 1 %}
|
||||
|
@ -165,7 +165,7 @@ $(document).ready(function() {
|
|||
{% for task in completed_list %}
|
||||
<tr class="{% cycle 'row1' 'row2' %}">
|
||||
<td><input type="checkbox" name="undo_completed_task" value="{{ task.id }}" id="id_undo_completed_task{{ task.id }}"> </td>
|
||||
<td><a href="{% url todo-task_detail task.id %}">{{ task.title|truncatewords:20 }}</a></td>
|
||||
<td><a href="{% url 'todo-task_detail' task.id %}">{{ task.title|truncatewords:20 }}</a></td>
|
||||
<td>{{ task.created_date|date:"m/d/Y" }}</td>
|
||||
<td>{{ task.completed_date|date:"m/d/Y" }}</td>
|
||||
<td style="text-align:center;">{% if task.note %}≈{% endif %} </td>
|
||||
|
@ -178,12 +178,12 @@ $(document).ready(function() {
|
|||
</table>
|
||||
<p><input type="submit" name="deldonetasks" value="Continue..." class="todo-button"></p>
|
||||
</form>
|
||||
<p><a class="todo" href="{% url todo-incomplete_tasks list_id list_slug %}">View incomplete tasks</a></p>
|
||||
<p><a class="todo" href="{% url 'todo-incomplete_tasks' list_id list_slug %}">View incomplete tasks</a></p>
|
||||
{% endifequal %}
|
||||
|
||||
{% ifequal can_del 1 %}
|
||||
{% ifnotequal list_slug "mine" %}
|
||||
<p><a class="todo" href="{% url todo-del_list list_id list_slug %}">Delete this list</a></p>
|
||||
<p><a class="todo" href="{% url 'todo-del_list' list_id list_slug %}">Delete this list</a></p>
|
||||
{% endifnotequal %}
|
||||
{% endifequal %}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ $(document).ready(function() {
|
|||
{% csrf_token %}
|
||||
<p id="slideToggle" ><strong>→ Click to edit details ←</strong></p>
|
||||
|
||||
<p><strong>In list:</strong> <a href="{% url todo-incomplete_tasks task.list.id task.list.slug %}" class="showlink">{{ task.list }}</a><br />
|
||||
<p><strong>In list:</strong> <a href="{% url 'todo-incomplete_tasks' task.list.id task.list.slug %}" class="showlink">{{ task.list }}</a><br />
|
||||
<strong>Assigned to:</strong> {{ task.assigned_to.first_name }} {{ task.assigned_to.last_name }}<br />
|
||||
<strong>Created by:</strong> {{ task.created_by.first_name }} {{ task.created_by.last_name }}<br />
|
||||
<strong>Due date:</strong> {{ task.due_date }}<br />
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.conf.urls.defaults import *
|
||||
from django.views.generic.simple import direct_to_template
|
||||
from django.conf.urls import *
|
||||
from django.contrib.auth import views as auth_views
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
|
Loading…
Reference in a new issue