Commit 7d4abb2b authored by Sven Franck's avatar Sven Franck

app/data: allow non form fields into form scheme

parent d3df0e73
......@@ -11,12 +11,40 @@
"scheme": [
{
"position": "left",
"field_list": [
{
"type": "div",
"direct": {"className": "ui-fieldcontain"},
"logic": {"skip": true},
"children": [{
"type": "legend",
"direct": {"className": "translate required_label"},
"attributes": {"data-i18n": "global_dict.select"}
}, {
"generate": "widget",
"type": "listview",
"property_dict": {
"inset": "true",
"class_list": "subscription_selector force_corners",
"map_children": "listItem",
"wrap": 2
},
"children": [
{"type": "divider", "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.choose_offer"}]},
{"type": "item", "class_list": "violet", "left": [{"type": "image", "src": "img/bg-offre01.png", "alt":""}], "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.fixed_price"}, {"type": "p", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.fixed_details"}], "right": [{"type": "radio", "id": "subscription_plan-0", "name": "subscription_plan"}]},
{"type": "item", "class_list": "rose", "left": [{"type": "image", "src": "img/bg-offre02.png", "alt":""}], "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.carte_fixed"}, {"type": "p", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.carte_details"}], "right": [{"type": "radio", "id": "subscription_plan-1", "name": "subscription_plan"}]}
]
}]
},
{"field": "coupon_code"}
]
}, {
"position": "right",
"field_list": [
{"field": "number_of_badges"},
{"field": "requested_invoice_method"},
{"field": "additional_badge_holders"},
{"type": "p", "direct": {"className": "translate custom_padding"}, "attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.coupon_info"}},
{"field": "coupon_code"}
{"type": "p", "direct": {"className": "translate custom_padding"}, "attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.coupon_info"}}
]
}
],
......@@ -59,30 +87,21 @@
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA"
},
"children": [{
"type": "div",
"direct": {"className": "span_2"},
"generate": "widget",
"type": "controlgroup",
"property_dict": {
"class_list": "center",
"direction": "horizontal"
},
"children": [{
"type": "div",
"direct": {"className": "ui-fieldcontain"},
"children": [{
"type": "legend",
"direct": {"className": "translate required_label"},
"attributes": {"data-i18n": "global_dict.select"}
}, {
"generate": "widget",
"type": "listview",
"property_dict": {
"inset": "true",
"class_list": "subscription_selector force_corners",
"map_children": "listItem",
"wrap": 2
},
"children": [
{"type": "divider", "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.choose_offer"}]},
{"type": "item", "class_list": "violet", "left": [{"type": "image", "src": "img/bg-offre01.png", "alt":""}], "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.fixed_price"}, {"type": "p", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.fixed_details"}], "right": [{"type": "radio", "id": "subscription_plan-0", "name": "subscription_plan"}]},
{"type": "item", "class_list": "rose", "left": [{"type": "image", "src": "img/bg-offre02.png", "alt":""}], "center": [{"type": "h3", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.carte_fixed"}, {"type": "p", "text_i18n":"portal_type_dict.sales_order_dict.text_dict.carte_details"}], "right": [{"type": "radio", "id": "subscription_plan-1", "name": "subscription_plan"}]}
]
}]
"type": "a",
"direct": {"href": "#", "className": "translate ui-disabled ui-btn ui-btn-icon-left ui-icon-carat-l"},
"attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.retour"}
}, {
"type": "input",
"direct": {"className": "action translate"},
"attributes": {"type": "submit", "data-action":"update", "data-icon":"carat-r", "data-theme": "active", "data-i18n":"[value]portal_type_dict.sales_order_dict.text_dict.proceed"},
"logic": {"wrapper_class_list": " ui-last-child "}
}]
}, {
"type": "div",
......@@ -115,26 +134,8 @@
"type": "a",
"direct": {"href":"#", "className": "translate ui-btn ui-icon-medkit ui-corner-all ui-btn-icon-right"},
"attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.help"}
}]
}]
}, {
"generate": "widget",
"type": "controlgroup",
"property_dict": {
"class_list": "center",
"direction": "horizontal"
},
"children": [{
"type": "a",
"direct": {"href": "#", "className": "translate ui-disabled ui-btn ui-btn-icon-left ui-icon-carat-l"},
"attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.retour"}
}, {
"type": "input",
"direct": {"className": "action translate"},
"attributes": {"type": "submit", "data-action":"update", "data-icon":"carat-r", "data-theme": "active", "data-i18n":"[value]portal_type_dict.sales_order_dict.text_dict.proceed"},
"logic": {"wrapper_class_list": " ui-last-child "}
}]
}
]
}
]
}
......@@ -120,9 +120,16 @@
"direction": "horizontal"
},
"children": [
{"type": "a", "direct": {"href": "#subscription", "className": "translate ui-btn ui-btn-icon-left ui-icon-carat-l"}, "attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.retour"}},
{"type": "input", "direct": {"className": "action translate"}, "attributes": {"type": "submit", "data-action":"update", "data-iconpos": "right", "data-theme": "active", "data-icon":"carat-r", "data-i18n":"[value]global_dict.proceed"}, "logic": {"wrapper_class_list": " ui-last-child "}}
]
{
"type": "a",
"direct": {"href": "#subscription", "className": "translate ui-btn ui-btn-icon-left ui-icon-carat-l"},
"attributes": {"data-i18n": "portal_type_dict.sales_order_dict.text_dict.retour"}
}, {
"type": "input",
"direct": {"className": "action translate"},
"attributes": {"type": "submit", "data-action":"update", "data-icon":"carat-r", "data-theme": "active", "data-i18n":"[value]portal_type_dict.sales_order_dict.text_dict.proceed"},
"logic": {"wrapper_class_list": " ui-last-child "}
}]
}
]
}
......
......@@ -3768,6 +3768,11 @@
pass = {"push": field};
}
// pass HTML fields
if (field.logic && field.logic.skip) {
pass = {"push": field};
}
// fields that needing mapping (custom or based on dict)
if (!pass) {
root = item.field_dict[field.field];
......@@ -3961,13 +3966,15 @@
}
}
};
}
// NOTE: we can't remove type from attributes, but must delete
// it if it's null, otherwise code is not valid (Opera chokes)
if (pass.push.attributes.type === null) {
delete pass.push.attributes.type;
// NOTE: we can't remove type from attributes, but must delete
// it if it's null, otherwise code is not valid (Opera chokes)
if (pass.push.attributes.type === null) {
delete pass.push.attributes.type;
}
}
// need to set position here to also include custom fields
pass.position = segment.position === "center" ? 1 : 2;
......
......@@ -77,7 +77,7 @@
"portal_type_dict": {
"sales_order_dict": {
"text_dict": {
"proceed": "Continue with my order",
"proceed": "Continue",
"electronic": "Electronic invoice",
"paper": "Paper Invoice (€0.85 per month)",
"choose_offer": "Choose a plan",
......
......@@ -103,7 +103,7 @@
"details": "Plus d'informations sur les forfaits disponibles.",
"coupon_info": "Vous disposez d'un code promo, code jeu concours ou numéro de parrain. Saisissez le code correspondant ci-dessous",
"retour": "Retour",
"proceed": "Poursuivre avec mon commande",
"proceed": "Poursuivre",
"advantages": "Les avantages Bip&Go",
"waiting": "Plus d'attente au péage",
"valid": "Partout en France et dans plus de 250 parkings",
......
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