<% local fs = require "nixio.fs" %> <%+header%>

<%:system%> - <%:editfile%>

<%:edf_desc%>

<% if state == "update" then %> <% contents = string.gsub(contents, "\r\n", "\n") local size = fs.writefile(filepath, contents) %> <%:edf_upload_succeeded%>(bytesize = <%=size%> bytes) <% elseif state == "load" then %> <% local contents = fs.readfile(filepath) or "" local empty if contents == "" then empty = 1 end %> <% if empty == 1 then %> <%:edf_no_such_files%> <% else %>
<%:edf_filepath%> : <%=filepath%>
<% end %> <% else %>
<%:edf_target_filepath%>:
<% end %> <%+footer%>