inline for (inputs) |input| {
switch (@typeInfo(@TypeOf(input))) {
- .Struct => {
- try res.write("<input ", .{});
- try res.write(input[0], input[1]);
- 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("<input ", .{});
+ try res.write(input[0], input[1]);
+ try res.write(" />", .{});
+ }
},
else => {
try res.write("<input ", .{});
});
try self.res.write("<br />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("<br />Password: ", .{});