From: Matthijs Kooijman Date: Sun, 27 Jan 2008 14:47:51 +0000 (+0100) Subject: * Use the url function in urls.py. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=inline;h=57bf7e050a270a5ff6149122d81a8a150362dec2;hp=f20714a87b4d0934040a979ca52f615b9a5167cb;p=matthijs%2Fprojects%2Fxerxes.git * 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. --- 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: