Move rendering into private templates

Add an explicit template renderer with HTML views and partials for the app, bootstrap, package, and catalog pages. Move shared reporting setup into config/reporting.php and relocate stylesheet assets under css/.
This commit is contained in:
www-data
2026-05-26 12:50:26 +02:00
parent 2f2e8869d6
commit 475765e31f
55 changed files with 2328 additions and 1175 deletions
+9 -13
View File
@@ -14,6 +14,8 @@
* Outside code should not inspect DB rows directly.
*/
require_once __DIR__ . '/Template.php';
class RacketSandboxAuthException extends Exception
{
}
@@ -696,7 +698,7 @@ class RacketSandboxAuth
$this->messageHtml(
'Login required',
'Please log in to continue.',
'<p><a href="/login.php">Login</a></p>'
RacketSandboxTemplate::renderFile('partials/login-link.html', array('login_label' => 'Login'))
);
}
@@ -705,18 +707,12 @@ class RacketSandboxAuth
http_response_code(200);
header('Content-Type: text/html; charset=utf-8');
echo '<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>' . htmlspecialchars($title, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</title>
</head>
<body>
<h1>' . htmlspecialchars($title, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</h1>
<p>' . htmlspecialchars($message, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</p>
' . $extra . '
</body>
</html>';
echo RacketSandboxTemplate::renderFile('simple-message.html', array(
'language' => 'en',
'title' => $title,
'message' => $message,
'extra_html' => $extra,
));
exit;
}
}