From 099febb41f0921bd45ef2f6a657170e800925f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Tue, 24 May 2022 10:31:34 +0200 Subject: [PATCH] gluon-web-model: add Warning --- .../lib/gluon/web/view/model/warning.html | 3 +++ .../usr/lib/lua/gluon/web/model/classes.lua | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 package/gluon-web-model/files/lib/gluon/web/view/model/warning.html diff --git a/package/gluon-web-model/files/lib/gluon/web/view/model/warning.html b/package/gluon-web-model/files/lib/gluon/web/view/model/warning.html new file mode 100644 index 00000000..c0e476ed --- /dev/null +++ b/package/gluon-web-model/files/lib/gluon/web/view/model/warning.html @@ -0,0 +1,3 @@ +
+ <%=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 2ec0d71f..173fc85e 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 @@ -196,6 +196,24 @@ function Template:__init__(template) self.template = template end +local Warning = class(Node) +M.Warning = Warning + +function Warning:__init__(...) + Node.__init__(self, ...) + + self.default = nil + self.size = nil + self.optional = false + + self.template = "model/warning" + + self.error = false +end + +function Warning:setcontent(content) + self.content = content +end local AbstractValue = class(Node) M.AbstractValue = AbstractValue