Update templates to use new context
This commit is contained in:
parent
6f30696d30
commit
ec4e99c41e
4 changed files with 3 additions and 6 deletions
|
@ -298,9 +298,8 @@ pub const Response = struct {
|
||||||
@embedFile("./controllers/web/_format.tmpl.html"),
|
@embedFile("./controllers/web/_format.tmpl.html"),
|
||||||
data,
|
data,
|
||||||
.{
|
.{
|
||||||
.community = srv.community,
|
.community = srv.context.community,
|
||||||
.user = user,
|
.user = user,
|
||||||
.user_id = srv.context.userId(),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,6 @@ const global_timeline = struct {
|
||||||
|
|
||||||
try res.template(.ok, srv, @embedFile("./web/timelines/global.tmpl.html"), .{
|
try res.template(.ok, srv, @embedFile("./web/timelines/global.tmpl.html"), .{
|
||||||
.notes = timeline.items,
|
.notes = timeline.items,
|
||||||
.community = srv.community,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -370,7 +369,6 @@ const cluster = struct {
|
||||||
pub fn handler(_: anytype, res: anytype, srv: anytype) !void {
|
pub fn handler(_: anytype, res: anytype, srv: anytype) !void {
|
||||||
const meta = try srv.getClusterMeta();
|
const meta = try srv.getClusterMeta();
|
||||||
try res.template(.ok, srv, @embedFile("./web/cluster/overview.tmpl.html"), .{
|
try res.template(.ok, srv, @embedFile("./web/cluster/overview.tmpl.html"), .{
|
||||||
.community = srv.community,
|
|
||||||
.meta = meta,
|
.meta = meta,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<nav>
|
<nav>
|
||||||
<h1 class="title"><a href="/about">fediglam</a></h1>
|
<h1 class="title"><a href="/about">fediglam</a></h1>
|
||||||
<ul>
|
<ul>
|
||||||
{#if %user_id |$_|}
|
{#if %user |$_|}
|
||||||
<li><a class="button" href="/timelines/global">Timeline</a></li>
|
<li><a class="button" href="/timelines/global">Timeline</a></li>
|
||||||
{#else}
|
{#else}
|
||||||
<li><a class="button" href="/about">Sign in</a></li>
|
<li><a class="button" href="/about">Sign in</a></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<header>
|
<header>
|
||||||
<h2>{ .community.name }</h2>
|
<h2>{ %community.name }</h2>
|
||||||
</header>
|
</header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Reference in a new issue