Changeset 12670
- Timestamp:
- 6 Mar 2015, 18:37:06 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py
r12240 r12670 51 51 Transition( 52 52 transition_id = 'retract', 53 title = _('Retract docume t'),53 title = _('Retract document'), 54 54 source = PUBLISHED, 55 55 condition = NullCondition, -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser.py
r12419 r12670 155 155 @property 156 156 def form_fields(self): 157 return grok.AutoFields( 158 self.context.form_fields_interface).omit('terms_and_conditions')157 return grok.AutoFields(self.context.form_fields_interface).omit( 158 'terms_and_conditions', 'description') 159 159 160 160 @property 161 161 def label(self): 162 162 return self.context.title 163 164 @property 165 def description(self): 166 lang = self.request.cookies.get('ikoba.language') 167 html = self.context.description_dict.get(lang,'') 168 if html =='': 169 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 170 html = self.context.description_dict.get(portal_language,'') 171 return html 163 172 164 173 @property … … 198 207 def save(self, **data): 199 208 msave(self, **data) 200 # Save multilingual dict 209 # Save multilingual dicts 210 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 211 desc = getattr(self.context, 'description', None) 212 self.context.description_dict = html2dict(desc, portal_language) 201 213 tc = getattr(self.context, 'terms_and_conditions', None) 202 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE203 214 self.context.tc_dict = html2dict(tc, portal_language) 204 215 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser_templates/productpage.pt
r12362 r12670 1 <span tal:condition="view/description" tal:omit-tag=""> 2 <p tal:content="structure view/description">Description</p> 3 <br /> 4 </span> 5 1 6 <table class="form-table" i18n:domain="waeup.ikoba"> 2 7 <tbody> -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/container.py
r12213 r12670 21 21 import grok 22 22 from grok import index 23 from waeup.ikoba.interfaces import IIkobaPluggable 23 24 from waeup.ikoba.products.interfaces import IProductsContainer, IProduct 24 25 from waeup.ikoba.utils.helpers import attrs_to_fields … … 40 41 41 42 ProductsContainer = attrs_to_fields(ProductsContainer) 43 44 45 class ContainerPlugin(grok.GlobalUtility): 46 """A plugin that creates container for Container inside a company. 47 """ 48 grok.implements(IIkobaPluggable) 49 grok.name('productscontainer') 50 51 def setup(self, site, name, logger): 52 return 53 54 def update(self, site, name, logger): 55 container = site['products'] 56 for value in container.values(): 57 if not getattr(value, 'description_dict', None): 58 value.description_dict = {} 59 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py
r12487 r12670 90 90 ) 91 91 92 description_dict = Attribute( 93 'Description as language dictionary with values in html format') 94 95 description = schema.Text( 96 title = _(u'Description'), 97 required = False, 98 description = _(u'Multilingual content in HTML format'), 99 ) 100 92 101 tc_dict = Attribute('Terms and Conditions as language dictionary with values in html format') 93 102 -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py
r12592 r12670 52 52 super(Product, self).__init__(*args, **kw) 53 53 self.tc_dict = {} 54 self.description_dict = {} 54 55 55 56 @property -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py
r12361 r12670 62 62 result = open(self.outfile, 'rb').read() 63 63 self.assertTrue( 64 'contract_category,contract_title, options,'64 'contract_category,contract_title,description,options,' 65 65 'product_id,terms_and_conditions,title,valid_from,valid_to,users_with_local_roles\r\n' 66 'license,, "[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,,Unnamed'66 'license,,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,,Unnamed' 67 67 ',2015-12-04#,,"[{\'user_name\': u\'john\', \'local_role\': ' 68 68 'u\'johnsrole\'}]"\r\n' … … 77 77 result = open(self.outfile, 'rb').read() 78 78 self.assertTrue( 79 'contract_category,contract_title, options,'79 'contract_category,contract_title,description,options,' 80 80 'product_id,terms_and_conditions,title,valid_from,valid_to,users_with_local_roles\r\n' 81 'license,, "[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,,Unnamed'81 'license,,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,,Unnamed' 82 82 ',2015-12-04#,,"[{\'user_name\': u\'john\', \'local_role\': ' 83 83 'u\'johnsrole\'}]"\r\n'
Note: See TracChangeset for help on using the changeset viewer.