From 57bf7e050a270a5ff6149122d81a8a150362dec2 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 27 Jan 2008 15:47:51 +0100 Subject: [PATCH] * Use the url function in urls.py. * Give all views a name. * Refer to views using the url template tag and the view name instead of hard coding. --- templates/influences/character_detail.html | 2 +- templates/influences/index.html | 8 +++----- urls.py | 21 +++++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/templates/influences/character_detail.html b/templates/influences/character_detail.html index 3127985..d418529 100644 --- a/templates/influences/character_detail.html +++ b/templates/influences/character_detail.html @@ -11,6 +11,6 @@ {% endfor %} -{% trans "Submit influence" %} +{% trans "Submit influence" %} {% endblock %} diff --git a/templates/influences/index.html b/templates/influences/index.html index 5a6de5e..888aee8 100644 --- a/templates/influences/index.html +++ b/templates/influences/index.html @@ -7,21 +7,19 @@ {% if characters %} {% else %}

{% trans "No characters. Add a character first, so you can submit your influences." %}

{% endif %} -

{% trans "Add character" %}

+

{% trans "Add character" %}

{% trans "Your influences" %}

{% if influences %} @@ -29,5 +27,5 @@

{% trans "No influences yet." %}

{% endif %} -

{% trans "Submit influence" %}

+

{% trans "Submit influence" %}

{% endblock %} diff --git a/urls.py b/urls.py index e7597b1..a26fa4a 100644 --- a/urls.py +++ b/urls.py @@ -7,16 +7,17 @@ chars_dict = { } urlpatterns = patterns('', - (r'^admin/', include('django.contrib.admin.urls')), - (r'^events/event/(?P\d+)/$', 'ee.events.views.event.detail'), - (r'^events/event/(?P\d+)/regs$', 'ee.events.views.event.regs'), - (r'^influences/add/(\d+)?/?$', 'ee.influences.views.add'), - (r'^influences/$', 'ee.influences.views.index'), - (r'^influences/character/$', 'django.views.generic.list_detail.object_list', chars_dict), - (r'^influences/character/(?P\d+)/$', 'django.views.generic.list_detail.object_detail', chars_dict), - (r'^influences/character/add/$', 'ee.influences.views.addCharacter'), - (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}), - (r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'), + url(r'^admin/', include('django.contrib.admin.urls')), + url(r'^events/event/(?P\d+)/$', 'ee.events.views.event.detail'), + url(r'^events/event/(?P\d+)/regs$', 'ee.events.views.event.regs'), + url(r'^influences/add/(\d+)/$', 'ee.influences.views.add', name='influences_add_influence_for_character'), + url(r'^influences/add/$', 'ee.influences.views.add', name='influences_add_influence'), + url(r'^influences/$', 'ee.influences.views.index', name='influences_index'), + url(r'^influences/character/$', 'django.views.generic.list_detail.object_list', chars_dict, name='influences_character_list'), + url(r'^influences/character/(?P\d+)/$', 'django.views.generic.list_detail.object_detail', chars_dict, name='influences_character_detail'), + url(r'^influences/character/add/$', 'ee.influences.views.addCharacter', name='influences_add_character'), + url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}), + url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'), ) if settings.DEBUG: -- 2.30.2