class User(MenuItem): grok.viewletmanager(GlobalMenu) grok.title('User') grok.description('User Description') action = "user" icon = "@@/dd/pdf.png"
class ComplexForm(uvcsite.Form): """ """ grok.title(u'KomplexForm') grok.description(u"Komplexe Form") grok.context(uvcsite.IUVCSite) #uvcsite.menu(FormBeispiele) ignoreContent = False ignoreRequest = False fields = uvcsite.Fields(IAdressen) #fields['personen'].mode = "bgdp" fields['personen'].allowOrdering = False fields['personen'].inlineValidation = True label = u"Adressen" description = u"Adressen" def update(self): super(ComplexForm, self).update() @uvcsite.action(u'Abschicken') def handleButton(self): data, errors = self.extractData() print errors import pdb pdb.set_trace()
class MyForm(uvcsite.Form): grok.title(u'Beispielform') grok.description(u"Beschreibugn Beschreibugn") grok.context(Interface) ignoreContent = False ignoreRequest = False fields = uvcsite.Fields(IPerson) fields['geschlecht'].mode = "radio" fields['name'].htmlAttributes['maxlength'] = 10 fields['vorname'].htmlAttributes['placeholder'] = u"BLA" fields['datum'].htmlAttributes = {'placeholder': 'tt.mm.jjjj'} fields['check'].htmlAttributes = {'disabled': 'disabled'} fields['datum'].mode = "dp-date" label = u"Beispielform" description = u"Beschreibung" legend = "LEGENDE" def update(self): self.setContentData(uvcsite.DictDataManager(dict(name="Klaus"))) double.need() masked_input.need() @uvcsite.action(u'Abschicken') def handleButton(self): data, errors = self.extractData() if errors or self.errors: self.flash(u"FEHLER", type="error") return self.flash('Alles Klar')
class UnfallanzeigeRegistration(uvcsite.ProductRegistration): grok.name('KinderUnfallanzeige') grok.title('Kinder Unfallanzeige') grok.description('Kinder Unfallanzeige') grok.order(51) uvcsite.productfolder('ukh.spsuaz.components.SUnfallanzeigen') def action(self): return "%sSunfallanzeigen/add" % uvcsite.getHomeFolderUrl(self.request)
class AdressBook(uvcsite.ProductFolder): grok.name('adressbook') grok.title('Adressbuch') grok.description('Adressbuch ...') uvcsite.contenttype(Contact) @property def excludeFromNav(self): interaction = zope.security.management.getInteraction() principal = interaction.participations[0].principal if principal.id == "0202020002": return True return False
class BGVExampleForm(uvcsite.Form): """ """ grok.name('sform') grok.title(u'oKomplexForm') grok.description(u"oKomplexe Form") grok.context(uvcsite.IUVCSite) ignoreContent = False ignoreRequest = False fields = uvcsite.Fields(IAdressen) label = u"Adressen" description = u"Adressen" @uvcsite.action(u'Abschicken') def handleButton(self): data, errors = self.extractData() print errors.title
class ErsteHilfePR(uvcsite.ProductRegistration): grok.name('ErsteHilfe') grok.title('ErsteHilfe') grok.description('Hess Gis Lorem Ipsoum') uvcsite.productfolder('ukh.erstehilfe.components.ErsteHilfe')
class AddressBook(uvcsite.content.components.ProductFolder): grok.name('addressbook') grok.title('Adressbuch') grok.description('Adressbuch ...') uvcsite.content.directive.contenttype(Contact)
class RoleWithI18nTitle(grok.Role): grok.name('RoleWithI18nTitle') grok.title(_('RoleWithI18n')) grok.description(_(u'My role with i18n'))
class RoleWithoutI18n(grok.Role): grok.name('RoleWithoutI18n') grok.description('My role without i18n')
class HessGisPR(uvcsite.ProductRegistration): grok.name('HessGis') grok.title('HessGISS') grok.description('Hess Gis Lorem Ipsoum') uvcsite.productfolder('ukh.hessgis.components.HessGis')
class Actions(Menu): """context actions menu """ grok.name('actions') grok.title(_(u'Actions menu')) grok.description('')
class Navigation(Menu): """main navigation menu """ grok.name('navigation') grok.title(_(u'Navigation menu')) grok.description('')
class UAZRegistration(ProductRegistration): grok.name('Unfallanzeige') grok.title('Unfallanzeige') grok.description('Elektronische Unfallanzeige')
class Addressbook(ProductRegistration): grok.name('adressbook') grok.title('Adressbuch') grok.description('Beschreibung Entgeltnachweis') productfolder('uvcsite.examples.simpleaddon.AdressBook')