Skip to content
This repository
Browse code

Upgrade to Django 1.5 url tag syntax

  • Loading branch information...
commit 0dafe7a7f48787f44d4bc7bd48901970b6e7c74d 1 parent b48c95f
Michał Sałaban authored February 13, 2013
9  djiki/templates/djiki/base_image.html
... ...
@@ -1,12 +1,13 @@
1 1
 {% extends 'djiki/base.html' %}
2 2
 {% load i18n djiki_tags %}
  3
+{% load url from future %}
3 4
 {% block title %}{% trans "Image" %}: {{ image.name }} | {{ block.super }}{% endblock %}
4 5
 {% block djiki_actions %}
5 6
 <ul>
6  
-	<li><a href="{% url djiki-image-view image.name|urlize_title %}">{% trans "Image" %}</a></li>
7  
-	<li><a href="{% url djiki-image-edit image.name|urlize_title %}" rel="nofollow">{% trans "Edit image" %}</a></li>
8  
-	<li><a href="{% url djiki-image-history image.name|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
9  
-	<li><a href="{% url djiki-image-new %}" rel="nofollow">{% trans "Upload" %}</a></li>
  7
+	<li><a href="{% url 'djiki-image-view' image.name|urlize_title %}">{% trans "Image" %}</a></li>
  8
+	<li><a href="{% url 'djiki-image-edit' image.name|urlize_title %}" rel="nofollow">{% trans "Edit image" %}</a></li>
  9
+	<li><a href="{% url 'djiki-image-history' image.name|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
  10
+	<li><a href="{% url 'djiki-image-new' %}" rel="nofollow">{% trans "Upload" %}</a></li>
10 11
 </ul>
11 12
 <div class="clear"></div>
12 13
 {% endblock %}
11  djiki/templates/djiki/base_page.html
... ...
@@ -1,13 +1,14 @@
1 1
 {% extends 'djiki/base.html' %}
2 2
 {% load i18n djiki_tags %}
  3
+{% load url from future %}
3 4
 {% block title %}{{ page.title }} | {{ block.super }}{% endblock %}
4 5
 {% block djiki_actions %}
5 6
 <ul>
6  
-	<li><a href="{% url djiki-page-view page.title|urlize_title %}">{% trans "Page" %}</a></li>
7  
-	<li><a href="{% url djiki-page-edit page.title|urlize_title %}" rel="nofollow">{% trans "Edit page" %}</a></li>
8  
-	<li><a href="{% url djiki-page-history page.title|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
9  
-	<li><a href="{% url djiki-page-view page.title|urlize_title %}?raw=1" rel="nofollow">{% trans "Get source" %}</a></li>
10  
-	<li><a href="{% url djiki-image-new %}" rel="nofollow">{% trans "Upload" %}</a></li>
  7
+	<li><a href="{% url 'djiki-page-view' page.title|urlize_title %}">{% trans "Page" %}</a></li>
  8
+	<li><a href="{% url 'djiki-page-edit' page.title|urlize_title %}" rel="nofollow">{% trans "Edit page" %}</a></li>
  9
+	<li><a href="{% url 'djiki-page-history' page.title|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
  10
+	<li><a href="{% url 'djiki-page-view' page.title|urlize_title %}?raw=1" rel="nofollow">{% trans "Get source" %}</a></li>
  11
+	<li><a href="{% url 'djiki-image-new' %}" rel="nofollow">{% trans "Upload" %}</a></li>
11 12
 </ul>
12 13
 <div class="clear"></div>
13 14
 {% endblock %}
9  djiki/templates/djiki/history.html
... ...
@@ -1,11 +1,12 @@
1 1
 {% extends 'djiki/base_page.html' %}
2 2
 {% load i18n djiki_tags %}
  3
+{% load url from future %}
3 4
 {% block title %}{% trans "Page history" %}: {{ block.super }}{% endblock %}
4 5
 {% block djiki_main %}
5 6
 <div class="page history grid_12">
6 7
 	<div class="content">
7 8
 		<h1>{{ page.title }}</h1>
8  
-		<form method="get" action="{% url djiki-page-diff page.title|urlize_title %}">
  9
+		<form method="get" action="{% url 'djiki-page-diff' page.title|urlize_title %}">
9 10
 		<table>
10 11
 			<thead>
11 12
 				<tr>
@@ -20,7 +21,7 @@
20 21
 				{% for revision in history %}
21 22
 				<tr>
22 23
 					<td>
23  
-						<a href="{% url djiki-page-revision page.title|urlize_title revision.pk %}" title="{% trans "View" %}">
  24
+						<a href="{% url 'djiki-page-revision' page.title|urlize_title revision.pk %}" title="{% trans "View" %}">
24 25
 						{{ revision.created }}</a>
25 26
 						<span class="help_text">({% blocktrans with revision.created|timesince as timesince %}{{ timesince }} ago{% endblocktrans %})</span>
26 27
 					</td>
@@ -34,8 +35,8 @@
34 35
 					</td>
35 36
 					<td>{{ revision.description }}</td>
36 37
 					<td>
37  
-						<a href="{% url djiki-page-revert page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Revert to this version by discarding all later modifications." %}">[{% trans "revert" %}]</a>
38  
-						<a href="{% url djiki-page-undo page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Undo this revision." %}">[{% trans "undo" %}]</a>
  38
+						<a href="{% url 'djiki-page-revert' page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Revert to this version by discarding all later modifications." %}">[{% trans "revert" %}]</a>
  39
+						<a href="{% url 'djiki-page-undo' page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Undo this revision." %}">[{% trans "undo" %}]</a>
39 40
 					</td>
40 41
 				</tr>
41 42
 				{% endfor %}
3  djiki/templates/djiki/not_found.html
... ...
@@ -1,12 +1,13 @@
1 1
 {% extends 'djiki/base.html' %}
2 2
 {% load i18n djiki_tags %}
  3
+{% load url from future %}
3 4
 {% block djiki_main %}
4 5
 <p>
5 6
 {% blocktrans %}The page with title <strong>{{ title }}</strong> does not exist.
6 7
 Please make sure your spelling is correct.
7 8
 {% endblocktrans %}
8 9
 </p>
9  
-<p>{% url djiki-page-edit title|urlize_title as edit_url %}
  10
+<p>{% url 'djiki-page-edit' title|urlize_title as edit_url %}
10 11
 {% blocktrans %}You may also <a href="{{ edit_url }}">create a new page</a>
11 12
 named <strong>{{ title }}</strong>.
12 13
 {% endblocktrans %}
3  djiki/templates/djiki/parser/image.html
... ...
@@ -1,7 +1,8 @@
1 1
 {% load thumbnail %}
  2
+{% load url from future %}
2 3
 <div class="image{% if size %} with_size{% endif %}{% if not image %} external{% endif %}">
3 4
 	{% if image %}
4  
-	<a href="{% url djiki-image-view url_name %}">
  5
+	<a href="{% url 'djiki-image-view' url_name %}">
5 6
 	{% if size %}
6 7
 		{% thumbnail image.last_revision.file size as img %}
7 8
 		<img src="{{ img.url }}" alt="{{ title }}" />

0 notes on commit 0dafe7a

Please sign in to comment.
Something went wrong with that request. Please try again.