A bundle of minor improvements
authorClinton Ebadi <clinton@unknownlamer.org>
Tue, 25 Mar 2014 05:37:16 +0000 (01:37 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Tue, 25 Mar 2014 05:37:16 +0000 (01:37 -0400)
* Use html5 form validation to improve the error experience
* Default IP address requests to bog
* List domains the member controls on the domain request page
* Pre-fill cert path with $HOME/certificates on cert request page
* Hide certificate signing request page since we're not really doing
  that anymore

14 files changed:
app/join.mlt
apt.mlt
cert.mlt
contact.mlt
domain.mlt
header.mlt.in
ip.mlt
link.mlt
list.mlt
location.mlt
money.mlt
payment.mlt
poll.mlt
quota.mlt

index 79a66fb..339d0f8 100644 (file)
@@ -39,8 +39,8 @@
                        Check your e-mail for a message with further instructions.
                        <div class="warning">
              <h1>Initial Password</h1>
-             <h2>Save this password to use to access your new account if your application is approved:</h2>
-                       <blockquote><tt><% Web.html unix_passwd %></tt></blockquote>
+             <h2>Save this password to access your new account if your application is approved:</h2>
+                       <blockquote><tt style="font-size: larger;"><% Web.html unix_passwd %></tt></blockquote>
 
              <p>The above password is the initial password for your
              account and should be changed upon first login. If you
diff --git a/apt.mlt b/apt.mlt
index ab3e2e4..1aef9b1 100644 (file)
--- a/apt.mlt
+++ b/apt.mlt
@@ -225,7 +225,7 @@ in the "Reason" field.
        <option value="<% #id node %>"<% if #id node = nodeNum then %> selected<% end %>><% Web.html (#name node) %> (<% Web.html (#descr node) %>; Debian <% Web.html (#debian node) %>)</option>
 <% end %>
 </select></td></tr>
-<tr> <td>Packages:</td> <td><textarea name="new" rows="10" cols="40" wrap="soft"></textarea></td> </tr>
+<tr> <td>Packages:</td> <td><textarea name="new" rows="10" cols="40" wrap="soft" required="required"></textarea></td> </tr>
 <tr> <td>Reason:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
index 0206458..a597ae4 100644 (file)
--- a/cert.mlt
+++ b/cert.mlt
@@ -146,7 +146,7 @@ elseif $"mod" <> "" then
 <input type="hidden" name="new" value="1">
 <table class="blanks">
 <tr> <td>Domain:</td> <td><% @chooseDomain[] %></td> </tr>
-<tr> <td>OpenSSL certificate:</td> <td><input name="cert" size="60"></td> </tr>
+<tr> <td>OpenSSL certificate:</td> <td><input name="cert" size="60" required="required" value="<% Quotas.path ("user." ^ Init.getUserName ()) ^ "/certificates/" %>" ></td> </tr>
 <tr> <td>Additional comments:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
index 905b9c7..ed8e049 100644 (file)
@@ -64,7 +64,7 @@ if showNormal then %>
        <option value="<% #id kind %>"><% Web.html (#name kind) %></option>
 <% end %>
 </select></td> </tr>
-<tr> <td>Value:</td> <td><input name="v"></td> </tr>
+<tr> <td>Value:</td> <td><input name="v" required="required"></td> </tr>
 <tr> <td>Readable by:</td> <td><select name="priv">
        <option value="0">Anyone</option>
        <option value="1" selected>Members only</option>
index 0493788..c426e46 100644 (file)
@@ -120,12 +120,23 @@ Enter the full Internet domain name that you own and would like set up here.  We
 
 <form action="domain" method="post">
 <table class="blanks">
-<tr> <td>Domain:</td> <td><input name="req"></td> </tr>
+<tr> <td>Domain:</td> <td><input name="req" required="required"></td> </tr>
 <tr> <td>Reason:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
 </form>
 
+<h3>Your current domains</h3>
+
+<p>To remove any domain you control, you can run <tt>domtool-admin
+rmdom $DOMAIN</tt>.</p>
+
+<ul>
+<% foreach dom in ChooseDomain.domains (Init.getUserName ()) do %>
+   <li><tt><% dom %></tt></li>
+<% end %>
+</ul>
+
 <% end %>
 
 <% @footer[] %>
\ No newline at end of file
index 034b400..dad2160 100644 (file)
@@ -37,7 +37,7 @@ Support requests<br />
 <li> <a href="list">Mailman mailing list</a></li>
 <li> <a href="ip">IP address</a></li>
 <li> <a href="cert">SSL certificate permissions</a></li>
-<li> <a href="sign">SSL certificate signing</a></li>
+<!-- <li> <a href="sign">SSL certificate signing</a></li> -->
 <li> <a href="support">Other</a></li>
 </div>
 
diff --git a/ip.mlt b/ip.mlt
index c849e1f..daa6922 100644 (file)
--- a/ip.mlt
+++ b/ip.mlt
@@ -3,7 +3,7 @@
 val admin = Group.inGroupName "server";
 
 val nodeNum = case $"node" of
-                 "" => 2
+                 "" => 4
                | node => Web.stoi node;
 
 if $"new" <> "" then
index d66daaf..37200e8 100644 (file)
--- a/link.mlt
+++ b/link.mlt
@@ -22,9 +22,9 @@ if $"cmd" = "add" then
 <form action="link" method="post">
 <input type="hidden" name="save" value="<% id %>">
 <table class="blanks">
-<tr> <td>Title:</td> <td><input name="title" value="<% Web.html (#title link) %>"></td> </tr>
-<tr> <td>URL:</td> <td><input name="url" value="<% Web.html (#url link) %>"></td> </tr>
-<tr> <td>Description:</td> <td><input name="descr" value="<% Web.html (#descr link) %>"></td> </tr>
+<tr> <td>Title:</td> <td><input name="title" value="<% Web.html (#title link) %>" required="required"></td> </tr>
+<tr> <td>URL:</td> <td><input name="url" value="<% Web.html (#url link) %>" type="url" required="required"></td> </tr>
+<tr> <td>Description:</td> <td><input name="descr" value="<% Web.html (#descr link) %>" required="required"></td> </tr>
 <tr> <td><input type="submit" value="Save"></td> </t>
 </table>
 </form>
@@ -69,9 +69,9 @@ if showNormal then %>
 <form action="link" method="post">
 <input type="hidden" name="cmd" value="add">
 <table class="blanks">
-<tr> <td>Title:</td> <td><input name="title"></td> </tr>
-<tr> <td>URL:</td> <td><input name="url" value="http://"></td> </tr>
-<tr> <td>Description:</td> <td><input name="descr"></td> </tr>
+<tr> <td>Title:</td> <td><input name="title" required="required"></td> </tr>
+<tr> <td>URL:</td> <td><input name="url" value="http://" type="url" required="required"></td> </tr>
+<tr> <td>Description:</td> <td><input name="descr" required="required"></td> </tr>
 <tr> <td><input type="submit" value="Add"></td> </t>
 </table>
 </form>
index e57467f..5cd5ce5 100644 (file)
--- a/list.mlt
+++ b/list.mlt
@@ -118,7 +118,7 @@ elseif $"mod" <> "" then
 
 <form action="list" method="post">
 <table class="blanks">
-<tr> <td>List name:</td> <td><input name="req"></td> </tr>
+<tr> <td>List name:</td> <td><input name="req" required="required"></td> </tr>
 <tr> <td>Reason:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
index 9ac74f9..f14f25c 100644 (file)
@@ -42,7 +42,7 @@ foreach item in Location.locationTree (NONE, NONE) do
 <%     end
 end %>
 </select></td> </tr>
-<tr> <td>Name:</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>
@@ -107,22 +107,8 @@ end %>
        <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>Add a new location</h3>
 
@@ -145,7 +131,7 @@ foreach item in Location.locationTree (NONE, NONE) do
 <%     end
 end %>
 </select></td> </tr>
-<tr> <td>Name:</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>
@@ -197,6 +183,23 @@ end %>
 </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
index 9129de9..af404c5 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -680,7 +680,7 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI
 <tr>
   <td><% #name (Init.lookupUser (#webuser_id stripePmt)) %></td>
   <td><% #paid_on stripePmt %></td>
-  <td><% #card_name stripePmt %>
+  <td><% #card_name stripePmt %></td>
   <td style="text-align: right">$<% #net stripePmt %></td>
   <td><form method="post">
         <input type="hidden" name="cmd" value="stripeApply" />
index aac7c71..4a7aea8 100644 (file)
@@ -29,7 +29,7 @@ days.</p>
   <input type="hidden" name="item_name" value="Member payment for <% Init.getUserName () %>" />
 
   <select id="paypalDuesEasy">
-    <option value="" selected="selected">---</option>
+    <option value="" selected="selected">Custom:</option>
     <% foreach (amt) in [10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100] do %>
     <option value="<% amt %>.00">$<% amt %>.00</option>
     <% end %>
@@ -41,8 +41,8 @@ days.</p>
    });
   </script>
 
-  <label>$<input id="paypalDues" type="text" name="amount" pattern="^\\d+\\.\\d\\d$" /></label>
-  <input type="submit" value="Add to Your Balance With Paypal" />
+  <label>$<input id="paypalDues" type="text" name="amount" pattern="^\\d+\\.\\d\\d$" required="required" size="7" /></label>
+  <input type="submit" value="Add To Balance" />
 </form>
 
 <% switch #paypal you of
@@ -55,7 +55,7 @@ end %>
 
 <form id="stripeForm" action="/stripe/stripe-payment.cgi" method="POST">
   <select id="stripeDuesEasy">
-    <option value="" selected="selected">---</option>
+    <option value="" selected="selected">Custom:</option>
     <% foreach (amt) in [10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100] do %>
     <option value="<% amt %>.00">$<% amt %>.00</option>
     <% end %>
@@ -66,12 +66,11 @@ end %>
      $("#stripeDues").val ($(this).val ());
    });
   </script>
-  <label>$<input type="text" name="stripeDues" id="stripeDues" pattern="^\\d+\\.\\d\\d$"/></label>
+  <label>$<input type="text" name="stripeDues" id="stripeDues" pattern="^\\d+\\.\\d\\d$" required="required" size="7" /></label>
   <input type="hidden" name="webuser_id" value="<% #id you %>" />
   <input type="hidden" name="webuser_name" value="<% #name you %>" />
   
-  <button id="stripePay">Add To Your Balance With Stripe</button>
-
+  <button id="stripePay">Add To Balance</button>
   <script>
    $("#stripePay").click (function(e) {
      if ($("#stripeDues")[0].validity.valid) { 
index 200c96a..691279c 100644 (file)
--- a/poll.mlt
+++ b/poll.mlt
@@ -360,12 +360,12 @@ end %>
 <form action="poll" method="post">
 <input type="hidden" name="cmd" value="add">
 <table class="blanks">
-<tr> <td>Title:</td> <td><input name="title"></td> </tr>
-<tr> <td>Start date:</td> <td><input name="starts"></td> </tr>
-<tr> <td>End date:</td> <td><input name="ends"></td> </tr>
-<tr> <td>Max votes/person:</td> <td><input name="votes"></td> </tr>
+<tr> <td>Title:</td> <td><input name="title" required="required"></td> </tr>
+<tr> <td>Start date:</td> <td><input name="starts" type="date" required="required"></td> </tr>
+<tr> <td>End date:</td> <td><input name="ends" type="date" required="required"></td> </tr>
+<tr> <td>Max votes/person:</td> <td><input name="votes" required="required" pattern="\\d+"></td> </tr>
 <tr> <td>Official:</td> <td><input type="checkbox" name="official"></td> </tr>
-<tr> <td>Description:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80"></textarea></td> </tr>
+<tr> <td>Description:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80" required="required"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Create"></td> </tr>
 </table>
 </form>
@@ -373,4 +373,4 @@ end %>
 <% end
 end %>
 
-<% @footer[] %>
\ No newline at end of file
+<% @footer[] %>
index 281933a..2b80f1c 100644 (file)
--- a/quota.mlt
+++ b/quota.mlt
@@ -147,7 +147,7 @@ elseif $"mod" <> "" then
   <tr> <th>Volume</th> <th>Used</th> <th>Current Quota</th> <th>Requested Quota (kB)</th> </tr>
 <% foreach vol in Quotas.getQuotas (Init.getUserName ()) do %>
    <tr> <td><% #vol vol %></td> <td><% #used vol %> kB (<% (#used vol) / 1024 %> MiB)</td> <td><% #quota vol %> kB (<% (# quota vol) / 1024 %> MiB)</td>
-   <td><input name="<% #vol vol %>" value="<% #quota vol %>"></td> </tr>
+   <td><input name="<% #vol vol %>" value="<% #quota vol %>" pattern="\\d+"></td> </tr>
 <% end %>
 </table>