refactor: rename DTree to DValue

This commit is contained in:
udo
2026-06-12 11:05:52 +00:00
parent 941f5aea08
commit 7066da3cde
157 changed files with 1203 additions and 1074 deletions
@@ -3,7 +3,7 @@
COMPONENT(Request& context)
{
StarterUser users(context);
DTree user = users.current();
DValue user = users.current();
bool signed_in = user["email"].to_string() != "";
String theme_key = context.cfg.get_by_path("theme/key").to_string();
String wrapper_class = first(context.props["wrapper_class"].to_string(), theme_key == "localfirst" ? "admin-account-card" : "nav-account nav-menu");
@@ -18,7 +18,7 @@ void app_asset_tag_once(Request& context, String kind, String path)
}
}
void app_asset_tags(Request& context, String kind, DTree assets)
void app_asset_tags(Request& context, String kind, DValue assets)
{
String scalar = assets.to_string();
if(scalar != "")
@@ -26,7 +26,7 @@ void app_asset_tags(Request& context, String kind, DTree assets)
app_asset_tag_once(context, kind, scalar);
return;
}
assets.each([&](const DTree& item, String key) {
assets.each([&](const DValue& item, String key) {
app_asset_tag_once(context, kind, item.to_string());
});
}
@@ -6,7 +6,7 @@ COMPONENT(Request& context)
if(nav_class == "" && (context.cfg.get_by_path("theme/key").to_string() == "portal-dark" || context.cfg.get_by_path("theme/key").to_string() == "dark" || context.cfg.get_by_path("theme/key").to_string() == "retro-gaming"))
nav_class = "nav-shell";
DTree account_props;
DValue account_props;
if(context.props["account_wrapper_class"].to_string() != "")
account_props["wrapper_class"] = context.props["account_wrapper_class"];
if(context.props["links_wrapper_class"].to_string() != "")
@@ -18,7 +18,7 @@ COMPONENT(Request& context)
<nav<?: nav_class != "" ? " class=\"" + html_escape(nav_class) + "\"" : "" ?>>
<div class="nav-menu">
<a href="<?= app_link("", context) ?>"><?= context.cfg.get_by_path("site/name").to_string() ?></a>
<? context.cfg.get_by_path("menu").each([&](DTree menu_item, String menu_key) {
<? context.cfg.get_by_path("menu").each([&](DValue menu_item, String menu_key) {
if(menu_item["hidden"].to_string() == "1")
return;
String href = menu_item["external"].to_string() != "" ? "/" + menu_key : app_link(menu_key, context);