Changeset 12684 for main/waeup.ikoba/trunk
- Timestamp:
- 7 Mar 2015, 08:15:26 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/products
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser.py
r12670 r12684 79 79 label = _('Products') 80 80 81 @property 82 def description(self): 83 lang = self.request.cookies.get('ikoba.language') 84 html = self.context.description_dict.get(lang,'') 85 if html =='': 86 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 87 html = self.context.description_dict.get(portal_language,'') 88 return html 89 81 90 82 91 class ProductsContainerManageFormPage(IkobaEditFormPage, … … 106 115 @action(_('Save'), style='primary') 107 116 def save(self, **data): 108 return msave(self, **data) 117 msave(self, **data) 118 # Save multilingual dict 119 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 120 desc = getattr(self.context, 'description', None) 121 self.context.description_dict = html2dict(desc, portal_language) 122 return 109 123 110 124 @action(_('Cancel'), validator=NullValidator) -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser_templates/containermanagepage.pt
r12413 r12684 15 15 <div class="tab-content"> 16 16 <div id="tab1" class="active tab-pane"> 17 <br /> 17 18 <table class="form-table"> 18 19 <tbody> … … 20 21 </tbody> 21 22 </table> 22 <br /><p i18n:translate="">Setting parameters no yet configured.</p>23 23 <div tal:condition="view/availableActions"> 24 24 <span tal:repeat="action view/actions" tal:omit-tag=""> -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser_templates/containerpage.pt
r12592 r12684 1 <span tal:condition="view/description" tal:omit-tag=""> 2 <p tal:content="structure view/description">Description</p> 3 <br /><br /> 4 </span> 5 1 6 <div i18n:domain="waeup.ikoba" i18n:translate="" tal:condition="python: not len(context.keys())"> 2 7 There are no subobjects registered yet. -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/container.py
r12670 r12684 32 32 grok.provides(IProductsContainer) 33 33 34 def __init__(self, *args, **kw): 35 super(ProductsContainer, self).__init__(*args, **kw) 36 self.description_dict = {} 34 37 35 38 def addProduct(self, product): … … 54 57 def update(self, site, name, logger): 55 58 container = site['products'] 59 if not getattr(container, 'description_dict', None): 60 container.description_dict = {} 56 61 for value in container.values(): 57 62 if not getattr(value, 'description_dict', None): -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py
r12670 r12684 36 36 37 37 """ 38 39 description_dict = Attribute( 40 'Description as language dictionary with values in html format') 41 42 description = schema.Text( 43 title = _(u'Description'), 44 required = False, 45 description = _(u'Multilingual content in HTML format'), 46 ) 38 47 39 48 def addProduct(product):
Note: See TracChangeset for help on using the changeset viewer.