diff options
21 files changed, 51 insertions, 51 deletions
diff --git a/hyperkitty/api.py b/hyperkitty/api.py index a75dc4a..f7c7431 100644 --- a/hyperkitty/api.py +++ b/hyperkitty/api.py @@ -21,7 +21,7 @@ import json import re from rest_framework.views import View -from django.conf.urls.defaults import url +from django.conf.urls import url from django.conf import settings from django.http import HttpResponseNotModified, HttpResponse diff --git a/hyperkitty/templates/404.html b/hyperkitty/templates/404.html index 8b819d4..dbfef16 100644 --- a/hyperkitty/templates/404.html +++ b/hyperkitty/templates/404.html @@ -30,7 +30,7 @@ <span style="font-size:60px; color:#444;font-family: 'Times New Roman';"> Oh! Snap </span> <br/><br/> I can't find this page. - <a href ="{% url root %}">Back home</a> + <a href ="{% url 'root' %}">Back home</a> </div> </div> diff --git a/hyperkitty/templates/500.html b/hyperkitty/templates/500.html index a2b3d13..5a45d80 100644 --- a/hyperkitty/templates/500.html +++ b/hyperkitty/templates/500.html @@ -35,7 +35,7 @@ Error ! - {{ app_name|title }} <span style="font-size:60px; color:#444;font-family: 'Times New Roman';"> Oh! Snap </span> <br/><br/> There's been an error somewhere, sorry. - <a href ="{% url root %}">Back home</a> + <a href ="{% url 'root' %}">Back home</a> </div> </div> diff --git a/hyperkitty/templates/api.html b/hyperkitty/templates/api.html index 763574b..4c4af27 100644 --- a/hyperkitty/templates/api.html +++ b/hyperkitty/templates/api.html @@ -32,8 +32,8 @@ Using the address /api/email/<list name>/<Message-ID> you will be able to retrieve the information known about a specific email on the specified mailing-list. </p> - <p> For example: <a href="{% url api_email mlist_fqdn='devel@fp.o', hashid='13129854572893334' %}"> - {% url api_email mlist_fqdn='devel@fp.o', hashid='13129854572893334' %} + <p> For example: <a href="{% url 'api_email' mlist_fqdn='devel@fp.o' hashid='13129854572893334' %}"> + {% url 'api_email' mlist_fqdn='devel@fp.o' hashid='13129854572893334' %} </a> </p> </div> @@ -43,8 +43,8 @@ retrieve the information known about a specific email on the specified mailing-l Using the address /api/thread/<list name>/<Message-ID> you will be able to retrieve the all the email for a specific thread on the specified mailing-list. </p> - <p> For example: <a href="{% url api_thread mlist_fqdn='devel@fp.o', threadid='13129854572893334' %}"> - {% url api_thread mlist_fqdn='devel@fp.o', threadid='13129854572893334' %} + <p> For example: <a href="{% url 'api_thread' mlist_fqdn='devel@fp.o' threadid='13129854572893334' %}"> + {% url 'api_thread' mlist_fqdn='devel@fp.o' threadid='13129854572893334' %} </a> </p> </div> @@ -61,8 +61,8 @@ search for all emails of the specified mailing-list containing the provided keyw <li>Content</li> <li>SubjectContent</li> </ul> - <p> For example: <a href="{% url api_search mlist_fqdn='devel@fp.o', field='From', keyword='pingoured' %}"> - {% url api_search mlist_fqdn='devel@fp.o', field='From', keyword='pingoured' %} + <p> For example: <a href="{% url 'api_search' mlist_fqdn='devel@fp.o' field='From' keyword='pingoured' %}"> + {% url 'api_search' mlist_fqdn='devel@fp.o' field='From' keyword='pingoured' %} </a> </p> </div> diff --git a/hyperkitty/templates/base.html b/hyperkitty/templates/base.html index c564468..98450f5 100644 --- a/hyperkitty/templates/base.html +++ b/hyperkitty/templates/base.html @@ -25,28 +25,28 @@ <ul class="nav auth"> {% if user.is_authenticated %} - <li><a class="mm_logout" href="{% url user_logout %}?next={% url root %}">Logout</a></li> - <li><a href="{% url user_profile %}">{{ user.username }}</a></li> + <li><a class="mm_logout" href="{% url 'user_logout' %}?next={% url 'root' %}">Logout</a></li> + <li><a href="{% url 'user_profile' %}">{{ user.username }}</a></li> {% else %} - <li><a class="mm_user" href="{% url user_login %}?next={{next|default:request.path|urlencode}}">Login</a></li> + <li><a class="mm_user" href="{% url 'user_login' %}?next={{next|default:request.path|urlencode}}">Login</a></li> {% if use_internal_auth %} - <li><a href="{% url user_registration %}?next={{next|default:request.path|urlencode}}"> Sign Up </a></li> + <li><a href="{% url 'user_registration' %}?next={{next|default:request.path|urlencode}}"> Sign Up </a></li> {% endif %} {% endif %} </ul> - <a class="brand" href="{% url root %}">{{ app_name|title }}</a> + <a class="brand" href="{% url 'root' %}">{{ app_name|title }}</a> <ul class="nav"> <li {% if all_lists %} class="active"{% endif %}> - <a href="{% url root %}">All lists</a> + <a href="{% url 'root' %}">All lists</a> </li> {% if mlist %} <li id="list_name" class="active"> - <a href="{% url list_overview mlist_fqdn=mlist.name %}">{{mlist.name}}</a> + <a href="{% url 'list_overview' mlist_fqdn=mlist.name %}">{{mlist.name}}</a> </li> {% endif %} diff --git a/hyperkitty/templates/index.html b/hyperkitty/templates/index.html index 68b4520..ab8289b 100644 --- a/hyperkitty/templates/index.html +++ b/hyperkitty/templates/index.html @@ -15,7 +15,7 @@ <div class="row-fluid"> {% for mlist in all_lists %} <div class="span3"> - <a href="{% url list_overview mlist_fqdn=mlist.name %}"> + <a href="{% url 'list_overview' mlist_fqdn=mlist.name %}"> <p class="list-name"> {% if mlist.display_name %} {{ mlist.display_name }} diff --git a/hyperkitty/templates/login.html b/hyperkitty/templates/login.html index a62502e..61dafb9 100644 --- a/hyperkitty/templates/login.html +++ b/hyperkitty/templates/login.html @@ -15,15 +15,15 @@ <h2>Login with your email</h2> <ul class="social-login inline"> <li> - <form method="post" action="{% url socialauth_complete "browserid" %}?next={{ next }}"> + <form method="post" action="{% url 'socialauth_complete' "browserid" %}?next={{ next }}"> {% csrf_token %} <input type="hidden" name="assertion" value="" /> <a rel="nofollow" id="browserid" href="#"><img src="{{ STATIC_URL }}img/login/persona-large-disabled.png" alt="Login using Persona" /></a> </form> </li> - <li><a title="Google" class="socialaccount_provider google" href="{% url socialauth_begin backend='google' %}"><img src="{{ STATIC_URL }}img/login/google.png" alt="Google"></a></li> + <li><a title="Google" class="socialaccount_provider google" href="{% url 'socialauth_begin' backend='google' %}"><img src="{{ STATIC_URL }}img/login/google.png" alt="Google"></a></li> - <li><a title="Yahoo" class="socialaccount_provider yahoo" href="{% url socialauth_begin backend='yahoo' %}"><img src="{{ STATIC_URL }}img/login/yahoo.png" alt="Yahoo"></a></li> + <li><a title="Yahoo" class="socialaccount_provider yahoo" href="{% url 'socialauth_begin' backend='yahoo' %}"><img src="{{ STATIC_URL }}img/login/yahoo.png" alt="Yahoo"></a></li> </ul> diff --git a/hyperkitty/templates/message.html b/hyperkitty/templates/message.html index 800162b..2ba832b 100644 --- a/hyperkitty/templates/message.html +++ b/hyperkitty/templates/message.html @@ -18,7 +18,7 @@ <div class="message-header"> <a class="thread-back" - href="{% url thread threadid=message.thread_id, mlist_fqdn=mlist.name %}#{{message.message_id_hash}}"> + href="{% url 'thread' threadid=message.thread_id mlist_fqdn=mlist.name %}#{{message.message_id_hash}}"> </a> {# the background image will be a "back to thread" button #} <h1>{{ message.subject }}</h1> </div> diff --git a/hyperkitty/templates/message_new.html b/hyperkitty/templates/message_new.html index c764c1a..65ea034 100644 --- a/hyperkitty/templates/message_new.html +++ b/hyperkitty/templates/message_new.html @@ -23,12 +23,12 @@ Create a new thread - {{ mlist.display_name|default:mlist.name|escapeemail }} - <div class="new-thread-form"> <form method="post" - action="{% url message_new mlist_fqdn=mlist.name %}"> + action="{% url 'message_new' mlist_fqdn=mlist.name %}"> {% csrf_token %} {{ post_form|crispy }} <p class="buttons"> <button type="submit" class="submit btn btn-primary">Send</button> - or <a class="cancel" href="{% url archives_latest mlist_fqdn=mlist.name %}">cancel</a> + or <a class="cancel" href="{% url 'archives_latest' mlist_fqdn=mlist.name %}">cancel</a> </p> </form> </div> diff --git a/hyperkitty/templates/messages/like_form.html b/hyperkitty/templates/messages/like_form.html index 867a8a4..11f5b58 100644 --- a/hyperkitty/templates/messages/like_form.html +++ b/hyperkitty/templates/messages/like_form.html @@ -1,5 +1,5 @@ <form method="post" class="likeform" - action="{% url message_vote mlist_fqdn=mlist.name, message_id_hash=message_id_hash %}"> + action="{% url 'message_vote' mlist_fqdn=mlist.name message_id_hash=message_id_hash %}"> {% csrf_token %} <span class="likestatus {{ object.likestatus }}">+{{ object.likes }}/-{{ object.dislikes }}</span> {% if object.myvote == 1 %} diff --git a/hyperkitty/templates/messages/message.html b/hyperkitty/templates/messages/message.html index f8417d7..f5ed65f 100644 --- a/hyperkitty/templates/messages/message.html +++ b/hyperkitty/templates/messages/message.html @@ -21,7 +21,7 @@ {% gravatar email.sender_email 40 %} </div> <div class="email-author inline-block"> - <span class="name"><a href="{% url message_index mlist_fqdn=mlist.name, message_id_hash=email.message_id_hash %}">{{email.sender_name|escapeemail}}</a></span> + <span class="name"><a href="{% url 'message_index' mlist_fqdn=mlist.name message_id_hash=email.message_id_hash %}">{{email.sender_name|escapeemail}}</a></span> {% if use_mockups %} <br /> <span class="rank"> @@ -39,7 +39,7 @@ <p class="attachments">Attachments:</p> <ul class="attachments-list"> {% for attachment in email.attachments %} - <li><a href="{% url message_attachment mlist_fqdn=mlist.name, message_id_hash=email.message_id_hash, counter=attachment.counter, filename=attachment.name %}">{{attachment.name}}</a> + <li><a href="{% url 'message_attachment' mlist_fqdn=mlist.name message_id_hash=email.message_id_hash counter=attachment.counter filename=attachment.name %}">{{attachment.name}}</a> ({{attachment.content_type}} — {{attachment.size|filesizeformat}}) </li> {% endfor %} @@ -54,7 +54,7 @@ <a class="attachments" href="#attachments">{{ email.attachments|count }} attachment(s)</a> <ul class="attachments-list"> {% for attachment in email.attachments %} - <li><a href="{% url message_attachment mlist_fqdn=mlist.name, message_id_hash=email.message_id_hash, counter=attachment.counter, filename=attachment.name %}">{{attachment.name}}</a> + <li><a href="{% url 'message_attachment' mlist_fqdn=mlist.name message_id_hash=email.message_id_hash counter=attachment.counter filename=attachment.name %}">{{attachment.name}}</a> ({{attachment.content_type}} — {{attachment.size|filesizeformat}}) </li> {% endfor %} diff --git a/hyperkitty/templates/messages/reply_form.html b/hyperkitty/templates/messages/reply_form.html index 15a0ddb..755488c 100644 --- a/hyperkitty/templates/messages/reply_form.html +++ b/hyperkitty/templates/messages/reply_form.html @@ -2,7 +2,7 @@ <div class="reply-form dropdown"> <p class="reply-tools">[<a href="#" class="quote">Quote</a>]</p> <form method="post" - action="{% url message_reply mlist_fqdn=mlist_fqdn, message_id_hash=message_id_hash %}"> + action="{% url 'message_reply' mlist_fqdn=mlist_fqdn message_id_hash=message_id_hash %}"> {% csrf_token %} {{ reply_form.as_p }} <p class="buttons"> diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html index 95d4d97..ee93aa3 100644 --- a/hyperkitty/templates/thread.html +++ b/hyperkitty/templates/thread.html @@ -21,7 +21,7 @@ {% for thread in neighbors %} {% if thread %} <a class="thread-{% ifequal forloop.counter 1 %}older{% else %}newer{% endifequal %}" - href="{% url thread threadid=thread.thread_id, mlist_fqdn=mlist.name %}" + href="{% url 'thread' threadid=thread.thread_id mlist_fqdn=mlist.name %}" title="{{ thread.subject|strip_subject:mlist|escape }}">{{ thread.subject|strip_subject:mlist|truncatesmart:"22" }}</a> {% endif %} {% endfor %} @@ -40,10 +40,10 @@ <p class="sort-mode"> {% if sort_mode == "date" %} - <a href="{% url thread threadid=threadid, mlist_fqdn=mlist.name %}?sort=thread" + <a href="{% url 'thread' threadid=threadid mlist_fqdn=mlist.name %}?sort=thread" >Show replies by thread</a> {% else %} - <a href="{% url thread threadid=threadid, mlist_fqdn=mlist.name %}?sort=date" + <a href="{% url 'thread' threadid=threadid mlist_fqdn=mlist.name %}?sort=date" >Show replies by date</a> {% endif %} </p> diff --git a/hyperkitty/templates/thread_list.html b/hyperkitty/templates/thread_list.html index 2e2c5ca..0fc0f81 100644 --- a/hyperkitty/templates/thread_list.html +++ b/hyperkitty/templates/thread_list.html @@ -16,7 +16,7 @@ <div id="thread-list" class="span8"> <div class="thread-list-header page-header"> - <a href="{% url message_new mlist_fqdn=mlist.name %}" + <a href="{% url "message_new" mlist_fqdn=mlist.name %}" class="thread-new btn{% if not user.is_authenticated %} disabled" title="You must be logged-in to create a thread.{% endif %}" ><strong>+</strong> Start a new thread</a> <h1>{{ mlist.display_name|default:mlist.name|escapeemail }} diff --git a/hyperkitty/templates/threads/month_list.html b/hyperkitty/templates/threads/month_list.html index f7178af..9143704 100644 --- a/hyperkitty/templates/threads/month_list.html +++ b/hyperkitty/templates/threads/month_list.html @@ -6,7 +6,7 @@ <ul> {% for ar_month in months %} <li class="{% if month and year == month.year and ar_month == month.month %}current{% endif %}"> - <a href="{% url archives_with_month year=year, mlist_fqdn=mlist.name, month=ar_month %}" + <a href="{% url 'archives_with_month' year=year mlist_fqdn=mlist.name month=ar_month %}" >{{ ar_month|monthtodate:year|date:"F" }}</a> </li> {% endfor %} diff --git a/hyperkitty/templates/threads/right_col.html b/hyperkitty/templates/threads/right_col.html index 7c34c18..1c9ca26 100644 --- a/hyperkitty/templates/threads/right_col.html +++ b/hyperkitty/templates/threads/right_col.html @@ -23,7 +23,7 @@ </div> </div> <form id="fav_form" name="favorite" method="post" class="favorite" - action="{% url favorite mlist_fqdn=mlist.name, threadid=threadid %}"> + action="{% url 'favorite' mlist_fqdn=mlist.name threadid=threadid %}"> {% csrf_token %} <input type="hidden" name="action" value="{{ fav_action }}" /> <p> @@ -37,7 +37,7 @@ </div> <div id="add-tag"> <form id="add-tag-form" name="addtag" method="post" - action="{% url add_tag mlist_fqdn=mlist.name, threadid=threadid %}"> + action="{% url 'add_tag' mlist_fqdn=mlist.name threadid=threadid %}"> {% csrf_token %} {{ addtag_form.as_p }} </form> diff --git a/hyperkitty/templates/threads/summary_thread.html b/hyperkitty/templates/threads/summary_thread.html index f6bd1d9..4f76d5b 100644 --- a/hyperkitty/templates/threads/summary_thread.html +++ b/hyperkitty/templates/threads/summary_thread.html @@ -4,19 +4,19 @@ <div class="thread"> <span class="thread-id">#{{counter}}</span> <span class="thread-title"><a name="{{thread.thread_id}}" - href="{% url thread threadid=thread.thread_id, mlist_fqdn=mlist.name %}" + href="{% url 'thread' threadid=thread.thread_id mlist_fqdn=mlist.name %}" >{{ thread.subject|strip_subject:mlist }}</a></span> <div class="thread_stats"> <ul class="inline-block"> {% if thread.category_tag %} <li class="type type_{{thread.category_tag}}"> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=thread.category_tag %}" + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=thread.category_tag %}" >{{thread.category}}</a> </li> {% endif %} {% if thread.category %} <li class="type type_{{thread.category|lower}}"> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=thread.category|lower %}" + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=thread.category|lower %}" >{{thread.category}}</a> </li> {% endif %} diff --git a/hyperkitty/templates/threads/summary_thread_large.html b/hyperkitty/templates/threads/summary_thread_large.html index ad10a27..40a244f 100644 --- a/hyperkitty/templates/threads/summary_thread_large.html +++ b/hyperkitty/templates/threads/summary_thread_large.html @@ -5,20 +5,20 @@ <div class="thread"> <div class="{% if thread.favorite %}saved{% else %}notsaved{% endif %}"> <span class="thread-title"><a name="{{thread.thread_id}}" - href="{% url thread threadid=thread.thread_id, mlist_fqdn=mlist.name %}" + href="{% url 'thread' threadid=thread.thread_id mlist_fqdn=mlist.name %}" >{{ thread.starting_email.subject|strip_subject:mlist }}</a></span> <span class="thread-date">{{thread.date_active|timesince }}</span> </div> <div class="thread-content"> {% if thread.category_tag %} <div class="inline-block type type_{{thread.category_tag}}"> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=thread.category_tag %}" + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=thread.category_tag %}" >{{thread.category}}</a> </div> {% endif %} {% if thread.category %} <div class="inline-block type type_{{thread.category|lower}}"> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=thread.category|lower %}" + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=thread.category|lower %}" >{{thread.category}}</a> </div> {% endif %} @@ -42,7 +42,7 @@ <ul class="tags inline"> {% for tag in thread.tags %} <li> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=tag.tag %}">{{tag.tag}}</a> + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=tag.tag %}">{{tag.tag}}</a> </li> {% endfor %} </ul> @@ -51,7 +51,7 @@ <span class="participant">{{ thread.participants|length }} participants</span> <span class="discussion">{{ thread|length }} comments</span> {% include "messages/like_form.html" with message_id_hash=thread.starting_email.message_id_hash object=thread %} - <a href="{% url thread threadid=thread.thread_id, mlist_fqdn=mlist.name %}" + <a href="{% url 'thread' threadid=thread.thread_id mlist_fqdn=mlist.name %}" class="btn thread-show">Show discussion</a> </div> </div> diff --git a/hyperkitty/templates/threads/tags.html b/hyperkitty/templates/threads/tags.html index 68fabf2..0715739 100644 --- a/hyperkitty/templates/threads/tags.html +++ b/hyperkitty/templates/threads/tags.html @@ -3,7 +3,7 @@ <ul class="inline"> {% for tag in tags %} <li> - <a href="{% url search_tag mlist_fqdn=mlist.name, tag=tag.tag %}" >{{ tag.tag }}</a> + <a href="{% url 'search_tag' mlist_fqdn=mlist.name tag=tag.tag %}" >{{ tag.tag }}</a> {% if not forloop.last %} <span>|</span> {% endif %} </li> {% endfor %} diff --git a/hyperkitty/templates/user_profile.html b/hyperkitty/templates/user_profile.html index ff154a8..e409c2e 100644 --- a/hyperkitty/templates/user_profile.html +++ b/hyperkitty/templates/user_profile.html @@ -14,7 +14,7 @@ <h1>User profile <small>for {{ user }}</small></h1> - <form method="post" action="{% url user_profile %}"> + <form method="post" action="{% url 'user_profile' %}"> {% csrf_token %} <table class="table table-bordered table-striped user-data"> <tbody> @@ -57,7 +57,7 @@ <ul> {% for fav in favorites %} <li> - <a href="{% url thread mlist_fqdn=fav.list_address, threadid=fav.threadid %}" + <a href="{% url 'thread' mlist_fqdn=fav.list_address threadid=fav.threadid %}" >{{ fav.thread.starting_email.subject }}</a> by {{ fav.thread.starting_email.sender_name }} ({{ fav.thread|viewer_date|date:"l, j F Y H:i:s" }}) </li> @@ -75,11 +75,11 @@ {% for vote in votes_up %} <li> {% if vote.message.content|trimString|length > 0 %} - <a href="{% url message_index mlist_fqdn=vote.list_address, message_id_hash=vote.messageid %}" + <a href="{% url 'message_index' mlist_fqdn=vote.list_address message_id_hash=vote.messageid %}" >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }} ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }}) {% else %} - <a href="{% url message_index mlist_fqdn=vote.list_address, message_id_hash=vote.messageid %}">Message is empty</a> + <a href="{% url 'message_index' mlist_fqdn=vote.list_address message_id_hash=vote.messageid %}">Message is empty</a> {% endif %} </li> {% endfor %} @@ -94,11 +94,11 @@ {% for vote in votes_down %} <li> {% if vote.message.content|trimString|length > 0 %} - <a href="{% url message_index mlist_fqdn=vote.list_address, message_id_hash=vote.messageid %}" + <a href="{% url 'message_index' mlist_fqdn=vote.list_address message_id_hash=vote.messageid %}" >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }} ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }}) {% else %} - <a href="{% url message_index mlist_fqdn=vote.list_address, message_id_hash=vote.messageid %}">Message is empty</a> + <a href="{% url 'message_index' mlist_fqdn=vote.list_address message_id_hash=vote.messageid %}">Message is empty</a> {% endif %} </li> {% endfor %} diff --git a/hyperkitty/urls.py b/hyperkitty/urls.py index df580e6..887c54f 100644 --- a/hyperkitty/urls.py +++ b/hyperkitty/urls.py @@ -20,7 +20,7 @@ # Author: Aurelien Bompard <abompard@fedoraproject.org> # -from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, include, url from django.conf import settings from django.views.generic.base import TemplateView from api import EmailResource, ThreadResource, SearchResource |