-- layout/app.wo — the app shell (app.html's analog): one full document
-- wrapping every page with the shared header and footer. Styles are NOT
-- inlined — pages link /assets/style.css (served by static_files), so
-- markup and styling stay separate files.
use framework/http
use html
pub fn app_shell(title: Text, content: Text) -> Text {
let h = "
";
h = h .. "";
h = h .. "";
h = h .. "${esc(title)}";
h = h .. "";
h = h .. "";
h = h .. header();
h = h .. "${content}";
h = h .. footer();
h = h .. "";
return h;
}
-- The one transport helper every controller shares: a 200 HTML Resp.
pub fn ok_html(body: Text) -> Resp {
let h: map = {};
h["content-type"] = "text/html; charset=utf-8";
return Resp { status: 200, headers: h, body: body };
}
pub fn html_error(status: Int, title: Text, msg: Text) -> Resp {
let c = "