0
|
1 <!DOCTYPE html
|
|
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
4 <html xmlns="http://www.w3.org/1999/xhtml"
|
|
5 xmlns:py="http://genshi.edgewall.org/">
|
|
6 <head>
|
|
7 <title>redirects</title>
|
|
8 </head>
|
|
9 <body>
|
|
10 <h1>redirects</h1>
|
|
11
|
|
12 <!-- TODO: separate these to its own template to xi:include -->
|
|
13 <table>
|
|
14 <tr>
|
|
15 <th>From</th>
|
|
16 <th></th>
|
|
17 <th>To</th>
|
|
18 <th>Type</th>
|
|
19 <th>Created</th>
|
|
20 <th>Expires</th>
|
|
21 <th></th>
|
|
22 </tr>
|
|
23
|
|
24 <tr py:for="redirect in redirects">
|
|
25 <td>${redirect['from']}</td>
|
|
26 <td>→</td>
|
|
27 <td>${redirect['to']}</td>
|
|
28 <td py:choose="isinstance(redirect['type'], int)">
|
|
29 <span py:when="True">
|
|
30 ${str(redirect['type'])} ${status_map[redirect['type']].title}
|
|
31 </span>
|
|
32 <span py:otherwise="">meta refresh tag</span>
|
|
33 </td>
|
|
34 <td>${redirect['created'].strftime(date_format)}</td>
|
|
35 <td>
|
|
36 <span py:replace="redirect['expires'] and redirect['expires'].strftime(date_format) or 'never'"/>
|
|
37 </td>
|
|
38 <td>
|
|
39 <input type="submit" name="delete:${redirect['from']}" value="Remove"/>
|
|
40 </td>
|
|
41 </tr>
|
|
42 </table>
|
|
43
|
|
44 <h2>Add a redirect</h2>
|
|
45
|
|
46 <form action="post">
|
|
47 <dl>
|
|
48 <dt>From</dt>
|
|
49 <dd><input type="text" name="from"/></dd>
|
|
50
|
|
51 <dt>To</dt>
|
|
52 <dd><input type="text" name="to"/></dd>
|
|
53
|
|
54 <dt>Type</dt>
|
|
55 <dd>
|
|
56 <select name="type">
|
|
57 <option py:for="key in sorted(status_map.keys())" value="${key}">${key} ${status_map[key].title}</option>
|
|
58 <option value="metarefresh">meta-refresh page</option>
|
|
59 </select>
|
|
60 </dd>
|
|
61
|
|
62 <dt>Expires</dt>
|
|
63 <dd>
|
|
64 <input type="text" name="expires"/>
|
|
65 </dd>
|
|
66
|
|
67 <dt>Reason for this redirect</dt>
|
|
68 <dd>
|
|
69 <textarea name="reason" cols="80" rows="25"></textarea>
|
|
70 </dd>
|
|
71 </dl>
|
|
72
|
|
73 <input type="submit" name="add" value="Add"/>
|
|
74 </form>
|
|
75
|
|
76 </body>
|
|
77 </html>
|