Esempio n. 1
0
    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)))
Esempio n. 2
0
    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
                )
            )
        )
Esempio n. 3
0
 def forgot_secret_form(self):
     form = collective.singing.browser.subscribe.ForgotSecret(
         self.context, self.request)
     form.label = u''
     return form()
Esempio n. 4
0
 def forgot_secret_form(self):
     form = collective.singing.browser.subscribe.ForgotSecret(
         self.context, self.request)
     form.label = u''
     return form()
Esempio n. 5
0
 def render_add_form(self):
     z2.switch_on(self)
     form = AddPathForm(self.context, self.request)
     return form()
Esempio n. 6
0
 def contents(self):
     switch_on(self)
     form = self.form(self.context, self.request)
     return '<div class="collector-form">' + form() + "</div>"
Esempio n. 7
0
 def contents(self):
     switch_on(self)
     form = self.form(self.context, self.request)
     return '<div class="collector-form">' + form() + '</div>'
 def render_add_form(self):
     z2.switch_on(self)
     form = AddPathForm(self.context, self.request)
     return form()
 def renderForm(self):
     z2.switch_on(self)
     form = EditRealmForm(self.context, self.request)
     return form()
Esempio n. 10
0
 def renderForm(self):
     z2.switch_on(self)
     form = EditRealmForm(self.context, self.request)
     return form()