Browse Source

[YQTemplate] do stuff

main
Annwan 4 months ago
parent
commit
c8548192ac
  1. 30
      yqform.etlua
  2. 2
      yqtemplate.lua

30
yqform.etlua

@ -11,31 +11,51 @@
<h3>General Information</h3> <h3>General Information</h3>
<dl> <dl>
<dt>Name</dt> <dt>Name</dt>
<dd><%= args.name.v %></dd>
<dd>
<% if args.name then %>
<%= args.name.v %>
<% end %>
</dd>
<dt>Avatar</dt> <dt>Avatar</dt>
<dd><img src="data:<%= args.avatar.t -%>;base64,<%= encoder(args.avatar.v) %>" /></dd>
<dd>
<% if args.avatar then %>
<img src="data:<%= args.avatar.t -%>;base64,<%= encoder(args.avatar.v) %>" />
<% end %>
</dd>
<dt>Is Leader</dt> <dt>Is Leader</dt>
<dd> <dd>
<% if args.is_leader and args.is_leader.v == "on" then %> <% if args.is_leader and args.is_leader.v == "on" then %>
<img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/basic_blank.png')) %>" /> <img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/basic_blank.png')) %>" />
<% else %> <% else %>
<img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/basic_blank.png')) %>" /> <img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/basic_blank.png')) %>" />
<% end %>c
<% end %>
</dd> </dd>
</dl> </dl>
<h3>Classes and Levels</h3> <h3>Classes and Levels</h3>
<dl> <dl>
<dt>Class 1</dt> <dt>Class 1</dt>
<dd> <dd>
<% if args.class1 then %>
<img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/'..classes[args.class1].f)) %>" /> <img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/'..classes[args.class1].f)) %>" />
<% if args.class1_lvl then %>
Lvl <%= args.class1_lvl %> Lvl <%= args.class1_lvl %>
<% end %>
<% end %>
</dd> </dd>
<dt>Class 2</dt> <dt>Class 2</dt>
<dd> <dd>
<% if args.class2 then %>
<img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/'..classes[args.class2].f)) %>" /> <img src="data:image/png;base64,<%= encoder(readfile('yqtemplate/'..classes[args.class2].f)) %>" />
<% if args.class2_lvl then %>
Lvl <%= args.class2_lvl %> Lvl <%= args.class2_lvl %>
<% end %>
<% end %>
</dd>
<dt>Class leaning</dt><dd>
<% if args.class_leaning then %>
<%= args.class_leaning %>
<% end %>
</dd> </dd>
<dt>Class leaning</dt><dd><%= args.class_leaning %></dd>
</dl> </dl>
<% end %> <% end %>
<form method="POST" action="/cgi/yqtemplate" enctype="multipart/form-data"> <form method="POST" action="/cgi/yqtemplate" enctype="multipart/form-data">
@ -49,7 +69,7 @@
<h2>Classes and Levels</h2> <h2>Classes and Levels</h2>
<label for="class1">Class 1:</label> <label for="class1">Class 1:</label>
<select name="class1"> <select name="class1">
<% for k, v in ipairs(classes) do %>
<% for k, v in ipairs(classes) do -%>
<option value="<%= k %>"><%= v.n %></option> <option value="<%= k %>"><%= v.n %></option>
<% end %> <% end %>
</select> </select>

2
yqtemplate.lua

@ -50,7 +50,7 @@ return {
encoder = require "base64".encode, encoder = require "base64".encode,
readfile = utils.readfile, readfile = utils.readfile,
args = args, args = args,
classes = classes
classes = classes,
elements = { elements = {
"Fire", "Water", "Earth", "Air", "Fire", "Water", "Earth", "Air",
"Wood", "Electricity", "Metals", "Dreams", "Wood", "Electricity", "Metals", "Dreams",

Loading…
Cancel
Save