X-Git-Url: https://gitweb.ps.run/chirp/blobdiff_plain/355355f8305852a609d3960fb9e9b07177cf8f1f..d8f54dd8ac187349c1194871a55d4675f28e5a43:/src/main.zig
diff --git a/src/main.zig b/src/main.zig
index 8cabda6..164606f 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -509,10 +509,16 @@ fn html_form(res: *http.Response, action: []const u8, inputs: anytype) !void {
inline for (inputs) |input| {
switch (@typeInfo(@TypeOf(input))) {
- .Struct => {
- try res.write("", .{});
+ .Struct => |s| {
+ if (s.fields.len == 3) {
+ try res.write("<{s} ", .{input[0]});
+ try res.write(input[1], input[2]);
+ try res.write(">{s}>", .{input[0]});
+ } else {
+ try res.write("", .{});
+ }
},
else => {
try res.write("Description: ", .{});
try html_form(self.res, "/set_description", .{
- .{ "type=\"text\" name=\"description\" placeholder=\"{s}\"", .{login.user.description.constSlice()} },
+ .{ "textarea", "type=\"text\" name=\"description\" placeholder=\"{s}\"", .{login.user.description.constSlice()} },
"type=\"submit\" value=\"Change\"",
});
try self.res.write("
Password: ", .{});