app/site.adp:
<%#-*- mode:tcl -*-
ns_adp_ctl displayerror true
ns_adp_ctl detailerror true
ns_adp_ctl stricterror true
namespace eval site {
variable header "Site Header"
variable footer "Site Footer"
variable style eurotcl
}
proc site::style {} {ns_adp_puts -nonewline $::site::style}
proc site::name {} {ns_adp_puts -nonewline $::app::name}
proc site::header {} {ns_adp_puts [ns_adp_parse $::site::header]}
proc site::footer {} {ns_adp_puts [ns_adp_parse $::site::footer]}
namespace eval app {
variable name "App Name"
variable tagline "Tagline"
}
namespace eval page {
variable title "Page Title"
variable content "Content"
variable form [ns_getform]
}
proc page::title {} {ns_adp_puts -nonewline $::page::title}
proc page::content args {
try {
switch -exact [ns_conn method] {
GET {get {*}$args}
POST {post {*}$args}
default {
}
}
} on error {Msg Error} {
ns_log Error $Msg
ns_log Debug $Error
ns_returnnotice 500 "Internal Server Error" \
[expr {[ns_adp_ctl detailerror] ? $Msg : "Error details are in the server logs"}]
}
}
proc page::get args {ns_adp_puts [ns_adp_parse $::page::content]}
proc page::post args wrong_method
proc page::wrong_method {} {
ns_returnnotice 405 "Method Not Allowed" "The [ns_conn method] method is not allowed for this URL."
ns_adp_abort
}
proc site::eval args {
if {[string match {\{$*} $args]} {
ns_adp_puts -nonewline [uplevel ns_quotehtml [lindex $args 0]]
} else {
ns_adp_puts -nonewline [ns_quotehtml [uplevel {*}$args]]
}
}
ns_adp_registerproc adp:q ::site::eval
# Apps
namespace eval adp {variable title "The NaviServer Web Anti-Framework"}
namespace eval edf {variable title "Planning Kept Simple"}
# Site
set ::footer {
<img alt="Letter 'M' in volcano colores" src="/img/logo_M.png"
style="margin:1px;background-color:white;float:right;height:20px;vertical-align:middle">
<a href="https://jorge.at.anteris.net/">Georg Lehner</a>, <a href="https://magma-soft.at/">MagmaSoft e.U.</a>
<time datetime="2026">2026</time>
}
%>