PEP8 errors resolved

This commit is contained in:
Stefan Frauenknecht 2013-02-16 10:41:22 +01:00
parent 488b4285a9
commit 8103c09b81
7 changed files with 72 additions and 44 deletions

View File

@ -10,16 +10,15 @@
:license: GNU GPL, see LICENSE for more details.
"""
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.widgets import AdminTimeWidget
from mptt.forms import TreeNodeChoiceField
from openslides.utils.forms import CssClassMixin
from openslides.agenda.models import Item
import re
class ItemForm(forms.ModelForm, CssClassMixin):
"""
@ -63,6 +62,7 @@ class ItemOrderForm(forms.Form, CssClassMixin):
widget=forms.HiddenInput(attrs={'class': 'menu-plid'}),
)
class ConfigForm(CssClassMixin, forms.Form):
agenda_start_event_date_time = forms.CharField(
widget=forms.DateTimeInput(format='%d.%m.%Y %H:%M'),

View File

@ -46,11 +46,8 @@ class Item(MPTTModel, SlideMixin):
weight = models.IntegerField(default=0, verbose_name=_("Weight"))
parent = TreeForeignKey('self', null=True, blank=True,
related_name='children')
type = models.IntegerField(max_length=1, choices=ITEM_TYPE,
default=AGENDA_ITEM, verbose_name=_("Type"))
type = models.IntegerField(max_length=1, choices=ITEM_TYPE, default=AGENDA_ITEM, verbose_name=_("Type"))
duration = models.CharField(null=True, blank=True, max_length=5, verbose_name=_("Duration (hh:mm)"))
related_sid = models.CharField(null=True, blank=True, max_length=63)
def get_related_slide(self):
@ -179,7 +176,6 @@ class Item(MPTTModel, SlideMixin):
def __unicode__(self):
return self.get_title()
class Meta:
permissions = (
('can_see_agenda', ugettext_noop("Can see agenda")),

View File

@ -10,7 +10,6 @@ tr.topline td {
background-color: #CDCDCD;
}
table#agendatime {
float: right;
width: auto;

View File

@ -1,11 +1,46 @@
/* css for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
/**
* OpenSlides timepicker style
*
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
* :license: GNU GPL, see LICENSE for more details.
*/
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; }
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
.ui-timepicker-div .ui-widget-header {
margin-bottom: 8px;
}
.ui-timepicker-div dl {
text-align: left;
}
.ui-timepicker-div dl dt {
height: 25px;
margin-bottom: -25px;
}
.ui-timepicker-div dl dd {
margin: 0 10px 10px 65px;
}
.ui-timepicker-div td {
font-size: 90%;
}
.ui-tpicker-grid-label {
background: none;
border: none;
margin: 0;
padding: 0;
}
.ui-timepicker-rtl{
direction: rtl;
}
.ui-timepicker-rtl dl {
text-align: right;
}
.ui-timepicker-rtl dl dd {
margin: 0 65px 10px 10px;
}

View File

@ -11,49 +11,43 @@
"""
from django.conf.urls import url, patterns
from openslides.agenda.views import (Overview, View, SetClosed, ItemUpdate,
from openslides.agenda.views import (
Overview, View, SetClosed, ItemUpdate,
ItemCreate, ItemDelete, AgendaPDF)
urlpatterns = patterns('',
urlpatterns = patterns(
'',
url(r'^$',
Overview.as_view(),
name='item_overview',
),
name='item_overview', ),
url(r'^(?P<pk>\d+)/$',
View.as_view(),
name='item_view',
),
name='item_view', ),
url(r'^(?P<pk>\d+)/close/$',
SetClosed.as_view(),
{'closed': True},
name='item_close',
),
name='item_close', ),
url(r'^(?P<pk>\d+)/open/$',
SetClosed.as_view(),
{'closed': False},
name='item_open',
),
name='item_open', ),
url(r'^(?P<pk>\d+)/edit/$',
ItemUpdate.as_view(),
name='item_edit',
),
name='item_edit', ),
url(r'^new/$',
ItemCreate.as_view(),
name='item_new',
),
name='item_new', ),
url(r'^(?P<pk>\d+)/del/$',
ItemDelete.as_view(),
name='item_delete',
),
name='item_delete', ),
url(r'^print/$',
AgendaPDF.as_view(),
name='print_agenda',
),
name='print_agenda', ),
)

View File

@ -9,6 +9,7 @@
:copyright: 2011, 2012 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from reportlab.platypus import Paragraph
from django.core.urlresolvers import reverse
@ -40,7 +41,6 @@ class Overview(TemplateView):
permission_required = 'agenda.can_see_agenda'
template_name = 'agenda/overview.html'
def get_context_data(self, **kwargs):
context = super(Overview, self).get_context_data(**kwargs)
@ -193,12 +193,14 @@ class ItemDelete(DeleteView):
if self.get_answer() == 'all':
self.object.delete(with_children=True)
messages.success(
request, _("Item %s and his children were successfully deleted.")
request,
_("Item %s and his children were successfully deleted.")
% html_strong(self.object))
elif self.get_answer() == 'yes':
self.object.delete(with_children=False)
messages.success(
request, _("Item %s was successfully deleted.")
request,
_("Item %s was successfully deleted.")
% html_strong(self.object))
@ -221,6 +223,7 @@ class AgendaPDF(PDFView):
else:
story.append(Paragraph(item.get_title(), stylesheet['Item']))
class Config(FormView):
"""
Config page for the agenda app.
@ -240,6 +243,7 @@ class Config(FormView):
messages.success(self.request, _('Agenda settings successfully saved.'))
return super(Config, self).form_valid(form)
def register_tab(request):
"""
register the agenda tab.