Permalink
Browse files

Upgrade to Django 1.5 url tag syntax

  • Loading branch information...
1 parent b48c95f commit 0dafe7a7f48787f44d4bc7bd48901970b6e7c74d @emesik committed Feb 13, 2013
@@ -1,12 +1,13 @@
{% extends 'djiki/base.html' %}
{% load i18n djiki_tags %}
+{% load url from future %}
{% block title %}{% trans "Image" %}: {{ image.name }} | {{ block.super }}{% endblock %}
{% block djiki_actions %}
<ul>
- <li><a href="{% url djiki-image-view image.name|urlize_title %}">{% trans "Image" %}</a></li>
- <li><a href="{% url djiki-image-edit image.name|urlize_title %}" rel="nofollow">{% trans "Edit image" %}</a></li>
- <li><a href="{% url djiki-image-history image.name|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
- <li><a href="{% url djiki-image-new %}" rel="nofollow">{% trans "Upload" %}</a></li>
+ <li><a href="{% url 'djiki-image-view' image.name|urlize_title %}">{% trans "Image" %}</a></li>
+ <li><a href="{% url 'djiki-image-edit' image.name|urlize_title %}" rel="nofollow">{% trans "Edit image" %}</a></li>
+ <li><a href="{% url 'djiki-image-history' image.name|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
+ <li><a href="{% url 'djiki-image-new' %}" rel="nofollow">{% trans "Upload" %}</a></li>
</ul>
<div class="clear"></div>
{% endblock %}
@@ -1,13 +1,14 @@
{% extends 'djiki/base.html' %}
{% load i18n djiki_tags %}
+{% load url from future %}
{% block title %}{{ page.title }} | {{ block.super }}{% endblock %}
{% block djiki_actions %}
<ul>
- <li><a href="{% url djiki-page-view page.title|urlize_title %}">{% trans "Page" %}</a></li>
- <li><a href="{% url djiki-page-edit page.title|urlize_title %}" rel="nofollow">{% trans "Edit page" %}</a></li>
- <li><a href="{% url djiki-page-history page.title|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
- <li><a href="{% url djiki-page-view page.title|urlize_title %}?raw=1" rel="nofollow">{% trans "Get source" %}</a></li>
- <li><a href="{% url djiki-image-new %}" rel="nofollow">{% trans "Upload" %}</a></li>
+ <li><a href="{% url 'djiki-page-view' page.title|urlize_title %}">{% trans "Page" %}</a></li>
+ <li><a href="{% url 'djiki-page-edit' page.title|urlize_title %}" rel="nofollow">{% trans "Edit page" %}</a></li>
+ <li><a href="{% url 'djiki-page-history' page.title|urlize_title %}" rel="nofollow">{% trans "History" %}</a></li>
+ <li><a href="{% url 'djiki-page-view' page.title|urlize_title %}?raw=1" rel="nofollow">{% trans "Get source" %}</a></li>
+ <li><a href="{% url 'djiki-image-new' %}" rel="nofollow">{% trans "Upload" %}</a></li>
</ul>
<div class="clear"></div>
{% endblock %}
@@ -1,11 +1,12 @@
{% extends 'djiki/base_page.html' %}
{% load i18n djiki_tags %}
+{% load url from future %}
{% block title %}{% trans "Page history" %}: {{ block.super }}{% endblock %}
{% block djiki_main %}
<div class="page history grid_12">
<div class="content">
<h1>{{ page.title }}</h1>
- <form method="get" action="{% url djiki-page-diff page.title|urlize_title %}">
+ <form method="get" action="{% url 'djiki-page-diff' page.title|urlize_title %}">
<table>
<thead>
<tr>
@@ -20,7 +21,7 @@
{% for revision in history %}
<tr>
<td>
- <a href="{% url djiki-page-revision page.title|urlize_title revision.pk %}" title="{% trans "View" %}">
+ <a href="{% url 'djiki-page-revision' page.title|urlize_title revision.pk %}" title="{% trans "View" %}">
{{ revision.created }}</a>
<span class="help_text">({% blocktrans with revision.created|timesince as timesince %}{{ timesince }} ago{% endblocktrans %})</span>
</td>
@@ -34,8 +35,8 @@
</td>
<td>{{ revision.description }}</td>
<td>
- <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>
- <a href="{% url djiki-page-undo page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Undo this revision." %}">[{% trans "undo" %}]</a>
+ <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>
+ <a href="{% url 'djiki-page-undo' page.title|urlize_title revision.pk %}" rel="nofollow" title="{% trans "Undo this revision." %}">[{% trans "undo" %}]</a>
</td>
</tr>
{% endfor %}
@@ -1,12 +1,13 @@
{% extends 'djiki/base.html' %}
{% load i18n djiki_tags %}
+{% load url from future %}
{% block djiki_main %}
<p>
{% blocktrans %}The page with title <strong>{{ title }}</strong> does not exist.
Please make sure your spelling is correct.
{% endblocktrans %}
</p>
-<p>{% url djiki-page-edit title|urlize_title as edit_url %}
+<p>{% url 'djiki-page-edit' title|urlize_title as edit_url %}
{% blocktrans %}You may also <a href="{{ edit_url }}">create a new page</a>
named <strong>{{ title }}</strong>.
{% endblocktrans %}
@@ -1,7 +1,8 @@
{% load thumbnail %}
+{% load url from future %}
<div class="image{% if size %} with_size{% endif %}{% if not image %} external{% endif %}">
{% if image %}
- <a href="{% url djiki-image-view url_name %}">
+ <a href="{% url 'djiki-image-view' url_name %}">
{% if size %}
{% thumbnail image.last_revision.file size as img %}
<img src="{{ img.url }}" alt="{{ title }}" />

0 comments on commit 0dafe7a

Please sign in to comment.