added sessions config and configurable paths for persons & parlementary events

This commit is contained in:
Frédéric Péters 2011-08-14 17:38:05 +02:00
parent 21457f24a4
commit f9d023f10b
3 changed files with 98 additions and 5 deletions

View File

@ -67,6 +67,22 @@
/>
</div>
<div
tal:define="error errors/personsPath | nothing;
personsPath python:request.get('personsPath', view.settings.personsPath)"
tal:attributes="class python:'field error' if error else 'field'">
<label for="personsPath" i18n:translate="label_persons_path">Persons</label>
<div tal:content="error" tal:condition="error" />
<input
name="personsPath"
id="personsPath"
type="text"
size="80"
tal:attributes="value personsPath"
/>
</div>
<div
tal:define="error errors/documentsPath | nothing;
documentsPath python:request.get('documentsPath', view.settings.documentsPath)"
@ -115,6 +131,22 @@
/>
</div>
<div
tal:define="error errors/parleventsPath | nothing;
parleventsPath python:request.get('parleventsPath', view.settings.parleventsPath)"
tal:attributes="class python:'field error' if error else 'field'">
<label for="parleventsPath" i18n:translate="label_parlevents_path">Parlementary Events</label>
<div tal:content="error" tal:condition="error" />
<input
name="parleventsPath"
id="parleventsPath"
type="text"
size="80"
tal:attributes="value parleventsPath"
/>
</div>
<div class="formControls">
<input
type="submit"
@ -137,12 +169,52 @@
</dd>
<dt id="fieldsetlegend-advanced">Other settings</dt>
<dd id="fieldset-other">
<dt id="fieldsetlegend-sessions">Sessions settings</dt>
<dd id="fieldset-sessions">
<p>
...
</p>
<form
name="sessions"
method="post"
class="enableUnloadProtection"
tal:attributes="action request/URL"
tal:define="errors view/errors">
<div
tal:define="error errors/sessions | nothing;
sessions python:request.get('sessions', view.settings.sessions)"
tal:attributes="class python:'field error' if error else 'field'">
<label for="sessions" i18n:translate="label_sessions">Sessions</label>
<div tal:content="error" tal:condition="error" />
<textarea
name="sessions"
id="sessions"
type="text"
rows="20"
cols="80"
tal:content="sessions"
>...</textarea>
</div>
<div class="formControls">
<input
type="submit"
name="form.button.SessionsSave"
class="context"
value="Save"
i18n:attributes="value" />
<input
type="submit"
name="form.button.Cancel"
class="context"
value="Cancel"
i18n:attributes="value" />
</div>
<input tal:replace="structure context/@@authenticator/authenticator" />
</form>
</dd>

View File

@ -44,17 +44,26 @@ class TabellioControlpanel(BrowserView):
submitted = True
deputies_path = form.get('deputiesPath')
persons_path = form.get('personsPath')
ministries_path = form.get('ministriesPath')
documents_path = form.get('documentsPath')
dossiers_path = form.get('dossiersPath')
polgroups_path = form.get('polgroupsPath')
parlevents_path = form.get('parleventsPath')
if not self.errors:
self.settings.deputiesPath = deputies_path
self.settings.personsPath = persons_path
self.settings.ministriesPath = ministries_path
self.settings.documentsPath = documents_path
self.settings.dossiersPath = dossiers_path
self.settings.polgroupsPath = polgroups_path
self.settings.parleventsPath = parlevents_path
if 'form.button.SessionsSave' in form:
self.authorize()
submitted = True
self.settings.sessions = form.get('sessions')
if submitted and not self.errors:
self._setup()

View File

@ -23,7 +23,19 @@ class ITabellioSettings(Interface):
title=_('ministries_path', 'Ministries Path'),
required=False)
parleventsPath = schema.TextLine(
title=_('parlevents_path', 'Parlementary Events Path'),
required=False)
personsPath = schema.TextLine(
title=_('persons_path', 'Persons Path'),
required=False)
polgroupsPath = schema.TextLine(
title=_('polgroups_path', 'Political Groups Path'),
required=False)
sessions = schema.Text(
title=_('sessions', 'Sessions'),
required=False)