From 3ff209d6035827f4686574764490990d752f1004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 15 Apr 2022 04:50:03 +0200 Subject: [PATCH] web-model: add info --- .../files/lib/gluon/web/view/model/info.html | 7 ++++++ .../usr/lib/lua/gluon/web/model/classes.lua | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 package/gluon-web-model/files/lib/gluon/web/view/model/info.html diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/info.html b/package/gluon-web-model/files/lib/gluon/web/view/model/info.html new file mode 100644 index 00000000..d1edd81f --- /dev/null +++ b/package/gluon-web-model/files/lib/gluon/web/view/model/info.html @@ -0,0 +1,7 @@ +
+ <% if self.title then %> + + <% end %> + + <%=self.content%> +
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 1eb90251..eb00ca53 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 @@ -188,6 +188,28 @@ function Node:handle() end end +local Info = class(Node) +M.Info = Info + +function Info:__init__(...) + Node.__init__(self, ...) + + self.default = nil + self.size = nil + self.optional = false + + self.template = "model/info" + + self.error = false +end + +function Info:setcontent(content) + self.content = content +end + +function Info:settitle(title) + self.title = title +end local File = class(Node) M.File = File