mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Update {% url %} syntax. Not bothering with loading from future for now.
This commit is contained in:
parent
23ff54e356
commit
fff8a4e1d2
5 changed files with 7 additions and 7 deletions
|
|
@ -7,7 +7,7 @@
|
|||
{% if not avatars %}
|
||||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p>
|
||||
{% endif %}
|
||||
<form enctype="multipart/form-data" method="POST" action="{% url avatar_add %}">
|
||||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
|
||||
{{ upload_avatar_form.as_p }}
|
||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Upload New Image" %}" /></p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
{% if not avatars %}
|
||||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p>
|
||||
{% else %}
|
||||
<form method="POST" action="{% url avatar_change %}">
|
||||
<form method="POST" action="{% url 'avatar_change' %}">
|
||||
<ul>
|
||||
{{ primary_avatar_form.as_ul }}
|
||||
</ul>
|
||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Choose new Default" %}" /></p>
|
||||
</form>
|
||||
{% endif %}
|
||||
<form enctype="multipart/form-data" method="POST" action="{% url avatar_add %}">
|
||||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
|
||||
{{ upload_avatar_form.as_p }}
|
||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Upload New Image" %}" /></p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
{% block content %}
|
||||
<p>{% trans "Please select the avatars that you would like to delete." %}</p>
|
||||
{% if not avatars %}
|
||||
{% url avatar_change as avatar_change_url %}
|
||||
{% url 'avatar_change' as avatar_change_url %}
|
||||
<p>{% blocktrans %}You have no avatars to delete. Please <a href="{{ avatar_change_url }}">upload one</a> now.{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
<form method="POST" action="{% url avatar_delete %}">
|
||||
<form method="POST" action="{% url 'avatar_delete' %}">
|
||||
<ul>
|
||||
{{ delete_avatar_form.as_ul }}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
{% load i18n %}{% url profile_detail username=user.username as user_url %}{# TODO: support custom user models via get_username #}
|
||||
{% load i18n %}{% url 'profile_detail' username=user.username as user_url %}{# TODO: support custom user models via get_username; actually, is this template even used anymore? #}
|
||||
{% blocktrans with user as avatar_creator and avatar.get_absolute_url as avatar_url %}<a href="{{ user_url }}">{{ avatar_creator }}</a> has updated their avatar <a href="{{ avatar_url }}">{{ avatar }}</a>.{% endblocktrans %}
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -33,7 +33,7 @@ that are required. A minimal integration can work like this:
|
|||
3. Somewhere in your template navigation scheme, link to the change avatar
|
||||
page::
|
||||
|
||||
<a href="{% url avatar_change %}">Change your avatar</a>
|
||||
<a href="{% url 'avatar_change' %}">Change your avatar</a>
|
||||
|
||||
4. Wherever you want to display an avatar for a user, first load the avatar
|
||||
template tags::
|
||||
|
|
|
|||
Loading…
Reference in a new issue