Changed url 'item' to 'agenda'.

This commit is contained in:
Emanuel Schuetze 2011-09-04 19:22:30 +02:00
parent e85f5b4f1e
commit b7a1afd3a2
7 changed files with 33 additions and 33 deletions

View File

@ -8,7 +8,7 @@
<ul>
<li class="{% if request.path == url_itemoverview %}selected{% endif %}"><a href="{% url item_overview %}">{%trans "All items" %}</a></li>
{% if perms.agenda.can_manage_agenda %}
<li class="{% active request '/item/new/' %}"><a href="{% url item_new 'ItemText' %}">{%trans "New item" %}</a></li>
<li class="{% active request '/agenda/new/' %}"><a href="{% url item_new 'ItemText' %}">{%trans "New item" %}</a></li>
{% endif %}
{% if perms.agenda.can_see_projector %}
<li><a href="{% url item_beamer %}"><img src="/static/images/icons/view-presentation.png"> {%trans 'Beamer view' %}</a></li>

View File

@ -10,13 +10,13 @@
<p>{%trans "Choose item type:" %}</p>
<p>
<a href="{% url item_new 'ItemText' %}"
{% ifequal request.path '/item/new/ItemText/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
{% ifequal request.path '/agenda/new/ItemText/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
>{%trans "Item of Text" %}</a> |
<a href="{% url item_new 'ItemApplication' %}"
{% ifequal request.path '/item/new/ItemApplication/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
{% ifequal request.path '/agenda/new/ItemApplication/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
>{%trans "Item of Application" %}</a> |
<a href="{% url item_new 'ItemAssignment' %}"
{% ifequal request.path '/item/new/ItemAssignment/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
{% ifequal request.path '/agenda/new/ItemAssignment/' %}style='font-size:15px; font-weight:bold;'{% endifequal %}
>{%trans "Item of Election" %}</a>
</p>
{% endif %}

View File

@ -37,7 +37,7 @@
{% block content %}
<h1>{% trans "Agenda" %}</h1>
{% if items %}
<form action="/item/" method="post">{% csrf_token %}
<form action="/agenda/" method="post">{% csrf_token %}
{% if perms.agenda.can_manage_agenda %}
<div id="changed-order-message" style="display:none" class="notification warning">
<em>{% trans "Do you want to save the changed order of agenda items?" %}<br>
@ -60,7 +60,7 @@
<th class="tabledrag-hide">{% trans "Weight" %}</th>
{% endif %}
</tr>
<tr id="item_row_0"{% if overview %} class="activeline"{% else %}{% if perms.agenda.can_manage_agenda %} class="inactiveline"{% endif %}{% endif %}>
<tr id="item_row_0" class="topline {% if overview %} activeline {% else %}{% if perms.agenda.can_manage_agenda %} inactiveline {% endif %}{% endif %}">
<td class="select">
{% if perms.agenda.can_manage_agenda %}
<a href="{% url item_activate 0 %}" class="activate_link">
@ -68,7 +68,7 @@
</a>
{% endif %}
</td>
<td><i>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</i></td>
<td><b>{% trans "Agenda" %} ({{ items|length }} {% trans "items" %}<span id="hiddencount"></span>)</b></td>
{% if perms.agenda.can_manage_agenda %}
<td></td>
{% endif %}

View File

@ -119,7 +119,7 @@ class ViewTest(TestCase):
response = c.get('/beamer/')
self.assertEqual(response.status_code, 200)
response = c.get('/item/%d/' % self.item1.id)
response = c.get('/agenda/%d/' % self.item1.id)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['item'], self.item1.cast())
self.assertEqual(response.templates[0].name, 'beamer/ItemText.html')
@ -127,26 +127,26 @@ class ViewTest(TestCase):
def testActivate(self):
c = self.adminClient
response = c.get('/item/%d/activate/' % self.item1.id)
response = c.get('/agenda/%d/activate/' % self.item1.id)
self.assertEqual(response.status_code, 302)
self.assertTrue(self.item1.active)
self.assertFalse(self.item2.active)
self.assertFalse(is_summary())
response = c.get('/item/%d/activate/summary/' % self.item2.id)
response = c.get('/agenda/%d/activate/summary/' % self.item2.id)
self.assertEqual(response.status_code, 302)
self.assertTrue(self.item2.active)
self.assertFalse(self.item1.active)
self.assertTrue(is_summary())
response = c.get('/item/%d/activate/' % 0)
response = c.get('/agenda/%d/activate/' % 0)
self.assertEqual(response.status_code, 302)
self.assertFalse(self.item2.active)
self.assertFalse(self.item1.active)
with self.assertRaises(Item.DoesNotExist):
get_active_item()
response = c.get('/item/%d/activate/' % 10000)
response = c.get('/agenda/%d/activate/' % 10000)
self.assertEqual(response.status_code, 302)
self.assertFalse(self.item2.active)
self.assertFalse(self.item1.active)
@ -154,40 +154,40 @@ class ViewTest(TestCase):
def testClose(self):
c = self.adminClient
response = c.get('/item/%d/close/' % self.item1.id)
response = c.get('/agenda/%d/close/' % self.item1.id)
self.refreshItems()
self.assertEqual(response.status_code, 302)
self.assertTrue(Item.objects.get(pk=self.item1.id).closed)
response = c.get('/item/%d/open/' % self.item1.id)
response = c.get('/agenda/%d/open/' % self.item1.id)
self.refreshItems()
self.assertEqual(response.status_code, 302)
self.assertFalse(self.item1.closed)
response = c.get('/item/%d/open/' % 1000)
response = c.get('/agenda/%d/open/' % 1000)
self.refreshItems()
self.assertEqual(response.status_code, 302)
def testEdit(self):
c = self.adminClient
response = c.get('/item/%d/edit/' % self.item1.id)
response = c.get('/agenda/%d/edit/' % self.item1.id)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['form'].instance, self.item1.cast())
response = c.get('/item/%d/edit/' % 1000)
response = c.get('/agenda/%d/edit/' % 1000)
self.assertEqual(response.status_code, 302)
data = {'title': 'newitem1', 'text': 'item1-text', 'weight':'0'}
response = c.post('/item/%d/edit/' % self.item1.id, data)
response = c.post('/agenda/%d/edit/' % self.item1.id, data)
self.assertEqual(response.status_code, 302)
self.refreshItems()
self.assertEqual(self.item1.cast().title, 'newitem1')
self.assertEqual(self.item1.cast().text, 'item1-text')
data = {'title': '', 'text': 'item1-text', 'weight': '0'}
response = c.post('/item/%d/edit/' % self.item1.id, data)
response = c.post('/agenda/%d/edit/' % self.item1.id, data)
self.assertEqual(response.status_code, 200)
self.refreshItems()
self.assertEqual(self.item1.cast().title, 'newitem1')

View File

@ -18,43 +18,43 @@ urlpatterns = patterns('agenda.views',
url(r'^$', 'overview'),
url(r'^item/$', 'overview',
url(r'^agenda/$', 'overview',
name='item_overview'),
url(r'^item/(?P<item_id>\d+)/$', 'view',
url(r'^agenda/(?P<item_id>\d+)/$', 'view',
name='item_view'),
url(r'^item/(?P<item_id>\d+)/activate/$', 'set_active',
url(r'^agenda/(?P<item_id>\d+)/activate/$', 'set_active',
name='item_activate'),
url(r'^item/(?P<item_id>\d+)/activate/summary/$', 'set_active',
url(r'^agenda/(?P<item_id>\d+)/activate/summary/$', 'set_active',
{'summary': True},\
name='item_activate_summary'),
url(r'^item/(?P<item_id>\d+)/close/$', 'set_closed', {'closed': True},
url(r'^agenda/(?P<item_id>\d+)/close/$', 'set_closed', {'closed': True},
name='item_close'),
url(r'^item/(?P<item_id>\d+)/open/$', 'set_closed', {'closed': False},
url(r'^agenda/(?P<item_id>\d+)/open/$', 'set_closed', {'closed': False},
name='item_open'),
url(r'^item/(?P<item_id>\d+)/edit/$', 'edit',
url(r'^agenda/(?P<item_id>\d+)/edit/$', 'edit',
name='item_edit'),
url(r'^item/new/$', 'edit',
url(r'^agenda/new/$', 'edit',
name='item_new_default'),
url(r'^item/new/(?P<form>ItemText|ItemApplication|ItemPoll|'
url(r'^agenda/new/(?P<form>ItemText|ItemApplication|ItemPoll|'
r'ItemAssignment)/$', 'edit',
name='item_new'),
url(r'^item/new/(?P<form>ItemText|ItemApplication|ItemPoll|'
url(r'^agenda/new/(?P<form>ItemText|ItemApplication|ItemPoll|'
r'ItemAssignment)/(?P<default>\d+)/$', 'edit',
name='item_new_default'),
url(r'^item/(?P<item_id>\d+)/del/$', 'delete',
url(r'^agenda/(?P<item_id>\d+)/del/$', 'delete',
name='item_delete'),
url(r'^item/print/$', 'print_agenda',
url(r'^agenda/print/$', 'print_agenda',
name='print_agenda'),
url(r'^beamer/bigger$', 'beamer_edit', {'direction': 'bigger'}, name='beamer_bigger'),

View File

@ -19,7 +19,7 @@ TEMPLATE_DEBUG = DEBUG
AUTH_PROFILE_MODULE = 'participant.Profile'
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/item/'
LOGIN_REDIRECT_URL = '/agenda/'
ADMINS = (
# ('Your Name', 'your_email@domain.com'),

View File

@ -32,7 +32,7 @@
{% block mainmenu %}
<ul>
{% if perms.agenda.can_see_agenda or perms.agenda.can_manage_agenda %}
<li class="{% active request '/item' %}
<li class="{% active request '/agenda' %}
{% if request.path == '/'%}selected{% endif %}">
<a href="{% url item_overview %}" title="">{%trans "Agenda" %}</a></li>
{% endif %}