Ignore:
Timestamp:
Jun 15, 2014, 10:06:46 PM (12 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master
Children:
6479b5c
Parents:
2e4e1fb
git-author:
Alex Dehnert <adehnert@…> (06/15/14 21:36:47)
git-committer:
Alex Dehnert <adehnert@…> (06/15/14 22:06:46)
Message:

Django 1.6: use new {% url %} syntax

Starting in Django 1.5, the argument to {% url %} is treated as a variable,
rather than a literal. To get a literal, we need to enclose the argument in
quotes. For Django 1.4 support, we also want to do {% load url from future %}
-- probably in more places than just base.html, but we'll see.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remit/remit_templates/index.html

    r0671644 r695d358  
    11{% extends "base.html" %}
     2{% load url from future %}
    23
    34{% block title %}Welcome to Remit{% endblock %}
     
    1213<ul>
    1314    {% if user.is_anonymous %}
    14     <li><a href='{% url login %}'>Login</a></li>
     15    <li><a href='{% url "login" %}'>Login</a></li>
    1516    {% endif %}
    16     <li><a href="{% url request_reimbursement %}">Request reimbursement</a></li>
    17     <li><a href="{% url list_requests %}">List requests</a></li>
     17    <li><a href="{% url "request_reimbursement" %}">Request reimbursement</a></li>
     18    <li><a href="{% url "list_requests" %}">List requests</a></li>
    1819    {% if perms.finance_core.use_reporting %}
    19     <li><a href="{% url reporting %}">Reporting</a></li>
     20    <li><a href="{% url "reporting" %}">Reporting</a></li>
    2021    {% endif %}
    2122    {% if user.is_staff %}
    22     <li><a href='{% url admin:index %}'>Django admin interface</a></li>
     23    <li><a href='{% url "admin:index" %}'>Django admin interface</a></li>
    2324    {% endif %}
    2425    {% if user.is_authenticated %}
    25     <li><a href='{% url logout %}'>Logout</a></li>
     26    <li><a href='{% url "logout" %}'>Logout</a></li>
    2627    {% endif %}
    2728</ul>
Note: See TracChangeset for help on using the changeset viewer.