Convert barant.com JET 1.4 marketing pages to jetc/.jtc (local, non-production)
Pulls .page files and shared template infrastructure (mainpagetemplate.temp, menu.bar, barant.tag, opensource.menu, cart.menu, login.menu) read-only from barant.com via SFTP into jetc/barant-site/src, then convert.py mechanically flattens them into self-contained .jet files: linkbutton becomes a plain anchor link (the old SESSIONCTL PAGE/PROCESS form-postback model has no equivalent here - each page is its own real #api route now, not a shared single-form state machine), sectionframe is expanded per its barant.tag definition, /images/* references are fetched and inlined as data URIs (APIServer has no static-file serving), and session-gated chrome (cart, account/admin, login.menu) is resolved to its anonymous-visitor default state, since no session/DB backend is wired into this conversion. 17 pages convert and serve cleanly end-to-end (verified via a local apiserver-barant-site.json instance on :8081, kept separate from the existing demo server on :8080 to avoid a /main route collision with the earlier hand-cloned barant.jet). Two pages deliberately out of scope for this pass: davidarant.page (whiledir filesystem iteration) and the per-topic sub-pages of jet.page (dispatches on an ARGS query param this conversion does not populate - only the default overview state converts). vst.page/modular1.page/modular1_patches.page also deferred - they pull live product rows via sql, a real backend dependency beyond "pages and their template" scope. Nothing was written back to barant.com - SFTP access was read-only throughout, per explicit instruction to convert locally without touching the original site.
This commit is contained in:
1 parent
b143b821de
commit
fde94acad6
191 files changed
+14997
No files matched your search
Executable
+60
@@ -0,0 +1,60 @@
|
||||
<page template="mainpagetemplate" loggedin="yes">
|
||||
<title>SHOPPING CART - CHECKOUT</title>
|
||||
<script src="https://web.squarecdn.com/v1/square.js"></script>
|
||||
<contents>
|
||||
<script>
|
||||
function processCardForm(token) {
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/pp.cgi', true);
|
||||
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
||||
xhr.onload = function () {
|
||||
console.log(">" + this.responseText + "<");
|
||||
if(this.responseText == "OK\n") {
|
||||
document.forms[0].PAGE.value = 'thankyou';
|
||||
document.forms[0].submit();
|
||||
} else {
|
||||
message.innerText = this.responseText;
|
||||
}
|
||||
};
|
||||
let data = 'id=$[_session_id]&token=' + token + '&tranonce=$[tranonce]';
|
||||
xhr.send(data);
|
||||
}
|
||||
var card;
|
||||
async function buildForm() {
|
||||
let payments = Square.payments('sq0idp-V4R4vEferpF9kr7d5x5abQ','LV0MRENX5ED3Z');
|
||||
const card = await payments.card({
|
||||
style: {
|
||||
'.input-container.is-focus': { borderColor: '#006AFF' },
|
||||
'.message-text.is-error': { color: '#BF0020' }
|
||||
}
|
||||
});
|
||||
await card.attach('#card');
|
||||
let button = document.getElementById('pay');
|
||||
button.addEventListener('click', async () => {
|
||||
let result = await card.tokenize();
|
||||
if (result.status === 'OK') {
|
||||
let processbanner = document.getElementById('process');
|
||||
processbanner.style.visibility = 'visible';
|
||||
processCardForm(result.token);
|
||||
}
|
||||
});
|
||||
}
|
||||
buildForm();
|
||||
</script>
|
||||
<sql>select count(*) as number_of_items,
|
||||
sum(price * quantity) as total
|
||||
from product_list
|
||||
join cart_item on product_list.sku=cart_item.sku
|
||||
where cart_item.session_uuid='$[_session_id]'
|
||||
</sql>
|
||||
<sectionframe title="Pay with Credit Card">
|
||||
<div>Please enter your payment information:</div>
|
||||
<div style="font-size: 20px;">$[total]</div>
|
||||
<div id="card" style="background-color: #ddd;width: 300px; padding: 5px;"></div>
|
||||
<div style="padding: 5px;"><button id= "pay" type="button">Pay</button></div>
|
||||
<div id="process" style="background-color: #0f0; border: 2px solid #000; padding:
|
||||
5px; display: block-inline; margin: 10px; visibility: hidden;"> Processing Payment - Please wait... </div>
|
||||
<div id="message" style="color: #f00; margin-top: 20px;"></div>
|
||||
</sectionframe>
|
||||
</contents>
|
||||
</page>
|
||||
Reference in new issue
Block a user