diff redirector/templates/redirects.html @ 0:af82aaec0377

initial import of redirector
author k0s <k0scist@gmail.com>
date Mon, 07 Sep 2009 15:15:48 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/redirector/templates/redirects.html	Mon Sep 07 15:15:48 2009 -0400
@@ -0,0 +1,77 @@
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://genshi.edgewall.org/">
+<head>
+  <title>redirects</title>
+</head>
+<body>
+  <h1>redirects</h1>
+
+  <!-- TODO: separate these to its own template to xi:include -->
+  <table>
+    <tr>
+      <th>From</th>
+      <th></th>
+      <th>To</th>
+      <th>Type</th>
+      <th>Created</th>
+      <th>Expires</th>
+      <th></th>
+    </tr>
+
+    <tr py:for="redirect in redirects">
+      <td>${redirect['from']}</td>
+      <td>&rarr;</td>
+      <td>${redirect['to']}</td>
+      <td py:choose="isinstance(redirect['type'], int)">
+        <span py:when="True">
+          ${str(redirect['type'])} ${status_map[redirect['type']].title}
+        </span>
+        <span py:otherwise="">meta refresh tag</span>
+      </td>
+      <td>${redirect['created'].strftime(date_format)}</td>
+      <td>
+        <span py:replace="redirect['expires'] and redirect['expires'].strftime(date_format) or 'never'"/>
+      </td>
+      <td>
+        <input type="submit" name="delete:${redirect['from']}" value="Remove"/>
+      </td>
+    </tr>
+  </table>
+
+  <h2>Add a redirect</h2>
+
+  <form action="post">
+    <dl>
+      <dt>From</dt>
+      <dd><input type="text" name="from"/></dd>
+      
+      <dt>To</dt>
+      <dd><input type="text" name="to"/></dd>
+
+      <dt>Type</dt>
+      <dd>
+        <select name="type">
+          <option py:for="key in sorted(status_map.keys())" value="${key}">${key} ${status_map[key].title}</option>
+          <option value="metarefresh">meta-refresh page</option>
+        </select>
+      </dd>
+
+      <dt>Expires</dt>
+      <dd>
+        <input type="text" name="expires"/>
+      </dd>
+
+      <dt>Reason for this redirect</dt>
+      <dd>
+        <textarea name="reason" cols="80" rows="25"></textarea>
+      </dd>
+    </dl>
+    
+    <input type="submit" name="add" value="Add"/>
+  </form>
+
+</body>
+</html>