val name = $"name";
if Location.alreadyExists (parent, name) then
- %><h3><b>That location already exists!</b></h3><%
+ %><h3>That location already exists!</h3><%
else
val id = Location.addLocation (parent, $"name")
- %><h3><b>Location added</b></h3>
+ %><h3>Location added</h3>
<% end
elseif $"mod" <> "" then
val id = Web.stoi ($"mod");
val loc = Location.lookupLocation id %>
-<h3><b>Modify a location</b></h3>
+<h3>Modify a location</h3>
-<form action="location">
+<form action="location" method="post">
<input type="hidden" name="save" value="<% id %>">
-<table>
-<tr> <td align="right"><b>Parent</b>:</td> <td><select name="parent">
+<table class="blanks">
+<tr> <td>Parent:</td> <td><select name="parent">
<option value=""<% if #parent loc = NONE then %> selected<% end %>><None></option>
<% ref indent = 0;
foreach item in Location.locationTree (NONE, NONE) do
<% end
end %>
</select></td> </tr>
-<tr> <td align="right"><b>Name</b>:</td> <td><input name="name" value="<% Web.html (#name loc) %>"></td> </tr>
+<tr> <td>Name:</td> <td><input name="name" required="required" value="<% Web.html (#name loc) %>"></td> </tr>
<tr> <td><input type="submit" value="Save"></td> </tr>
</table>
</form>
val loc = Location.lookupLocation id;
Location.modLocation {loc with parent = (case $"parent" of "" => NONE | parent => SOME (Web.stoi parent)),
name = $"name"};
- %><h3><b>Location saved</b></h3>
+ %><h3>Location saved</h3>
<% elseif $"del" <> "" then
Group.requireGroupName "location";
showNormal := false;
val id = Web.stoi ($"del");
val loc = Location.lookupLocation id %>
- <h3><b>Are you sure you want to delete "<% Web.html (#name loc) %>"?</b></h3>
+ <h3>Are you sure you want to delete "<% Web.html (#name loc) %>"?</h3>
<a href="location?del2=<% id %>">Yes, delete "<% Web.html (#name loc) %>"!</a>
<% elseif $"del2" <> "" then
val id = Web.stoi ($"del2");
val loc = Location.lookupLocation id;
Location.deleteLocation id %>
- <h3><b>Deleted location "<% Web.html (#name loc) %>"</b></h3>
+ <h3>Deleted location "<% Web.html (#name loc) %>"</h3>
<% elseif $"addLoc" <> "" then
Location.addToLocation {loc = Web.stoi ($"addLoc"), usr = Init.getUserId ()}
- %><h3><b>Added</b></h3>
+ %><h3>Added</h3>
<% elseif $"remLoc" <> "" then
Location.removeFromLocation {loc = Web.stoi ($"remLoc"), usr = Init.getUserId ()}
- %><h3><b>Removed</b></h3>
+ %><h3>Removed</h3>
<% elseif $"id" <> "" then
showNormal := false;
%><b>Parent</b>: <a href="location?id=<% par %>"><% Web.html (#name ploc) %></a><%
end %>
-<h3><b>Residents:</b></h3>
+<h3>Residents:</h3>
<% ref first = true;
foreach user in Location.residents id do
if first then
%><a href="user?id=<% #id user %>"><% #name user %></a><%
end %>
-<h3><b>Regions:</b></h3>
+<h3>Regions:</h3>
<% foreach loc in Location.subLocations (SOME id) do %>
<a href="location?id=<% #id loc %>"><% Web.html (#name loc) %></a><br>
<% end;
-end;
+end; %>
-if showNormal then %>
-<ul>
-<% foreach item in Location.locationTreeWithCounts (NONE, NONE) do
- switch item of
- Util.BEGIN => %>
- <ul>
-<% | Util.END => %>
- </ul>
-<% | Util.ITEM (num, loc) => %>
- <li> <a href="location?id=<% #id loc %>"><% Web.html (#name loc) %></a> (<% num %>)
-<a href="location?mod=<% #id loc %>">[Modify]</a> <a href="location?del=<% #id loc %>">[Delete]</a></li>
-<% end
-end %>
-</ul>
-<h3><b>Add a new location</b></h3>
+<h3>Add a new location</h3>
-<form action="location">
+<form action="location" method="post">
<input type="hidden" name="cmd" value="add">
-<table>
-<tr> <td align="right"><b>Parent</b>:</td> <td><select name="parent">
+<table class="blanks">
+<tr> <td>Parent:</td> <td><select name="parent">
<option value=""><None></option>
<% ref indent = 0;
foreach item in Location.locationTree (NONE, NONE) do
<% end
end %>
</select></td> </tr>
-<tr> <td align="right"><b>Name</b>:</td> <td><input name="name"></td> </tr>
+<tr> <td>Name:</td> <td><input name="name" required="required"></td> </tr>
<tr> <td><input type="submit" value="Add"></td> </tr>
</table>
</form>
<% val withUser = Location.locationTreeWithUser (NONE, NONE, Init.getUserId ()) %>
-<h3><b>Add yourself to a location</b></h3>
+<h3>Add yourself to a location</h3>
Adding yourself to a location automatically adds you to all more general loations.
-<form action="location">
+<form action="location" method="post">
<select name="addLoc">
<% ref indent = 0;
foreach item in withUser do
</select> <input type="submit" value="Add">
</form>
-<h3><b>Remove yourself from a location</b></h3>
+<h3>Remove yourself from a location</h3>
-<form action="location">
+<form action="location" method="post">
<select name="remLoc">
<% ref indent = 0;
foreach item in withUser do
</form>
+<% if showNormal then %>
+<ul>
+<% foreach item in Location.locationTreeWithCounts (NONE, NONE) do
+ switch item of
+ Util.BEGIN => %>
+ <ul>
+<% | Util.END => %>
+ </ul>
+<% | Util.ITEM (num, loc) => %>
+ <li> <a href="location?id=<% #id loc %>"><% Web.html (#name loc) %></a> (<% num %>)
+<a href="location?mod=<% #id loc %>">[Modify]</a> <a href="location?del=<% #id loc %>">[Delete]</a></li>
+<% end
+end %>
+</ul>
+
+
+
<% end %>
<% @footer[] %>
\ No newline at end of file