Update templates to use new context

This commit is contained in:
jaina heartles 2023-01-01 16:01:58 -08:00
parent 6f30696d30
commit ec4e99c41e
4 changed files with 3 additions and 6 deletions

View file

@ -298,9 +298,8 @@ pub const Response = struct {
@embedFile("./controllers/web/_format.tmpl.html"),
data,
.{
.community = srv.community,
.community = srv.context.community,
.user = user,
.user_id = srv.context.userId(),
},
);

View file

@ -208,7 +208,6 @@ const global_timeline = struct {
try res.template(.ok, srv, @embedFile("./web/timelines/global.tmpl.html"), .{
.notes = timeline.items,
.community = srv.community,
});
}
};
@ -370,7 +369,6 @@ const cluster = struct {
pub fn handler(_: anytype, res: anytype, srv: anytype) !void {
const meta = try srv.getClusterMeta();
try res.template(.ok, srv, @embedFile("./web/cluster/overview.tmpl.html"), .{
.community = srv.community,
.meta = meta,
});
}

View file

@ -11,7 +11,7 @@
<nav>
<h1 class="title"><a href="/about">fediglam</a></h1>
<ul>
{#if %user_id |$_|}
{#if %user |$_|}
<li><a class="button" href="/timelines/global">Timeline</a></li>
{#else}
<li><a class="button" href="/about">Sign in</a></li>

View file

@ -1,5 +1,5 @@
<header>
<h2>{ .community.name }</h2>
<h2>{ %community.name }</h2>
</header>
<nav>
<ul>