making polgroup location a setting
This commit is contained in:
parent
70b670f1e3
commit
bbf43a3ba1
Binary file not shown.
|
@ -16,6 +16,15 @@
|
|||
provides="Products.GenericSetup.interfaces.EXTENSION"
|
||||
/>
|
||||
|
||||
<genericsetup:upgradeStep
|
||||
title="Update registry"
|
||||
source="*"
|
||||
destination="1000"
|
||||
handler=".upgrade.update_registry"
|
||||
sortkey="1"
|
||||
profile="tabellio.config:default"
|
||||
/>
|
||||
|
||||
<browser:resource
|
||||
name="tabellio.config.png"
|
||||
image="icon.png"
|
||||
|
|
|
@ -67,6 +67,22 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div
|
||||
tal:define="error errors/polgroupsPath | nothing;
|
||||
polgroupsPath python:request.get('polgroups', view.settings.polgroupsPath)"
|
||||
tal:attributes="class python:'field error' if error else 'field'">
|
||||
|
||||
<label for="polgroupsPath" i18n:translate="label_polgroups_path">Political Groups</label>
|
||||
<div tal:content="error" tal:condition="error" />
|
||||
<input
|
||||
name="polgroupsPath"
|
||||
id="polgroupsPath"
|
||||
type="text"
|
||||
size="80"
|
||||
tal:attributes="value polgroupsPath"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="formControls">
|
||||
<input
|
||||
type="submit"
|
||||
|
|
|
@ -45,10 +45,12 @@ class TabellioControlpanel(BrowserView):
|
|||
|
||||
deputies_path = form.get('deputiesPath')
|
||||
documents_path = form.get('documentsPath')
|
||||
polgroups_path = form.get('polgroupsPath')
|
||||
|
||||
if not self.errors:
|
||||
self.settings.deputiesPath = deputies_path
|
||||
self.settings.documentsPath = documents_path
|
||||
self.settings.polgroupsPath = polgroups_path
|
||||
|
||||
if submitted and not self.errors:
|
||||
self._setup()
|
||||
|
|
|
@ -15,3 +15,7 @@ class ITabellioSettings(Interface):
|
|||
title=_('documents_path', 'Documents Path'),
|
||||
required=False)
|
||||
|
||||
polgroupsPath = schema.TextLine(
|
||||
title=_('polgroups_path', 'Political Groups Path'),
|
||||
required=False)
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
from Products.CMFCore.utils import getToolByName
|
||||
|
||||
PROFILE_ID = "profile-tabellio.config:default"
|
||||
|
||||
def update_registry(context, logger=None):
|
||||
# Run the registry.xml step as that may have defined new attributes
|
||||
setup = getToolByName(context, 'portal_setup')
|
||||
setup.runImportStepFromProfile(PROFILE_ID, 'plone.app.registry')
|
||||
|
Reference in New Issue