some fixes

This commit is contained in:
Oskar Hahn 2012-04-12 16:21:30 +02:00
parent 497a8cdb70
commit fc95d01d07
6 changed files with 35 additions and 24 deletions

View File

@ -16,6 +16,7 @@ from django.db import models
from django.db.models import Max from django.db.models import Max
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from projector.api import register_slidemodel from projector.api import register_slidemodel
from projector.models import SlideMixin from projector.models import SlideMixin
@ -517,3 +518,6 @@ class ApplicationPoll(BasePoll, CountInvalid, CountVotesCast):
def append_pollform_fields(self, fields): def append_pollform_fields(self, fields):
CountInvalid.append_pollform_fields(self, fields) CountInvalid.append_pollform_fields(self, fields)
CountVotesCast.append_pollform_fields(self, fields) CountVotesCast.append_pollform_fields(self, fields)
def get_absolute_url(self):
return reverse('application_poll_view', args=[self.id])

View File

@ -21,7 +21,7 @@
<p>{%trans "Results of" %} {{ ballot }}. {%trans "Vote" %}</p> <p>{%trans "Results of" %} {{ ballot }}. {%trans "Vote" %}</p>
<i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i> <i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i>
<form action="" method="post">{% csrf_token %} <form action="" method="post" class="small-form">{% csrf_token %}
<span id="poll_id" style="display:none">{{ poll.id }}</span> <span id="poll_id" style="display:none">{{ poll.id }}</span>
<table class="table" style="width: auto;"> <table class="table" style="width: auto;">
<tr> <tr>

View File

@ -20,77 +20,77 @@ urlpatterns = patterns('application.views',
url(r'^application/$', 'overview', \ url(r'^application/$', 'overview', \
name='application_overview'), name='application_overview'),
url(r'^application/(?P<application_id>\d+)$', 'view', \ url(r'^application/(?P<application_id>\d+)/$', 'view', \
name='application_view'), name='application_view'),
url(r'^application/(?P<application_id>\d+)/newest$', 'view', {'newest': True}, \ url(r'^application/(?P<application_id>\d+)/newest/$', 'view', {'newest': True}, \
name='application_view_newest'), name='application_view_newest'),
url(r'^application/new$', 'edit', \ url(r'^application/new/$', 'edit', \
name='application_new'), name='application_new'),
url(r'^application/import$', 'application_import', \ url(r'^application/import/$', 'application_import', \
name='application_import'), name='application_import'),
url(r'^application/(?P<application_id>\d+)/edit$', 'edit', \ url(r'^application/(?P<application_id>\d+)/edit/$', 'edit', \
name='application_edit'), name='application_edit'),
url(r'^application/(?P<application_id>\d+)/del$', 'delete', \ url(r'^application/(?P<application_id>\d+)/del/$', 'delete', \
name='application_delete'), name='application_delete'),
url(r'^application/(?P<application_id>\d+)/setnumber$', 'set_number', \ url(r'^application/(?P<application_id>\d+)/setnumber/$', 'set_number', \
name='application_set_number'), name='application_set_number'),
url(r'^application/(?P<application_id>\d+)/setstatus/' \ url(r'^application/(?P<application_id>\d+)/setstatus/' \
'(?P<status>[a-z]{3})$', 'set_status', \ '(?P<status>[a-z]{3})/$', 'set_status', \
name='application_set_status'), name='application_set_status'),
url(r'^application/(?P<application_id>\d+)/permit$', 'permit', \ url(r'^application/(?P<application_id>\d+)/permit/$', 'permit', \
name='application_permit'), name='application_permit'),
url(r'^application/version/(?P<aversion_id>\d+)/permit$', 'permit_version', \ url(r'^application/version/(?P<aversion_id>\d+)/permit/$', 'permit_version', \
name='application_version_permit'), name='application_version_permit'),
url(r'^application/version/(?P<aversion_id>\d+)/reject$', 'reject_version', \ url(r'^application/version/(?P<aversion_id>\d+)/reject/$', 'reject_version', \
name='application_version_reject'), name='application_version_reject'),
url(r'^application/(?P<application_id>\d+)/notpermit$', 'notpermit', \ url(r'^application/(?P<application_id>\d+)/notpermit/$', 'notpermit', \
name='application_notpermit'), name='application_notpermit'),
url(r'^application/(?P<application_id>\d+)/reset$', 'reset', \ url(r'^application/(?P<application_id>\d+)/reset/$', 'reset', \
name='application_reset'), name='application_reset'),
url(r'^application/(?P<application_id>\d+)/support$', 'support', \ url(r'^application/(?P<application_id>\d+)/support/$', 'support', \
name='application_support'), name='application_support'),
url(r'^application/(?P<application_id>\d+)/unsupport$', 'unsupport', \ url(r'^application/(?P<application_id>\d+)/unsupport/$', 'unsupport', \
name='application_unsupport'), name='application_unsupport'),
url(r'^application/(?P<application_id>\d+)/set_active/$', 'set_active', url(r'^application/(?P<application_id>\d+)/set_active/$', 'set_active',
name='application_activate_item'), name='application_activate_item'),
url(r'^application/(?P<application_id>\d+)/gen_poll$', 'gen_poll', \ url(r'^application/(?P<application_id>\d+)/gen_poll/$', 'gen_poll', \
name='application_gen_poll'), name='application_gen_poll'),
url(r'^application/print$', 'print_application', \ url(r'^application/print/$', 'print_application', \
name='print_applications'), name='print_applications'),
url(r'^application/(?P<application_id>\d+)/print$', 'print_application', \ url(r'^application/(?P<application_id>\d+)/print/$', 'print_application', \
name='print_application'), name='print_application'),
url(r'^application/poll/(?P<poll_id>\d+)/print$', 'print_application_poll', \ url(r'^application/poll/(?P<poll_id>\d+)/print/$', 'print_application_poll', \
name='print_application_poll'), name='print_application_poll'),
url(r'^application/poll/(?P<poll_id>\d+)$', url(r'^application/poll/(?P<poll_id>\d+)/$',
ViewPoll.as_view(), ViewPoll.as_view(),
name='application_poll_view', name='application_poll_view',
), ),
url(r'^application/poll/(?P<poll_id>\d+)/activate$', url(r'^application/poll/(?P<poll_id>\d+)/activate/$',
ActivatePoll.as_view(), ActivatePoll.as_view(),
name='application_poll_activate', name='application_poll_activate',
), ),
url(r'^application/poll/(?P<poll_id>\d+)/del$', 'delete_poll', \ url(r'^application/poll/(?P<poll_id>\d+)/del/$', 'delete_poll', \
name='application_poll_delete'), name='application_poll_delete'),
) )

View File

@ -13,7 +13,6 @@ class OptionForm(forms.Form, CssClassMixin):
for key, value in extra: for key, value in extra:
self.fields[key] = forms.IntegerField( self.fields[key] = forms.IntegerField(
widget=forms.TextInput(attrs={'class': 'small-input'}),
label=_(key), label=_(key),
initial=value, initial=value,
) )

View File

@ -145,6 +145,9 @@ class BasePoll(models.Model, SlideMixin):
# data['template'] = 'projector/TODO.html' # data['template'] = 'projector/TODO.html'
return data return data
def get_absolute_url(self):
return ''
def print_value(value): def print_value(value):
if value == -1: if value == -1:

View File

@ -417,6 +417,11 @@ input[type="submit"], input[type="button"] {
.small-input { .small-input {
width: 40px !important; width: 40px !important;
} }
.small-form input {
width: 40px !important;
}
.medium-input { .medium-input {
width: 200px !important; width: 200px !important;
} }