def contents(self): switch_on(self, request_layer=collective.singing.interfaces.IFormLayer) fieldsets = [] # Add the subscriptions tab: forms = [] for format, composer in self.context.composers.items(): form = ManageSubscriptionsForm(self.context, self.request) form.format = format form.composer = composer forms.append(form) form = ManageUploadForm(self.context, self.request) form.format = format form.composer = composer forms.append(form) fieldsets.append( (_(u"Subscriptions"), '\n'.join([form() for form in forms]))) # Add edit, composers and preview tabs: fieldsets.append((_(u"Edit"), self.edit_form(self.context, self.request)())) fieldsets.append( (_(u"Composers"), self.composers_form(self.context, self.request)())) fieldsets.append( (_(u"Preview"), self.preview_form(self.context, self.request)())) wrapper = """<dl class="enableFormTabbing">%s</dl>""" template = """ <dt id="fieldsetlegend-%d">%s</dt> <dd id="fieldset-%d"> %s </dd> """ return wrapper % \ ("\n".join((template % (id(msg), zope.i18n.translate(msg, context=self.request), id(msg), html) for (msg, html) in fieldsets)))
def contents(self): switch_on(self, request_layer=collective.singing.interfaces.IFormLayer) fieldsets = [] # Add the subscriptions tab: forms = [] for format, composer in self.context.composers.items(): form = ManageSubscriptionsForm(self.context, self.request) form.format = format form.composer = composer forms.append(form) form = ManageUploadForm(self.context, self.request) form.format = format form.composer = composer forms.append(form) fieldsets.append((_(u"Subscriptions"), "\n".join([form() for form in forms]))) # Add edit, composers and preview tabs: fieldsets.append((_(u"Edit"), self.edit_form(self.context, self.request)())) fieldsets.append((_(u"Composers"), self.composers_form(self.context, self.request)())) fieldsets.append((_(u"Preview"), self.preview_form(self.context, self.request)())) wrapper = """<dl class="enableFormTabbing">%s</dl>""" template = """ <dt id="fieldsetlegend-%d">%s</dt> <dd id="fieldset-%d"> %s </dd> """ return wrapper % ( "\n".join( ( template % (id(msg), zope.i18n.translate(msg, context=self.request), id(msg), html) for (msg, html) in fieldsets ) ) )
def forgot_secret_form(self): form = collective.singing.browser.subscribe.ForgotSecret( self.context, self.request) form.label = u'' return form()
def render_add_form(self): z2.switch_on(self) form = AddPathForm(self.context, self.request) return form()
def contents(self): switch_on(self) form = self.form(self.context, self.request) return '<div class="collector-form">' + form() + "</div>"
def contents(self): switch_on(self) form = self.form(self.context, self.request) return '<div class="collector-form">' + form() + '</div>'
def renderForm(self): z2.switch_on(self) form = EditRealmForm(self.context, self.request) return form()