Browse Source

[YQTemplate] start form

main
Annwan 4 months ago
parent
commit
2eb6ad36c7
  1. 31
      yqtemplate.lua

31
yqtemplate.lua

@ -1,7 +1,34 @@
local etlua = require"etlua"
local form = etlua.compile[[
<!DOCTYPE html>
<html>
<head>
<title>Yokokas Quest Character Profile Creator</title>
</head>
<body>
<% if data then %><%= data %><% end %>
<form action="/cgi/yqtemplate" method="post">
<label for="name">Character name</label>
<input type="text" id="name" />
<input type="submit" value="Generate">
</form>
<hr />
Based on the character profiles in the webcomic <a
href=https://yokokasquest.com>Yokokas Quest</a> by Chris Hyacinth R. Assets
shared by the author on the <a
href=https://forums.cisumchronicles.com/>webcomics forums</a>.
</body>
</html>
]]
return { return {
desc = "Creates Yokoka’s quest-style personal status page", desc = "Creates Yokoka’s quest-style personal status page",
run = function(fcgi) run = function(fcgi)
fcgi.print("Content-Type: text/plain; charset=utf-8\r\n\r\n")
fcgi.print("Hello from application `YQTemplate'")
fcgi.print("Content-Type: text/html; charset=utf-8\r\n\r\n")
local data = nil
if fcgi.getenv("REQUEST_METHOD") == "POST"
data = fcgi.post()
end
form({data = data})
end end
} }
Loading…
Cancel
Save