From fc95d01d0726c53e3f17887409554e9ef4ed5258 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 12 Apr 2012 16:21:30 +0200 Subject: [PATCH] some fixes --- openslides/application/models.py | 4 ++ .../templates/application/poll_view.html | 2 +- openslides/application/urls.py | 44 +++++++++---------- openslides/poll/forms.py | 1 - openslides/poll/models.py | 3 ++ openslides/static/styles/base.css | 5 +++ 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/openslides/application/models.py b/openslides/application/models.py index d0df151eb..5177cd761 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -16,6 +16,7 @@ from django.db import models from django.db.models import Max from django.contrib.auth.models import User from django.utils.translation import ugettext as _ +from django.core.urlresolvers import reverse from projector.api import register_slidemodel from projector.models import SlideMixin @@ -517,3 +518,6 @@ class ApplicationPoll(BasePoll, CountInvalid, CountVotesCast): def append_pollform_fields(self, fields): CountInvalid.append_pollform_fields(self, fields) CountVotesCast.append_pollform_fields(self, fields) + + def get_absolute_url(self): + return reverse('application_poll_view', args=[self.id]) diff --git a/openslides/application/templates/application/poll_view.html b/openslides/application/templates/application/poll_view.html index 6d2a4dd34..31ba0fdc9 100644 --- a/openslides/application/templates/application/poll_view.html +++ b/openslides/application/templates/application/poll_view.html @@ -21,7 +21,7 @@

{%trans "Results of" %} {{ ballot }}. {%trans "Vote" %}

-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %} -
{% csrf_token %} + {% csrf_token %} diff --git a/openslides/application/urls.py b/openslides/application/urls.py index 6d513e460..b51f33967 100644 --- a/openslides/application/urls.py +++ b/openslides/application/urls.py @@ -20,77 +20,77 @@ urlpatterns = patterns('application.views', url(r'^application/$', 'overview', \ name='application_overview'), - url(r'^application/(?P\d+)$', 'view', \ + url(r'^application/(?P\d+)/$', 'view', \ name='application_view'), - url(r'^application/(?P\d+)/newest$', 'view', {'newest': True}, \ + url(r'^application/(?P\d+)/newest/$', 'view', {'newest': True}, \ name='application_view_newest'), - url(r'^application/new$', 'edit', \ + url(r'^application/new/$', 'edit', \ name='application_new'), - url(r'^application/import$', 'application_import', \ + url(r'^application/import/$', 'application_import', \ name='application_import'), - url(r'^application/(?P\d+)/edit$', 'edit', \ + url(r'^application/(?P\d+)/edit/$', 'edit', \ name='application_edit'), - url(r'^application/(?P\d+)/del$', 'delete', \ + url(r'^application/(?P\d+)/del/$', 'delete', \ name='application_delete'), - url(r'^application/(?P\d+)/setnumber$', 'set_number', \ + url(r'^application/(?P\d+)/setnumber/$', 'set_number', \ name='application_set_number'), url(r'^application/(?P\d+)/setstatus/' \ - '(?P[a-z]{3})$', 'set_status', \ + '(?P[a-z]{3})/$', 'set_status', \ name='application_set_status'), - url(r'^application/(?P\d+)/permit$', 'permit', \ + url(r'^application/(?P\d+)/permit/$', 'permit', \ name='application_permit'), - url(r'^application/version/(?P\d+)/permit$', 'permit_version', \ + url(r'^application/version/(?P\d+)/permit/$', 'permit_version', \ name='application_version_permit'), - url(r'^application/version/(?P\d+)/reject$', 'reject_version', \ + url(r'^application/version/(?P\d+)/reject/$', 'reject_version', \ name='application_version_reject'), - url(r'^application/(?P\d+)/notpermit$', 'notpermit', \ + url(r'^application/(?P\d+)/notpermit/$', 'notpermit', \ name='application_notpermit'), - url(r'^application/(?P\d+)/reset$', 'reset', \ + url(r'^application/(?P\d+)/reset/$', 'reset', \ name='application_reset'), - url(r'^application/(?P\d+)/support$', 'support', \ + url(r'^application/(?P\d+)/support/$', 'support', \ name='application_support'), - url(r'^application/(?P\d+)/unsupport$', 'unsupport', \ + url(r'^application/(?P\d+)/unsupport/$', 'unsupport', \ name='application_unsupport'), url(r'^application/(?P\d+)/set_active/$', 'set_active', name='application_activate_item'), - url(r'^application/(?P\d+)/gen_poll$', 'gen_poll', \ + url(r'^application/(?P\d+)/gen_poll/$', 'gen_poll', \ name='application_gen_poll'), - url(r'^application/print$', 'print_application', \ + url(r'^application/print/$', 'print_application', \ name='print_applications'), - url(r'^application/(?P\d+)/print$', 'print_application', \ + url(r'^application/(?P\d+)/print/$', 'print_application', \ name='print_application'), - url(r'^application/poll/(?P\d+)/print$', 'print_application_poll', \ + url(r'^application/poll/(?P\d+)/print/$', 'print_application_poll', \ name='print_application_poll'), - url(r'^application/poll/(?P\d+)$', + url(r'^application/poll/(?P\d+)/$', ViewPoll.as_view(), name='application_poll_view', ), - url(r'^application/poll/(?P\d+)/activate$', + url(r'^application/poll/(?P\d+)/activate/$', ActivatePoll.as_view(), name='application_poll_activate', ), - url(r'^application/poll/(?P\d+)/del$', 'delete_poll', \ + url(r'^application/poll/(?P\d+)/del/$', 'delete_poll', \ name='application_poll_delete'), ) diff --git a/openslides/poll/forms.py b/openslides/poll/forms.py index 352462293..c0086811d 100644 --- a/openslides/poll/forms.py +++ b/openslides/poll/forms.py @@ -13,7 +13,6 @@ class OptionForm(forms.Form, CssClassMixin): for key, value in extra: self.fields[key] = forms.IntegerField( - widget=forms.TextInput(attrs={'class': 'small-input'}), label=_(key), initial=value, ) diff --git a/openslides/poll/models.py b/openslides/poll/models.py index 02ec12e9b..9269433e0 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -145,6 +145,9 @@ class BasePoll(models.Model, SlideMixin): # data['template'] = 'projector/TODO.html' return data + def get_absolute_url(self): + return '' + def print_value(value): if value == -1: diff --git a/openslides/static/styles/base.css b/openslides/static/styles/base.css index c8f128cb3..2ebd9eea3 100644 --- a/openslides/static/styles/base.css +++ b/openslides/static/styles/base.css @@ -417,6 +417,11 @@ input[type="submit"], input[type="button"] { .small-input { width: 40px !important; } + +.small-form input { + width: 40px !important; +} + .medium-input { width: 200px !important; }