Author: jmorliaguet Date: Thu Jun 8 23:27:57 2006 New Revision: 3366 Modified: cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/configure.zcml cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/style_editor.pt cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/views.py
Log: - UI updates Modified: cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/configure.zcml Thu Jun 8 23:27:57 2006 @@ -29,8 +29,8 @@ /> <browser:page - name="setFormData" - attribute="setFormData" + name="setStyleEditorData" + attribute="setStyleEditorData" /> </browser:pages> @@ -51,8 +51,8 @@ /> <browser:page - name="setStyleEditorData" - attribute="setStyleEditorData" + name="setFormData" + attribute="setFormData" /> </browser:pages> Modified: cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/style_editor.pt ============================================================================== --- cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/style_editor.pt (original) +++ cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/style_editor.pt Thu Jun 8 23:27:57 2006 @@ -1,7 +1,10 @@ <div i18n:domain="cpsskins" - tal:define="style_data view/style_data; + tal:define="element_data view/element_data; + init element_data/init|nothing; + style_data view/style_data; style_id context/identifier; - widget_type style_data/widget|nothing"> + widget_type style_data/widget|nothing; + widget_types view/getWidgetTypes"> <ins class="model" tal:content="view/getFormDataModelDef" /> <ins class="model" tal:content="view/getStyleEditorDataModelDef" /> @@ -22,8 +25,8 @@ <fieldset class="panel"> <legend class="panelTitle">Widgets</legend> <ul class="inlineButtons"> - <tal:block tal:repeat="type view/getWidgetTypes"> - <li tal:attributes="class python: widget_type == type and 'selected' or nothing"> + <tal:block tal:repeat="type widget_types"> + <li tal:attributes="class python: (not init and widget_type == type) and 'selected' or nothing"> <a i18n:translate="" tal:content="string:widget.${type}" tal:attributes="href string:@@setStyleEditorData?widget=$type&style_id=$style_id" /></li> </tal:block> @@ -31,7 +34,7 @@ <div style="clear:both"></div> </fieldset> - <table style="width: 100%"> + <table style="width: 100%" tal:condition="python: not init and widget_type in widget_types"> <tr> <td style="width: 50%; vertical-align: top"> <fieldset id="previewArea" class="panel" style="cursor: pointer" Modified: cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/views.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/views.py (original) +++ cpsskins/branches/paris-sprint-2006/standard/screens/styleeditor/views.py Thu Jun 8 23:27:57 2006 @@ -65,6 +65,10 @@ markup = utils.insertCSSClass(markup, u'style' + unicode(style_id)) return markup + def setStyleEditorData(self, widget=u'', style_id=u''): + self.style_data.setData({'widget': widget, 'style_id': style_id}) + self.element_data['init'] = False + def getFormDataModelDef(self): path = getPath(self.context) return json.write({ @@ -146,9 +150,6 @@ return (u'font', u'color', u'background-color', 'background-image', u'padding', u'margin', u'border', u'text-transform') - def setStyleEditorData(self, widget=u'', style_id=u''): - self.style_data.setData({'widget': widget, 'style_id': style_id}) - def setStyleData(self, data): self.data = json.read(data) self.request.response.setHeader('content-type', 'text/x-json') @@ -156,12 +157,12 @@ def getStyleData(self): data = self.data + style_id = self.style_data['style_id'] selector = data.get('selector', u'') data = { 'selector': selector, 'fields': [], } - style_id = self.style_data['style_id'] if style_id and selector: style = self.tmutil.getElementById(style_id) fields = [] -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins