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