Conjunto de mudanças 6489 no repositório publico
- Timestamp:
- 13/06/2012 15:56:36 (9 anos atrás)
- Localização:
- PortalInterlegis/produtos/il.portalinterlegis/trunk
- Arquivos:
-
- 2 adicionados
- 5 editados
Legenda:
- Não Modificado
- Adicionado
- Removido
-
PortalInterlegis/produtos/il.portalinterlegis/trunk/setup.py
r6478 r6489 31 31 'five.grok', 32 32 'plone.app.theming', 33 # -*- Extra requirements: -*- 33 'z3c.form', 34 'plone.directives.form', 34 35 ], 35 36 extras_require={'test': ['plone.app.testing', 'mock']}, -
PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/browser/boxes.py
r6483 r6489 6 6 from five.grok.components import ZopeTwoPageTemplate 7 7 from persistent.dict import PersistentDict 8 from z3c.form import form, field, datamanager 8 from plone.autoform.form import AutoExtensibleForm 9 from z3c.form import form, datamanager 9 10 from z3c.form.interfaces import IDataManager 10 11 from zope.annotation import IAnnotations … … 20 21 implements(IDataManager) 21 22 provideAdapter(PersistentDictionaryField) 23 22 24 23 25 class BoxManager(object): … … 35 37 # is from https://mail.zope.org/pipermail/grok-dev/2008-July/005999.html 36 38 # (plone.directives.form.EditForm did not work well) 37 class BoxEditForm( form.EditForm, grok.View):39 class BoxEditForm(AutoExtensibleForm, form.EditForm, grok.View): 38 40 grok.context(IFolderish) 39 41 grok.name(self._box_name_for_url(number)) … … 41 43 42 44 label = self.form_label 43 fields = field.Fields(self.schema)45 schema = self.schema 44 46 45 47 def getContent(form_self): 46 48 return self.box_content(form_self.context, number) 49 50 def render(self): 51 # we cannot simply associtate this template in the class level 52 # because form.EditForm has a ".render()" method and grok.View 53 # assumes you cannot have both "template = ..." and ".render()". 54 # No problem, we make a method that simply renders the template 55 template = ZopeTwoPageTemplate(filename="boxform.pt") 56 return template.render(self) 47 57 48 58 globals()['BoxEditForm_%s' % self._box_key(number)] = BoxEditForm -
PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/browser/interfaces.py
r6482 r6489 1 1 # -*- coding: utf-8 -*- 2 from plone.app.z3cform.wysiwyg import WysiwygFieldWidget 3 from plone.autoform.interfaces import WIDGETS_KEY 4 from plone.directives import form 2 5 from zope import schema 3 6 from zope.interface import Interface 4 7 8 5 9 # TODO: tive de mover isso pra ca (veio de boxes) por causa de um import circular 6 10 template_dict = {} 11 12 # decorator 7 13 def template(t): 8 14 def f(cls): 9 15 template_dict[cls] = t 16 return cls 17 return f 18 19 # decorator 20 def with_widget(**kwargs): 21 def f(cls): 22 cls.setTaggedValue(WIDGETS_KEY, kwargs) 10 23 return cls 11 24 return f … … 37 50 # BOX INTERFACES 38 51 52 39 53 @template(''' 40 54 <div class="simple-box"> … … 45 59 </p> 46 60 </div>''') 47 class ISimpleBox(Interface): 61 @with_widget(text=WysiwygFieldWidget) 62 class ISimpleBox(form.Schema): 48 63 title = schema.TextLine(title=u"Título", required=True) 49 64 subtitle = schema.TextLine(title=u"Subtítulo", required=True) 50 text = schema.Text Line(title=u"Texto", required=True)65 text = schema.Text(title=u"Texto", required=False) 51 66 52 67 @template(''' -
PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/static/js/editable-box.js
r6487 r6489 22 22 .appendTo($(this)) 23 23 .prepOverlay({ 24 subtype: ' ajax',24 subtype: 'iframe', 25 25 filter: '#content', 26 26 formselector: 'form', -
PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/static/rules.xml
r6488 r6489 5 5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 6 6 css:if-content="#visual-portal-wrapper"> 7 8 <theme href="index.html" />9 7 10 8 <!-- as pointed out in https://dev.plone.org/ticket/11829 --> … … 15 13 <notheme if-path="table.htm"/> 16 14 <notheme if-path="attributes.htm"/> 15 16 <theme href="box_form.html" css:if-content="#box-preview"/> 17 <theme href="index.html" /> 17 18 18 19 <before theme-children='/html/head' content-children='/html/head'/>
Note: Veja
TracChangeset
para ajuda no uso do visualizador de conjunto de mudanças.