Commit 89335dff authored by Vincent Desmares's avatar Vincent Desmares

vincentd : improve the rendering of product list

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27636 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5cbb2a55
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
def getProductPrice(product):
getPrice = UnrestrictedMethod(product.getPrice)
return getPrice()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>getProductPrice</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>Ecommerce</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_unrestrictedGetPrice</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Unrestricted getPrice</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Return default currency used in shopping_cart.\n
Please update accordingly relative path. \n
XXX: there must be an way to do this better?\n
"""\n
return context.getPortalObject().SaleOrder_getShoppingCartDefaultCurrency().getReference()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartDefaultCurrencyCode</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get default currency symbole for shop</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Return default currency used in shopping_cart.\n
Please update accordingly relative path. \n
XXX: there must be an way to do this better?\n
"""\n
return context.getPortalObject().SaleOrder_getShoppingCartDefaultCurrency().getShortTitle()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartDefaultCurrencySymbole</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get default currency symbole for shop</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block\n
xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n
tal:define="field_id here/getId;\n
form_id python: here.getForm().id;\n
selection_name here/getSelectionName;\n
selection here/getSelection;\n
portal_url_string here/getPortalUrlString;\n
real_context here/getContext;\n
context_url real_context/absolute_url;\n
md5_string here/getMD5Checksum;\n
line_list here/query;\n
is_domain_tree_mode here/isDomainTreeMode;\n
is_report_tree_mode here/isReportTreeMode;\n
is_domain_tree_supported here/isDomainTreeSupported;\n
is_report_tree_supported here/isReportTreeSupported;\n
show_select_column here/showSelectColumn;\n
show_anchor_column here/showAnchorColumn;\n
show_search_line here/showSearchLine;\n
is_web_mode request/is_web_mode | nothing;\n
list_style python:request.get(\'list_style\', is_web_mode and \'table\' or None);\n
is_gadget_mode request/is_gadget_mode | nothing;\n
">\n
<!-- ListBox starts here. -->\n
<input type="hidden" name="list_selection_name" value="default" tal:attributes="value selection_name" />\n
<input type="hidden" name="list_selection_name" value="default"\n
tal:attributes="value selection_name;\n
name string:${field_id}_list_selection_name" />\n
<input tal:condition="md5_string" type="hidden" name="md5_object_uid_list" value="checksum" tal:attributes="value md5_string" />\n
\n
<tal:block tal:condition="is_gadget_mode">\n
<tal:block tal:define="global box_relative_url python: request.get(\'box_relative_url\', \'\');\n
global box python: real_context.restrictedTraverse(box_relative_url); \n
global box_id python: \'visual_%s\' %box_relative_url.split(\'/\')[-1];\n
global dom_id python: request.get(\'dom_id\',None) or box_id;">\n
<input tal:condition="python:form_id" \n
type="hidden" name="gadget_form_id"\n
tal:attributes="value form_id" />\n
</tal:block>\n
</tal:block>\n
\n
<tal:replace tal:content="nothing">\n
Because TAL cannot accept unbalanced tags, the support for a domain tree is realized by a macro.\n
The macro ListBoxContainer is a no-op, if not in domain tree mode. Otherwise, the macro constructs\n
a domain tree and extracts the body in an extra table.\n
</tal:replace>\n
\n
<tal:block tal:define="expand python: 0">\n
<tal:block metal:define-macro="ListBoxContainer">\n
<tal:block tal:condition="expand">\n
<table tal:condition="is_domain_tree_mode"\n
style="width: 100%;" cellpadding="0" cellspacing="0"\n
summary="This table contains the domain tree with the switch button"\n
tal:define="selected_domain_path here/getSelectedDomainPath">\n
<tr>\n
<td valign="top">\n
<select name="domain_root_url"\n
tal:attributes="onChange string:submitAction(this.form, \'${context_url}/setDomainRoot\')">\n
<tal:block tal:repeat="c here/getDomainRootList">\n
<option value="base_domain"\n
tal:define="path python: c[0]; title python: c[1]"\n
tal:attributes="selected python: path == selected_domain_path; value path"\n
tal:content="title"\n
i18n:translate="" i18n:domain="ui">Base Domain</option>\n
</tal:block>\n
</select>\n
<table id="listbox_domain_tree_table" cellpadding="0"\n
summary="This table contains the domain tree"\n
class="listbox_domain_tree_table"\n
tal:attributes="id string:${field_id}_domain_tree_table"\n
tal:define="report_tree_list python: here.makeReportTreeList(report_path = selected_domain_path, unfolded_list = selection.getDomainList(), is_report_opened = False);\n
total_depth python: max([report_tree.depth for report_tree in report_tree_list] + [-1])">\n
<tr tal:repeat="report_tree report_tree_list">\n
<tal:block tal:repeat="i python: range(report_tree.depth)">\n
<td width="12" nowrap="nowrap">&nbsp;</td>\n
</tal:block>\n
\t\t <td colspan="1" style="text-align: left; vertical-align: top; white-space: nowrap;"\n
tal:attributes="colspan python: total_depth - report_tree.depth + 1">\n
<a href="method" class="tree_open"\n
tal:condition="report_tree/is_open"\n
tal:attributes="href string:foldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">\n
<b tal:content="report_tree/obj/getTranslatedTitleOrId">Domain</b></a>\n
<a href="method" class="tree_closed"\n
tal:condition="not: report_tree/is_open"\n
tal:attributes="href string:unfoldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">\n
<tal:block tal:content="report_tree/obj/getTranslatedTitleOrId">Domain</tal:block></a>\n
</td>\n
</tr>\n
</table>\n
</td>\n
<td style="vertical-align: top">\n
<tal:block metal:define-slot="ListBoxBody" />\n
</td>\n
</tr>\n
</table>\n
<tal:block tal:condition="not: is_domain_tree_mode">\n
<tal:block metal:define-slot="ListBoxBody" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: list_style == \'search\'">\n
<span metal:use-macro="real_context/ListBox_asSearchStyleHTML/macros/main"/>\n
</tal:block>\n
<tal:block tal:condition="python: list_style == \'table\'">\n
<span metal:use-macro="real_context/ListBox_asMf54TableStyleHTML/macros/main"/>\n
</tal:block>\n
<tal:block tal:condition="python: list_style not in (\'search\', \'table\')">\n
<span metal:use-macro="real_context/ListBox_asStandardHTML/macros/main"/>\n
</tal:block>\n
</tal:block>\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ListBox_asMf54HTML</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -66,10 +66,12 @@
<string>header header-bottom</string>
<string>navbar navbar-left</string>
<string>headline</string>
<string>product_list (Product List)</string>
<string>footer</string>
<string>subcontent subcontent-box loginbox (My Account)</string>
<string>subcontent subcontent-box cartbox (My Cart)</string>
<string>subcontent subcontent-box sidemenu1 (Subsections)</string>
<string>hidden</string>
</list>
</value>
</item>
......@@ -110,7 +112,15 @@
<value>
<list>
<string>page_title_box</string>
<string>selected_product_box</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>product_list_thumbnail</string>
<string>product_list_decoratedPrice</string>
</list>
</value>
</item>
......@@ -122,6 +132,14 @@
</list>
</value>
</item>
<item>
<key> <string>product_list (Product List)</string> </key>
<value>
<list>
<string>product_list</string>
</list>
</value>
</item>
<item>
<key> <string>subcontent subcontent-box cartbox (My Cart)</string> </key>
<value>
......
......@@ -13,19 +13,16 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>default</string>
<string>width</string>
<string>height</string>
<string>text_editor</string>
<string>enabled</string>
<string>whitespace_preserve</string>
<string>image_display</string>
<string>image_resolution</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>selected_product_box</string> </value>
<value> <string>product_list_thumbnail</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -69,7 +66,9 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
......@@ -80,27 +79,15 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>image_resolution</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
......@@ -120,35 +107,23 @@
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_text_content</string> </value>
<value> <string>listbox_thumbnail</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<value> <string>text_area</string> </value>
<value> <string>DocumentModule_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>selected_product_box</string> </value>
<key> <string>image_display</string> </key>
<value> <string>micro</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
<key> <string>image_resolution</string> </key>
<value> <int>75</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
......@@ -167,7 +142,23 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/WebSection_viewSelectedProductWidget</string> </value>
<value> <string>python: cell.getDefaultImageValue().getData() and cell.getDefaultImageAbsoluteUrl()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: (cell.getPortalType() == \'Product\') and cell.getDefaultImageValue() is not None and cell.getDefaultImageValue().getData() is not None</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -52,6 +52,7 @@
secondary_color python:here.getLayoutProperty(\'layout_secondary_color\', \'rgb(225,225,225)\');\n
header_color python:here.getLayoutProperty(\'layout_header_color\', \'rgb(218,218,218)\');\n
menu_color python:here.getLayoutProperty(\'layout_menu_color\', \'rgb(235,235,235)\');\n
font_list python:here.getLayoutProperty(\'layout_font_list\', \'Century Gothic, verdana, arial, sans-serif\');\n
container_width python:here.getLayoutProperty(\'layout_container_width\', 978);\n
border_width python:here.getLayoutProperty(\'layout_border_width\', 10);\n
main_width python:container_width - 2 * border_width;\n
......@@ -96,10 +97,10 @@ div.subcontent-box.cartbox fieldset.widget div.field table tr td.cart_bottom div
\n
div.selected-product {height : 110px; width:<tal:block tal:replace="main_content_width"/>px; padding-left:25px; margin-bottom:10px;}\n
div.selected-product div {float:left; width:100px; height:100px; text-align:center; padding-right: 25px;}\n
div.selected-product img {border:solid 1px #000; padding:0px; margin-left:10px; margin-right:10px; margin-top:5px; margin-bottom:2px;}\n
div.selected-product img:hover {border:solid 1px #000; padding:0px; margin:0px; margin-left:10px; margin-right:10px;}\n
div.selected-product img {border:solid 1px <tal:block tal:replace="primary_color"/>; padding:0px; margin-left:10px; margin-right:10px; margin-top:5px; margin-bottom:2px;}\n
div.selected-product img:hover {border:solid 2px <tal:block tal:replace="primary_color"/>; padding:0px; margin-top:4px; margin-left:9px; margin-right:9px; margin-bottom:1px;}\n
.cart_item_name {width:180px;}\n
.headline {float:left; width:<tal:block tal:replace="main_content_width"/>px;}\n
.headline {float:left; width:<tal:block tal:replace="main_width"/>px;}\n
\n
\n
.resource_left {float:left; width:<tal:block tal:replace="python: (main_content_width / 3) * 2"/>px;}\n
......@@ -108,17 +109,17 @@ div.selected-product img:hover {border:solid 1px #000; padding:0px; margin:0px;
div.resource_image {float:left;}\n
div.resource_image img {border:none; margin-left:5px;}\n
fieldset.resource_left div.hiddenLabel label {display:none;}\n
fieldset.resource_left div.hiddenLabel div.input {float:left; width:<tal:block tal:replace="python: main_content_width / 3"/>px}\n
fieldset.resource_left div.hiddenLabel div.input {float:left; width:<tal:block tal:replace="python: main_content_width / 3"/>px; padding:0px}\n
fieldset.resource_left div.hiddenLabel div.input span.hiddenLabel {font: 20px bold Verdana,sans-serif; padding-top:10px;}\n
div.resource_image label {display:none;}\n
.resource_right div.hidden label {display:none;}\n
.resource_right div.field label a {display:none;}\n
.resource_right div.field label {height:20px; width:100px; float:left;}\n
.resource_right div.field div.input {height:20px; width:100px; float:right;}\n
.resource_right div.field label {height:20px; width:100px; float:left; padding:0px;}\n
.resource_right div.field div.input {height:20px; width:100px; float:right; padding:0px}\n
.resource_right div.field {margin:5px}\n
.resource_center div.hiddenLabel div.input input {}\n
.resource_center div.field label a {display:none;}\n
.resource_center div.hiddenLabel label {margin-left:15px;}\n
.resource_center div.hiddenLabel label {margin-left:15px;padding:0px;}\n
.product_description_header {margin: 5px; margin-left:15px;}\n
.product_description {display:none;}\n
.product_description_close {margin: 5px; margin-left:15px;}\n
......@@ -133,6 +134,8 @@ div.resource_image label {display:none;}\n
.product_list:hover {border-top: 1px solid <tal:block tal:replace="primary_color"/>; border-bottom: 1px solid <tal:block tal:replace="primary_color"/>; background-color:<tal:block tal:replace="secondary_color"/>;}\n
.product_list_bis:hover {border-top: 1px solid <tal:block tal:replace="primary_color"/>;border-bottom: 1px solid <tal:block tal:replace="primary_color"/>; background-color:<tal:block tal:replace="secondary_color"/>;}\n
\n
div.shopping_cart_renderer div.input {padding:0px;}\n
\n
.shopping_cart_renderer_title {float:left; margin-top:8px;}\n
.shopping_cart_renderer_remove {float:right; margin-top:3px;}\n
.shopping_cart_renderer_remove a img {border:none;}\n
......@@ -141,13 +144,34 @@ div.resource_image label {display:none;}\n
.shopping_cart_renderer_shipping label a {display:none;}\n
.shopping_cart_renderer_submit label a {display:none;}\n
\n
div.shopping_cart_renderer_shipping {width: <tal:block tal:replace="python: main_content_width - 40"/>px; height:20px; margin-bottom:20px; margin-top:20px; padding-left:20px; padding-right:20px; padding-top:3px;background-color:<tal:block tal:replace="body_color"/>;}\n
.shopping_cart_renderer_shipping label {float:left; width: <tal:block tal:replace="python: main_content_width / 4"/>px; height:20px;}\n
.shopping_cart_renderer_shipping div {float:right; height:20px;}\n
div.shopping_cart_renderer_submit {width: <tal:block tal:replace="python: main_content_width - 40"/>px; height:20px; margin-bottom:20px; padding-left:20px; padding-right:20px; padding-top:3px; background-color:<tal:block tal:replace="body_color"/>;}\n
.shopping_cart_renderer_submit label {float:left; width: <tal:block tal:replace="python: main_content_width / 8"/>px; height:20px;}\n
.shopping_cart_renderer_submit div {float:right; height:20px;}\n
div.shopping_cart_renderer_shipping {width: <tal:block tal:replace="python: main_content_width - 40"/>px; height:20px; margin-bottom:20px; margin-top:20px; padding-left:20px; padding-right:20px; padding-top:3px; padding-bottom:3px; background-color:<tal:block tal:replace="body_color"/>;}\n
.shopping_cart_renderer_shipping label {float:left; width: <tal:block tal:replace="python: main_content_width / 4"/>px; height:20px;padding:0px;}\n
.shopping_cart_renderer_shipping div {float:right; height:20px; padding:0px}\n
div.shopping_cart_renderer_submit {width: <tal:block tal:replace="python: main_content_width - 40"/>px; height:20px; margin-bottom:20px; padding-left:20px; padding-right:20px; padding-top:3px; padding-bottom:3px; background-color:<tal:block tal:replace="body_color"/>;}\n
.shopping_cart_renderer_submit label {float:left; width: <tal:block tal:replace="python: main_content_width / 8"/>px; height:20px;padding:0px;}\n
.shopping_cart_renderer_submit div {float:right; height:20px; padding:0px}\n
\n
.mf_commerce_text {font: 12px <tal:block tal:replace="python: \',\'.join(font_list)"/>}\n
.mf_commerce_text_bold {font: bold 12px <tal:block tal:replace="python: \',\'.join(font_list)"/>;}\n
.mf_commerce_text_small {font: 8px <tal:block tal:replace="python: \',\'.join(font_list)"/>;}\n
.mf_commerce_text_description {font: 10px <tal:block tal:replace="python: \',\'.join(font_list)"/>;}\n
\n
div.hiddenLabel label {display:none;}\n
fieldset.editable div.input {padding:0px;}\n
\n
.main_content table {border-top: solid 1px <tal:block tal:replace="primary_color"/>;}\n
.main_content table th {border:none; background-color:<tal:block tal:replace="body_color"/>;}\n
.main_content table tr {border:none; border-bottom:dashed 1px <tal:block tal:replace="menu_color"/>; background-color:#FFF;}\n
.main_content table td {border:none; background-color:#FFF;}\n
.main_content table tr.thead_bottom {border:none; background-color:<tal:block tal:replace="menu_color"/>;}\n
.main_content table tr.thead_top {border:none; background-color:<tal:block tal:replace="secondary_color"/>;}\n
.main_content table tr.thead_bottom td {border: solid 1px <tal:block tal:replace="primary_color"/>;border-width: 1px 0px 1px 0px;}\n
.main_content table tr.tfoot {border:none;}\n
.main_content table caption {margin-top:10px; text-align:center; padding-bottom:10px;}\n
.main_content button.sort_button {float:left;}\n
.main_content th img {clear:none; border:none; margin-left:5px;}\n
.main_content .pageNavigation input {vertical-align:middle;}\n
.main_content table td.td_check_all {background-color:<tal:block tal:replace="body_color"/>;}\n
</tal:block>
]]></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="large_widget">\n
<a id="anchor-sidemenu-4" tal:attributes="id gid"></a>\n
<div class="corner-content-1col-top" tal:condition="python:len(field_list)"></div>\n
<div tal:attributes="class python: gid.lstrip(aggregate_name) + \' content-1col-nobox\';"\n
tal:condition="python:len(field_list)">\n
<h1 class="group_title" i18n:translate="" i18n:domain="ui" tal:content="python: gtitle">4-01a. Side menu 1</h1>\n
<fieldset class="widget">\n
<!-- <legend i18n:translate="" i18n:domain="ui" tal:content="python: gtitle" class="group_title"/> -->\n
<tal:block tal:repeat="field field_list">\n
<tal:block metal:use-macro="here/field_render/macros/field_render"/>\n
</tal:block>\n
</fieldset>\n
</div>\n
<div class="corner-content-1col-bottom" tal:condition="python:len(field_list)"></div>\n
</tal:block>\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>multiflex5_large_box_renderer</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -89,12 +89,13 @@
dummy python: request.set(\'dialog_mode\', dialog_mode);\n
dummy python: request.set(\'list_mode\', list_mode);\n
aggregate python: has_no_layout or layout_form.Form_getGroupList(\n
[\'header\', \'navbar\', \'headline\', \'subcontent\', \'footer\']);\n
[\'header\', \'navbar\', \'headline\', \'subcontent\', \'product_list\', \'footer\']);\n
aggregate python: ((aggregate is not has_no_layout) and dict(aggregate)) or {};\n
header_area python:aggregate.get(\'header\', []);\n
navbar_area python:aggregate.get(\'navbar\', []);\n
headline_area python:aggregate.get(\'headline\', []);\n
subcontent_area python:aggregate.get(\'subcontent\', []);\n
product_list_area python:aggregate.get(\'product_list\', []);\n
footer_area python:aggregate.get(\'footer\', []);\n
global css_list_template python:[\n
\'%s/mf54_reset.css\' % portal_path,\n
......@@ -139,17 +140,10 @@
<div class="headline">\n
<!-- Layout form rendering -->\n
<tal:block tal:condition="python: layout_form is not None">\n
<tal:block tal:repeat="aggregate python: [(\'headlibe\', headline_area)]">\n
<tal:block tal:repeat="aggregate python: [(\'headline\', headline_area)]">\n
<tal:block metal:use-macro="here/aggregate_render/macros/aggregate_render"/>\n
</tal:block>\n
</tal:block> \n
<div class="main_content">\n
<div class="corner-content-1col-top"></div> \n
<div class="content-1col-nobox">\n
<tal:block tal:content="structure here/WebSection_viewSelectedProductWidget"/>\n
</div>\n
<div class="corner-content-1col-bottom"></div> \n
</div>\n
</tal:block>\n
</div>\n
\n
<!-- SUBCONTENT -->\n
......@@ -166,24 +160,34 @@
</div> \n
\n
<!-- CONTENT -->\n
<div class="main_content">\n
<div class="main_content">\n
<div class="corner-content-1col-top"></div> \n
<div class="content-1col-nobox">\n
<tal:block metal:define-slot="main"/>\n
<tal:block tal:content="structure here/WebSection_viewSelectedProductWidget"/>\n
</div>\n
<div class="corner-content-1col-bottom"></div> \n
</div>\n
\n
<tal:block tal:condition="python: here.REQUEST.get(\'current_form_id\') == \'WebPage_viewAsWeb\' or here.REQUEST.get(\'current_form_id\') == \'WebSection_viewAsWeb\'">\n
<tal:block tal:condition="python: here.REQUEST.get(\'current_form_id\') != \'WebPage_viewAsWeb\' and here.REQUEST.get(\'current_form_id\') != \'WebSection_viewAsWeb\'">\n
<div class="main_content">\n
<div class="corner-content-1col-top"></div> \n
<div class="content-1col-nobox">\n
<tal:block tal:content="structure here/WebSection_viewProductList"/>\n
<tal:block metal:define-slot="main"/>\n
</div>\n
<div class="corner-content-1col-bottom"></div> \n
<div class="corner-content-1col-bottom"></div>\n
</tal:block>\n
<tal:block tal:condition="python: here.REQUEST.get(\'current_form_id\') == \'WebPage_viewAsWeb\' or here.REQUEST.get(\'current_form_id\') == \'WebSection_viewAsWeb\'">\n
<div class="main_content">\n
<tal:block tal:condition="python: layout_form is not None"\n
tal:define="widget_renderer here/multiflex5_large_box_renderer/macros/large_widget">\n
<tal:block tal:repeat="aggregate python: [(\'product_list\', product_list_area)]">\n
<tal:block metal:use-macro="here/aggregate_render/macros/aggregate_render"/>\n
</tal:block>\n
</tal:block> \n
</div>\n
</tal:block> \n
</div> \n
</div> \n
\n
<!-- FOOTER --> \n
<div class="footer">\n
......
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.EditorField</string>
<string>EditorField</string>
</tuple>
<none/>
<global name="EditorField" module="Products.ERP5Form.EditorField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -213,7 +210,7 @@
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel</string> </value>
<value> <string>hiddenLabel shopping_cart_renderer</string> </value>
</item>
<item>
<key> <string>default</string> </key>
......@@ -263,6 +260,10 @@
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<value> <string>text_area</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Shopping Cart</string> </value>
......
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>LabelField</string>
</tuple>
<none/>
<global name="LabelField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -122,7 +119,7 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......
......@@ -65,7 +65,7 @@
quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n
order_line_id python: order_line.getId();\n
currency python: here.restrictedTraverse(shopping_cart.getPriceCurrency());\n
currency python: here.SaleOrder_getShoppingCartDefaultCurrency();\n
currency_title python: currency.getTitle(); \n
currency_symbole python: currency.getShortTitle();">\n
<td>\n
......
......@@ -51,7 +51,7 @@
<td tal:define="resource python: website.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n
currency python: shopping_cart.getPriceCurrencyTitle();\n
currency python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrency();\n
currency_symbole python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n
class="cart_top"> \n
\n
......
......@@ -56,17 +56,19 @@
<value> <string>#TODO : USE CACHE\n
#the goal of this script is to get all the related product of this section\n
\n
current_web_section = context.REQUEST.get(\'current_web_section\')\n
if (context.getPortalType() != \'Web Section\'):\n
current_web_section = context.REQUEST.get(\'current_web_section\')\n
else:\n
current_web_section = context\n
product_list = []\n
if limit != 0:\n
product_list = current_web_section.WebSection_getDocumentValueListBase(all_versions=1,\n
kw[\'portal_type\'] = \'Product\'\n
kw[\'limit\'] = limit\n
product_list = current_web_section.WebSection_getDocumentValueListBase(all_versions=1,\n
all_languages=1,\n
limit=limit,\n
**kw\n
)\n
else:\n
product_list = current_web_section.WebSection_getDocumentValueListBase(all_versions=1,\n
all_languages=1,\n
) \n
\n
#raise \'\'.join([x.getObject() for x in product_list])\n
product_list = [x.getObject() for x in product_list if x.getPortalType() == \'Product\']\n
\n
# this step will be remove after have find a good way to improve WebSection_getDocumentValueListBase\n
......@@ -83,7 +85,24 @@ return product_list\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>limit=0</string> </value>
<value> <string>limit=1000, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string>
<string>Member</string>
<string>Owner</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -110,10 +129,13 @@ return product_list\n
<value>
<tuple>
<string>limit</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>current_web_section</string>
<string>product_list</string>
<string>_write_</string>
<string>_apply_</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
......@@ -130,7 +152,7 @@ return product_list\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>0</int>
<int>1000</int>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<div tal:repeat="product python: here.WebSection_getProductList()">\n
<div tal:condition="python: product is not None"\n
tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
site_url python:here.getWebSiteValue().absolute_url();\n
product_href python: \'%s/product_module/%s/%s\' % (site_url, product.getId(), \'Resource_viewAsShop\');\n
currency_symbole python: context.SaleOrder_getShoppingCartDefaultCurrency().getShortTitle();"\n
tal:attributes="class python: repeat[\'product\'].index % 2 and \'product_list_bis\' or \'product_list\'">\n
<div class="product_list_left">\n
<a tal:attributes="href product_href">\n
<img tal:attributes="src python: product.getDefaultImageAbsoluteUrl() + \'?display=thumbnail\'" width="75" height="75">\n
</a>\n
<p tal:content="python: product.getTranslatedTitle()">Title of the product</p>\n
<p tal:content="python: \'%s ...\' % product.getDescription()[0:80]">Description of the product</p>\n
</div>\n
<div class="product_list_right">\n
<tal:block tal:define="price product/getPrice">\n
<tal:block tal:condition="python: price is not None">\n
<span>Price : </span><span tal:content="python: \'%s %s\' % (product.getPrice(), currency_symbole)">0 euros</span><br />\n
</tal:block>\n
<tal:block tal:condition="python: price is None">\n
<span>The price is not setted yet.</span><br />\n
</tal:block>\n
</tal:block>\n
<a tal:attributes="href product_href">More informations</a>\n
</div>\n
</div>\n
</div>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_viewProductListTemplate</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -57,12 +57,12 @@
<div tal:define="site_url python:here.getWebSiteValue().absolute_url();\n
current_web_section python:request.get(\'current_web_section\', here);\n
shopping_cart here/SaleOrder_getShoppingCart;\n
currency_symbole python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n
currency_symbole python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrencySymbole();"\n
i18n:translate="" i18n:domain="ui" i18n:attributes="title"\n
title="Sections accessible from here." class="selected-product">\n
<tal:block tal:repeat="product python: here.WebSection_getProductList()">\n
<tal:block tal:repeat="product python: here.WebSection_getProductList(limit=5)">\n
<div tal:define="product_href python: \'%s/product_module/%s/%s\' % (site_url, product.getId(), \'Resource_viewAsShop\');\n
price product/getPrice">\n
price python: here.ERP5Site_unrestrictedGetPrice(product)">\n
<a href="#" tal:attributes="href product_href">\n
<img tal:condition="python: product.getDefaultImage() is not None"\n
tal:attributes="src python: product.getDefaultImageAbsoluteUrl() + \'?display=thumbnail\'" width="75" height="75"/>\n
......
......@@ -69,7 +69,8 @@
</tal:block>\n
\n
<tal:block tal:condition="not: isAnon"\n
tal:define="customer here/SaleOrder_getShoppingCartCustomer;\n
tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
customer shopping_cart/SaleOrder_getShoppingCartCustomer;\n
website here/getWebSiteValue">\n
\n
<p class="article">\n
......
126
\ No newline at end of file
128
\ No newline at end of file
Person Module
Sale Order Module
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment