srctree

Gregory Mullen parent 8e2d8025 d3ed71a5
expand typing a bit

inlinesplit
src/endpoints/repos/diffs.zig added: 10, removed: 16, total 0
@@ -236,8 +236,6 @@ fn view(ctx: *Context) Error!void {
const delta_id = ctx.uri.next().?;
const index = isHex(delta_id) orelse return error.Unrouteable;
 
var dom = DOM.new(ctx.alloc);
 
var delta = Delta.open(ctx.alloc, rd.name, index) catch |err| switch (err) {
error.InvalidTarget => return error.Unrouteable,
error.InputOutput => unreachable,
@@ -245,17 +243,10 @@ fn view(ctx: *Context) Error!void {
else => unreachable,
} orelse return error.Unrouteable;
 
dom = dom.open(HTML.element("context", null, null));
dom.push(HTML.text(rd.name));
dom = dom.open(HTML.p(null, null));
dom.push(HTML.text(Bleach.sanitizeAlloc(ctx.alloc, delta.title, .{}) catch unreachable));
dom = dom.close();
dom = dom.open(HTML.p(null, null));
dom.push(HTML.text(Bleach.sanitizeAlloc(ctx.alloc, delta.message, .{}) catch unreachable));
dom = dom.close();
dom = dom.close();
 
const patch_header = try allocPrint(ctx.alloc, "{pretty}", .{dom.done()[0]});
const patch_header = S.Header{
.title = Bleach.sanitizeAlloc(ctx.alloc, delta.title, .{}) catch unreachable,
.message = Bleach.sanitizeAlloc(ctx.alloc, delta.message, .{}) catch unreachable,
};
 
// meme saved to protect history
//for ([_]Comment{ .{
 
templates/delta-diff.html added: 10, removed: 16, total 0
@@ -9,7 +9,10 @@
<content class="diff">
<context>
<With Patch>
<Header>
<With Header>
<context><Title></context>
<p><Message></p>
</With>
<diff>
<_patch.html>
</diff>