web-model: add file
This commit is contained in:
parent
edbd2a0d3f
commit
f1143acadd
@ -0,0 +1,21 @@
|
||||
<form method="post" enctype="multipart/form-data" action="<%|url(request)%>">
|
||||
<% if self.error then %>
|
||||
<p class="error"><%=self.error%></p>
|
||||
<% end %>
|
||||
|
||||
<div class="gluon-section-node">
|
||||
<div class="gluon-value">
|
||||
<label class="gluon-value-title">
|
||||
<%=self.title%>
|
||||
</label>
|
||||
<div class="gluon-value-field">
|
||||
<input type="file" name="file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="gluon-page-actions">
|
||||
<input type="hidden" name="step" value="2">
|
||||
<input class="gluon-button gluon-button-submit" type="submit" value="<%:Upload%>">
|
||||
</div>
|
||||
</form>
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user