Multi-day accumulated fixes: tag dispatch, session/pooling correctness, SPA rollout, jetc compiler
JetCore engine (Tag.cpp/.h, Global.cpp/.h, __*.cpp tag classes): - Numerous __mysql.cpp connection-pooling correctness fixes (stale result sets, double-indirection sessionid bugs, field caching, pool keying) and a session-registration-before-connection-confirmed ordering fix (dangling pointer on a failed connect) - Tag.cpp: large body of fixes to the tag-dispatch/container-scanning logic (bare-name fallback, database aliasing, single-quote handling, @-prefix session variable resolution, TAGDEF caching, nested split-tag scanning for if/while/until/ifrow so an inner one doesn't corrupt an outer one's own boundary scan) plus the process-first rendering order fix (a <process> now runs before <checksession>/page resolution, fixing a real "blank page after successful login" bug) - Global.h/.cpp: added imapSessions (parallel to the existing __mysql* session map) for the new <imap> tag family - __whiledir.cpp/__include.cpp: caching and directory-name-aliasing fixes - __call.cpp/.h: fixed a dangling-pointer bug - __write.cpp: fixed an O_WRONLY-only open that couldn't create a new file - __ifrow.cpp/__sql.cpp: fixed the same sessionid double-indirection bug __mysql.cpp had (resolveKeyword's result was being used as a map key lookup instead of the resolved value itself) jetc compiler (jetc/JetParser.cpp/.h, JetCodegen.cpp/.h, JetAST.h, jetc.cpp, build-shared.sh, build-compiled.sh): - Parser fixes: inline <include>, nested-quote handling, void-tag recognition - Codegen fixes and expanded AST support - build-shared.sh: atomic rename into place for a freshly-built .jtc (a live server dlopen()ing the same path mid-rebuild was corrupting its own already-mapped view of the old file) and a staleness check so a cached JetCore .o doesn't silently keep serving yesterday's fixes forever - Added -lssl to both build scripts' link lines (needed once the new <imap> tag's client-side TLS code existed - previously nothing in this codebase used OpenSSL's SSL/TLS client API, only libcrypto) Site content (jetc/barant-site/): SPA (fetch-and-swap navigation) rollout across essentially every .page/.jet/.section/.tag/.proc/.method file - dynamic-content fixes, fragment-mode stripping, native $[@name] session variables replacing older mechanisms, and this session's own checkout.page redesign, login start-param redirect fix, and per-page side-menu (menu.bar/$[PAGE].menu) refresh support. Completed the earlier main.css/control.css move from assets/ to assets/images/ (git still showed the old paths as tracked-but-deleted until now). Deliberately left out of this commit: dozens of .pre-<description>- <date> manual backup files (this session's and earlier ones' own before/after snapshots, not meant for permanent history), compiled .jtc build outputs, ad hoc test binaries and scripts under jetc/ (login_asan, wcwc_test, optest2_bin, etc.), and jetc/__pycache__/ - none of these are meant to be tracked; a .gitignore covering them would be worth adding separately.
This commit is contained in:
1 parent
54b6e522f9
commit
b0cadc3f08
162 files changed
+3567
-2887
No files matched your search
+102
-60
@@ -1,80 +1,122 @@
|
||||
<page template="mainpagetemplate">
|
||||
<page>
|
||||
<title>SHOPPING CART</title>
|
||||
<contents>
|
||||
<retain name="sku">
|
||||
<set name="tranonce" expr="unix_timestamp()">
|
||||
<setenv name="tranonce">$[tranonce]</setenv>
|
||||
<sectionframe title="SHOPPING CART">
|
||||
<input type="hidden" name="sku" value="">
|
||||
<input type="hidden" name="qty" value="">
|
||||
<script>
|
||||
function update(input) {
|
||||
PROCESS.value="updatecartqty";
|
||||
submit();
|
||||
function cartQtyChange(sku, qty) {
|
||||
if (qty === '' || isNaN(qty)) return;
|
||||
document.forms[0].PROCESS.value = 'updatecartqty';
|
||||
document.forms[0].PAGE.value = 'cart';
|
||||
document.forms[0].sku.value = sku;
|
||||
document.forms[0].qty.value = qty;
|
||||
document.forms[0].requestSubmit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<set name="hasrecurring" value="false">
|
||||
<set name="hasfiles" value="false">
|
||||
|
||||
<showtable>
|
||||
select product_list.sku as SKU,
|
||||
description as Description,
|
||||
quantity as Qty,
|
||||
price as Price
|
||||
from product_list
|
||||
join cart_item on product_list.sku=cart_item.sku
|
||||
where cart_item.session_uuid='$[_session_id]'
|
||||
</showtable>
|
||||
<br>
|
||||
|
||||
<comment>//these need to be incorporated into a query.
|
||||
<if value1="$[.type]" value2="subscription" type="eq">
|
||||
<set name="hasrecurring" value="true">
|
||||
</if>
|
||||
<if value1="$[.type]" value2="file" type="eq">
|
||||
<set name="hasfiles" value="true">
|
||||
</if>
|
||||
</comment>
|
||||
|
||||
<showtable>
|
||||
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]'
|
||||
</showtable>
|
||||
|
||||
<sql>
|
||||
select if(find_in_set('physical', group_concat(distinct type)),'true','false') as physical,
|
||||
if(find_in_set('file', group_concat(distinct type)),'true','false') as file,
|
||||
if(find_in_set('subscription', group_concat(distinct type)),'true','false') as subscription
|
||||
from product_list
|
||||
join cart_item on product_list.sku=cart_item.sku
|
||||
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>
|
||||
$[sqlerror]
|
||||
<ifrow>
|
||||
<set name="cart_count" value="$[.number_of_items]">
|
||||
<set name="cart_total" value="$[.total]">
|
||||
</ifrow>
|
||||
|
||||
<if value1="$[.subscription]" value2="true" type="eq">
|
||||
<div style="border: 1pt solid black; width: 400px; padding: 5px;">Please note that you have recurring charge items. On the terms of
|
||||
the recurrence (monthly or annually) you will not be charged
|
||||
automatically but you will be notified via e-mail that your service is
|
||||
about to expire. It is your responsibility to renew the services.</div>
|
||||
<sectionframe title="Shopping Cart">
|
||||
|
||||
<if expr="$[cart_count] > 0">
|
||||
|
||||
<sql>
|
||||
select if(find_in_set('SUBSCRIPTION', group_concat(distinct type)),'true','false') as subscription,
|
||||
if(find_in_set('FILE', group_concat(distinct type)),'true','false') as file
|
||||
from product_list
|
||||
join cart_item on product_list.sku=cart_item.sku
|
||||
where cart_item.session_uuid='$[_session_id]'
|
||||
</sql>
|
||||
$[sqlerror]
|
||||
<ifrow>
|
||||
<set name="cart_has_subscription" value="$[.subscription]">
|
||||
<set name="cart_has_file" value="$[.file]">
|
||||
</ifrow>
|
||||
|
||||
<if value1="$[cart_has_subscription]" value2="true" type="eq">
|
||||
<div class="cart-notice">Some items in your cart are recurring subscriptions. You will not be
|
||||
charged automatically - you'll be notified by e-mail before each renewal, and it's your
|
||||
responsibility to renew.</div>
|
||||
</if>
|
||||
|
||||
<if value1="$[.file]" value2="true" type="eq">
|
||||
<div style="margin-top: 3px; width: 400px; border: 1pt solid black; padding: 5px;">Please note that
|
||||
you have purchased items that must be downloaded from your account
|
||||
page after you checkout.</div>
|
||||
<if value1="$[cart_has_file]" value2="true" type="eq">
|
||||
<div class="cart-notice">Some items in your cart are downloadable files - available from your
|
||||
account page after checkout.</div>
|
||||
</if>
|
||||
|
||||
<div class="cart-wrap">
|
||||
<div class="cart-header">
|
||||
<div class="cart-col-desc">Item</div>
|
||||
<div class="cart-col-price">Price</div>
|
||||
<div class="cart-col-qty">Qty</div>
|
||||
<div class="cart-col-total">Total</div>
|
||||
<div class="cart-col-remove"></div>
|
||||
</div>
|
||||
<div class="cart-items">
|
||||
<sql>select product_list.sku as SKU,
|
||||
description as Description,
|
||||
quantity as Qty,
|
||||
price as Price
|
||||
from product_list
|
||||
join cart_item on product_list.sku=cart_item.sku
|
||||
where cart_item.session_uuid='$[_session_id]'
|
||||
order by description</sql>
|
||||
$[sqlerror]
|
||||
<whilerow>
|
||||
<set name="linetotal" expr="$[.Price] * $[.Qty]">
|
||||
<div class="cart-row">
|
||||
<div class="cart-col-desc">$[.Description]</div>
|
||||
<div class="cart-col-price">$$[.Price]</div>
|
||||
<div class="cart-col-qty">
|
||||
<input type="number" class="cart-qty-input" min="0" value="$[.Qty]"
|
||||
onchange="cartQtyChange('$[.SKU]', this.value); return true;">
|
||||
</div>
|
||||
<div class="cart-col-total">$$[linetotal]</div>
|
||||
<div class="cart-col-remove">
|
||||
<a href="#" class="cart-remove-link" onclick="
|
||||
document.forms[0].PROCESS.value='removecartitem';
|
||||
document.forms[0].PAGE.value='cart';
|
||||
document.forms[0].sku.value='$[.SKU]';
|
||||
document.forms[0].requestSubmit();
|
||||
return false;">Remove</a>
|
||||
</div>
|
||||
</div>
|
||||
</whilerow>
|
||||
</div>
|
||||
<div class="cart-summary">
|
||||
<div class="cart-summary-row">
|
||||
<span>$[cart_count] item<if expr="$[cart_count] != 1">s</if></span>
|
||||
<span class="cart-summary-total">$$[cart_total]</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; width: 100%; margin-top: 10px;">
|
||||
<linkbutton page="checkout" class="button">Check Out</linkbutton>
|
||||
</div>
|
||||
|
||||
<else>
|
||||
<div class="cart-empty">
|
||||
<div class="cart-empty-icon">🛒</div>
|
||||
<div class="cart-empty-title">Your cart is empty</div>
|
||||
<div class="cart-empty-text">Items you add will show up here.</div>
|
||||
</div>
|
||||
</if>
|
||||
|
||||
<br>
|
||||
<div style="text-align: center; width: 100%">
|
||||
<linkbutton page="checkout" class="button">Check
|
||||
Out</linkbutton></div>
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
<br>
|
||||
|
||||
</sectionframe>
|
||||
|
||||
</contents>
|
||||
</page>
|
||||
</page>
|
||||
Reference in new issue
Block a user