[Checkins] SVN: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/ fixed wizard helper class

Nikolay Kim fafhrd91 at gmail.com
Mon Jun 1 08:40:12 EDT 2009


Log message for revision 100569:
  fixed wizard helper class

Changed:
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/configure.zcml
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/interfaces.py
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/styles.css
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py

-=-
Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/configure.zcml
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/configure.zcml	2009-06-01 10:41:10 UTC (rev 100568)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/configure.zcml	2009-06-01 12:40:12 UTC (rev 100569)
@@ -73,6 +73,30 @@
      zcml:condition="installed z3c.breadcrumb"
      factory=".breadcrumb.ConfigletBreadcrumb" />
 
+  <!-- wizard -->
+  <z3ext:pagelet
+     name="configlet"
+     type="wizard.step"
+     for="* .interfaces.IConfigletEditWizard"
+     class=".wizard.ConfigletEditStep"
+     weight="100"
+     permission="zope.View"
+     zcml:condition="installed z3ext.wizard" />
+
+  <adapter
+     name="next"
+     for="* .wizard.ConfigletEditWizard *"
+     provides="z3ext.wizard.interfaces.IWizardButton"
+     factory=".wizard.next"
+     zcml:condition="installed z3ext.wizard"/>
+
+  <adapter
+     name="save"
+     for="* .wizard.ConfigletEditWizard *"
+     provides="z3ext.wizard.interfaces.IWizardButton"
+     factory=".wizard.save" 
+     zcml:condition="installed z3ext.wizard"/>
+
   <!-- css styles -->
   <z3ext:resourceinclude
      name="z3ext-controlpanel.css"

Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/interfaces.py
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/interfaces.py	2009-06-01 10:41:10 UTC (rev 100568)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/interfaces.py	2009-06-01 12:40:12 UTC (rev 100569)
@@ -15,8 +15,13 @@
 
 $Id$
 """
+from zope import interface
 from zope.viewlet.interfaces import IViewletManager
 
 
 class IConfigletNavigation(IViewletManager):
     """ extra configlet navigation viewlet manager """
+
+
+class IConfigletEditWizard(interface.Interface):
+    """ """

Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/styles.css
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/styles.css	2009-06-01 10:41:10 UTC (rev 100568)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/styles.css	2009-06-01 12:40:12 UTC (rev 100569)
@@ -18,6 +18,10 @@
     margin: 0;
   }
 
+  #z-controlpanel #z-content {
+    margin: font-size: 110%;
+  }
+
   #z-controlpanel #z-portal-workspace {
     padding: 0;
     background-color: globalBackgroundColor;

Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py	2009-06-01 10:41:10 UTC (rev 100568)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py	2009-06-01 12:40:12 UTC (rev 100569)
@@ -18,13 +18,14 @@
 from zope import interface
 from zope.component import getUtility
 from z3ext.layoutform import Fields, PageletEditForm
-from z3ext.wizard import WizardWithTabs, WizardStepForm
-from z3ext.wizard.step import WizardStep
-from z3ext.wizard.interfaces import ISaveable
-from z3ext.principal.registration.interfaces import \
-    IPortalRegistration, IInvitationConfiglet
+from z3ext.wizard import WizardWithTabs
+from z3ext.wizard.step import WizardStep, WizardStepForm
+from z3ext.wizard.button import WizardButton
+from z3ext.wizard.interfaces import ISaveable, IForwardAction
+from z3ext.layoutform.interfaces import ISaveAction
+from z3ext.controlpanel.interfaces import _
 
-from interfaces import _, IConfigletEditWizard
+from interfaces import IConfigletEditWizard
 
 
 class ConfigletEditWizard(WizardWithTabs):
@@ -42,27 +43,27 @@
         return self.context.__description__
 
 
-class ConfigletEditStep(WizardStepForm, PageletEditForm):
+class ConfigletEditStep(WizardStepForm):
+    interface.implements(ISaveable)
 
     name = 'configlet'
-    title = _('Configlet')
-    label = _('Modify configlet')
+    title = _('Configure')
+    label = _('Configure configlet')
 
     @property
     def fields(self):
         return Fields(self.getContent().__schema__)
 
 
-class InvitationsEditStep(WizardStep):
+next = WizardButton(
+    title = _(u'Next'),
+    condition = lambda form: not form.isLastStep() \
+        and not form.step.isSaveable(),
+    weight = 300,
+    provides = IForwardAction)
 
-    name = 'invitations'
-    label = title = _('Invitations')
-    description = u''
-
-    def update(self):
-        super(InvitationsEditStep, self).update()
-
-        self.configlet = getUtility(IInvitationConfiglet)
-
-    def isAvailable(self):
-        return getUtility(IPortalRegistration).invitation
+save = WizardButton(
+    title = _(u'Save'),
+    condition = lambda form: form.step.isSaveable(),
+    weight = 400,
+    provides = ISaveAction)



More information about the Checkins mailing list