From f1143acadd2dfdce4e44b8ae30f3f21a1f866fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 15 Apr 2022 04:49:53 +0200 Subject: [PATCH] web-model: add file --- .../files/lib/gluon/web/view/model/file.html | 21 +++++++++++++++++++ .../usr/lib/lua/gluon/web/model/classes.lua | 15 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 package/gluon-web-model/files/lib/gluon/web/view/model/file.html diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/file.html b/package/gluon-web-model/files/lib/gluon/web/view/model/file.html new file mode 100644 index 00000000..9b7aeb00 --- /dev/null +++ b/package/gluon-web-model/files/lib/gluon/web/view/model/file.html @@ -0,0 +1,21 @@ +
+ <% if self.error then %> +

<%=self.error%>

+ <% end %> + +
+
+ +
+ +
+
+
+ +
+ + +
+
diff --git a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua index 7306bbc0..1eb90251 100644 --- a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua +++ b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua @@ -189,6 +189,21 @@ function Node:handle() end +local File = class(Node) +M.File = File + +function File:__init__(...) + Node.__init__(self, ...) + + self.default = nil + self.size = nil + self.optional = false + + self.template = "model/file" + + self.error = false +end + local Template = class(Node) M.Template = Template