decided in favor of dedicated COMPONENT() macro, updates to documentation

This commit is contained in:
udo
2026-04-19 11:34:03 +00:00
parent be514d63d6
commit 2b5586d7df
56 changed files with 926 additions and 401 deletions
@@ -1,13 +1,15 @@
#load "../../lib/app.uce"
RENDER(Request& context)
COMPONENT(Request& context)
{
starter_boot(context);
DTree user = starter_current_user(context);
StarterUser users(context);
DTree user = users.current();
bool signed_in = user["email"].to_string() != "";
String wrapper_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-card" : "nav-account nav-menu";
String links_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-links" : "";
String name_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-name" : "account-name";
String theme_key = context.cfg.get_by_path("theme/key").to_string();
String wrapper_class = theme_key == "localfirst" ? "admin-account-card" : "nav-account nav-menu";
String links_class = theme_key == "localfirst" ? "admin-account-links" : "";
String name_class = theme_key == "localfirst" ? "admin-account-name" : "account-name";
<>
<div class="<?= wrapper_class ?>">
@@ -20,7 +22,7 @@ RENDER(Request& context)
<? } else { ?>
<? if(links_class != "") { ?><div class="<?= links_class ?>"><? } ?>
<a href="<?= starter_link("account/login", context) ?>">Login</a>
<? if(starter_cfg("users/enable_signup", context).to_string() != "") { ?>
<? if(context.cfg.get_by_path("users/enable_signup").to_string() != "") { ?>
<a href="<?= starter_link("account/register", context) ?>">Register</a>
<? } ?>
<? if(links_class != "") { ?></div><? } ?>