summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-01-17 12:53:52 (GMT)
committerFrédéric Péters <fpeters@0d.be>2012-01-17 12:54:57 (GMT)
commit76dd32a7d4639bef3f4f3eb99c321b687734fa7b (patch)
tree3508486037c368351a8e87821831eeae03c6ff96
parent3b1684d13e63c89b151182081a6331bcf616103b (diff)
downloadtabellio.searchform-76dd32a7d4639bef3f4f3eb99c321b687734fa7b.zip
tabellio.searchform-76dd32a7d4639bef3f4f3eb99c321b687734fa7b.tar.gz
tabellio.searchform-76dd32a7d4639bef3f4f3eb99c321b687734fa7b.tar.bz2
switch forms back to simple <select> instead of droppable check boxes
-rw-r--r--tabellio/searchform/form.py62
1 files changed, 36 insertions, 26 deletions
diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py
index 3ed5b45..a956476 100644
--- a/tabellio/searchform/form.py
+++ b/tabellio/searchform/form.py
@@ -350,17 +350,20 @@ def possible_topics(context):
class IDocumentSearch(interface.Interface):
search_type_is_document = schema.TextLine(title=u'Search Type', default=u'1', required=False)
- nodoc = schema.TextLine(title=_(u'Document Number'), required=False)
+ nodoc = schema.TextLine(title=_(u'Dossier Number'), required=False)
nosuite = schema.TextLine(title=_(u'Suite Number'), required=False)
- l_doctypes = schema.List(title=_(u'Document Type'), required=False,
- value_type=schema.Choice(title=_(u'Type'), required=False,
- source=possible_document_types))
+ doctype = schema.Choice(title=_(u'Document Type'), required=False,
+ source=possible_document_types)
+ #l_doctypes = schema.List(title=_(u'Document Type'), required=False,
+ # value_type=schema.Choice(title=_(u'Type'), required=False,
+ # source=possible_document_types))
ttitle = schema.TextLine(title=_(u'Title'), required=False)
text = schema.TextLine(title=_(u'Text'), required=False)
authors = schema.TextLine(title=_(u'Authors'), required=False)
- l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
- value_type=schema.Choice(title=_(u'Political Group'),
- required=False, source=possible_polgroups))
+ polgroups = schema.Choice(title=_(u'Political Groups'), required=False, source=possible_polgroups)
+# l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
+# value_type=schema.Choice(title=_(u'Political Group'),
+# required=False, source=possible_polgroups))
topics = schema.TextLine(title=_(u'Topics'), required=False)
session = schema.Choice(title=_(u'Legislature / Session'), required=False,
source=possible_sessions)
@@ -378,8 +381,8 @@ class DocumentSearchForm(form.Form):
fields = field.Fields(IDocumentSearch)
fields['authors'].widgetFactory = FieldAuthorsWidget
fields['topics'].widgetFactory = FieldTopicsWidget
- fields['l_doctypes'].widgetFactory = FieldDroppedCheckboxWidget
- fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_doctypes'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
ignoreContext = True
template = ViewPageTemplateFile('form_templates/view_form.pt')
@@ -396,14 +399,17 @@ class IDossierSearch(interface.Interface):
search_type_is_dossier = schema.TextLine(title=u'Search Type', default=u'1', required=False)
nodos = schema.TextLine(title=_(u'Dossier Number'), required=False)
- l_dostypes = schema.List(title=_(u'Dossier Type'), required=False,
- value_type=schema.Choice(title=_(u'Type'), required=False,
- source=possible_dossier_types))
+ dostype = schema.Choice(title=_(u'Dossier Type'), required=False,
+ source=possible_dossier_types)
+ #l_dostypes = schema.List(title=_(u'Dossier Type'), required=False,
+ # value_type=schema.Choice(title=_(u'Type'), required=False,
+ # source=possible_dossier_types))
ttitle = schema.TextLine(title=_(u'Title'), required=False)
authors = schema.TextLine(title=_(u'Authors'), required=False)
- l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
- value_type=schema.Choice(title=_(u'Political Group'),
- required=False, source=possible_polgroups))
+ polgroups = schema.Choice(title=_(u'Political Groups'), required=False, source=possible_polgroups)
+ #l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
+ # value_type=schema.Choice(title=_(u'Political Group'),
+ # required=False, source=possible_polgroups))
participants = schema.TextLine(title=_(u'Participants'), required=False)
topics = schema.TextLine(title=_(u'Topics'), required=False)
session = schema.Choice(title=_(u'Legislature / Session'), required=False,
@@ -424,8 +430,8 @@ class DossierSearchForm(form.Form):
fields = field.Fields(IDossierSearch)
fields['authors'].widgetFactory = FieldAuthorsWidget
fields['participants'].widgetFactory = FieldAuthorsWidget
- fields['l_dostypes'].widgetFactory = FieldDroppedCheckboxWidget
- fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_dostypes'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
fields['topics'].widgetFactory = FieldTopicsWidget
ignoreContext = True
template = ViewPageTemplateFile('form_templates/view_form.pt')
@@ -442,14 +448,17 @@ class DossierSearchForm(form.Form):
class IQuestionSearch(interface.Interface):
search_type_is_question = schema.TextLine(title=u'Search Type', default=u'1', required=False)
- l_questypes = schema.List(title=_(u'Question Type'), required=False,
- value_type=schema.Choice(title=_(u'Type'), required=False,
- source=possible_question_types))
+ #l_questypes = schema.List(title=_(u'Question Type'), required=False,
+ # value_type=schema.Choice(title=_(u'Type'), required=False,
+ # source=possible_question_types))
+ questype = schema.Choice(title=_(u'Question Type'), required=False,
+ source=possible_question_types)
ttitle = schema.TextLine(title=_(u'Title'), required=False)
authors = schema.TextLine(title=_(u'Authors'), required=False)
- l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
- value_type=schema.Choice(title=_(u'Political Group'),
- required=False, source=possible_polgroups))
+ polgroups = schema.Choice(title=_(u'Political Groups'), required=False, source=possible_polgroups)
+ #l_polgroups = schema.List(title=_(u'Political Groups'), required=False,
+ # value_type=schema.Choice(title=_(u'Political Group'),
+ # required=False, source=possible_polgroups))
topics = schema.TextLine(title=_(u'Topics'), required=False)
session = schema.Choice(title=_(u'Legislature / Session'), required=False,
source=possible_sessions)
@@ -465,8 +474,8 @@ class QuestionSearchForm(form.Form):
prefix = 'question'
fields = field.Fields(IQuestionSearch)
fields['authors'].widgetFactory = FieldAuthorsWidget
- fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
- fields['l_questypes'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_polgroups'].widgetFactory = FieldDroppedCheckboxWidget
+ #fields['l_questypes'].widgetFactory = FieldDroppedCheckboxWidget
fields['topics'].widgetFactory = FieldTopicsWidget
ignoreContext = True
template = ViewPageTemplateFile('form_templates/view_form.pt')
@@ -680,7 +689,8 @@ class IGlobalSearchForm(interface.Interface):
text = schema.TextLine(title=_(u'Text'), required=False)
authors = schema.TextLine(title=_(u'Authors'), required=False)
participants = schema.TextLine(title=_(u'Participants'), required=False)
- polgroups = schema.TextLine(title=_(u'Political Groups'), required=False)
+ #polgroups = schema.TextLine(title=_(u'Political Groups'), required=False)
+ polgroups = schema.Choice(title=_(u'Political Groups'), required=False, source=possible_polgroups)
topics = schema.TextLine(title=_(u'Topics'), required=False)
session = schema.Choice(title=_(u'Legislature / Session'), required=False,
source=possible_sessions)