-
Notifications
You must be signed in to change notification settings - Fork 57
/
redirects.html
173 lines (150 loc) · 6.23 KB
/
redirects.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{% extends "main.html" %}
{% block title %}
URL and Email Redirect Management
{% endblock %}
{% block stylesheets %}
{{ block.super }}
<link rel="stylesheet" href="/media/styles/forms.css" type="text/css" />
<link rel="stylesheet" href="/media/styles/expand_display.css" type="text/css" />
{% endblock %}
{% block xtrajs %}
<script type="text/javascript">
function deleteRedirect() {
if (confirm('Are you sure you would like to delete this redirect?')) {
return true;
}
return false;
}
function deleteEmailRedirect() {
if (confirm('Are you sure you would like to delete this email redirect?')) {
return true;
}
return false;
}
</script>
{% endblock %}
{% block content %}
<h1>
URL and Email Redirect Management
</h1>
<p>Welcome to the redirect management page. Here you can create, edit, and delete <b>URL redirects</b> which redirect users from one URL to another and
<b>email redirects</b> which redirect emails sent to a custom or real email address on your domain to one or more real email addresses on any domain.</p>
<div id="program_form">
{% if open_section == "redirects" %}
<button class="dsphead active">
<b>URL Redirects</b> (click to expand/contract)
</button>
<div class="dspcont active">
{% else %}
<button class="dsphead">
<b>URL Redirects</b> (click to expand/contract)
</button>
<div class="dspcont">
{% endif %}
<form method="post">
<input type="hidden" name="command" value="{% if redirect_form.instance.id %}edit{% else %}add{% endif %}" />
{% if redirect_form.instance.id %}
<input type="hidden" name="id" value="{{ redirect_form.instance.id }}" />
{% endif %}
<input type="hidden" name="object" value="redirect" />
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr><th colspan="2" class="small">Add/Edit URL Redirects</th></tr>
{{ redirect_form }}
<tr><td colspan="2" align="center"><input class="fancybutton" type="submit" value="{% if redirect_form.instance.id %}Edit{% else %}Add{% endif %} URL Redirect" /></td></tr>
</table>
</form>
<br />
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr><th colspan="4">URL Redirects</th></tr>
<tr>
<td><b>Old URL</b></td>
<td></td>
<td><b>New URL</b></td>
<td><b>Options</b></td>
</tr>
{% for redirect in redirects %}
<tr>
<td>{{ redirect.old_path }}</td>
<td>⟶</td>
<td>{{ redirect.new_path }}</td>
<td>
<center>
<a href="{{ redirect.old_path }}" target="_blank" class="btn btn-primary" />Test</a>
<form method="post">
<input type="hidden" name="id" value="{{ redirect.id }}" />
<input type="hidden" name="command" value="load" />
<input type="hidden" name="object" value="redirect" />
<input type="submit" value="Edit" class="btn btn-primary" />
</form>
<form method="post" onsubmit="return deleteRedirect()">
<input type="hidden" name="id" value="{{ redirect.id }}" />
<input type="hidden" name="command" value="delete" />
<input type="hidden" name="object" value="redirect" />
<input type="submit" value="Delete" class="btn btn-danger" />
</form>
</center>
</td>
</tr>
{% endfor %}
</table>
</div>
{% if open_section == "email_redirects" %}
<button class="dsphead active">
<b>Email Redirects</b> (click to expand/contract)
</button>
<div class="dspcont active">
{% else %}
<button class="dsphead">
<b>Email Redirects</b> (click to expand/contract)
</button>
<div class="dspcont">
{% endif %}
<form method="post">
<input type="hidden" name="command" value="{% if email_redirect_form.instance.id %}edit{% else %}add{% endif %}" />
{% if email_redirect_form.instance.id %}
<input type="hidden" name="id" value="{{ email_redirect_form.instance.id }}" />
{% endif %}
<input type="hidden" name="object" value="email_redirect" />
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr><th colspan="2" class="small">Add/Edit Email Redirects</th></tr>
{{ email_redirect_form }}
<tr><td colspan="2" align="center"><input class="fancybutton" type="submit" value="{% if email_redirect_form.instance.id %}Edit{% else %}Add{% endif %} Email Redirect" /></td></tr>
</table>
</form>
<br />
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr><th colspan="6">Email Redirects</th></tr>
<tr>
<td><b>Original Email Address</b></td>
<td></td>
<td><b>Destination Email Address(es)</b></td>
<td><b>Options</b></td>
</tr>
{% for er in email_redirects %}
<tr>
<td>{{ er.original }}</td>
<td>⟶</td>
<td>{{ er.destination }}</td>
<td>
<center>
<form method="post">
<input type="hidden" name="id" value="{{ er.id }}" />
<input type="hidden" name="command" value="load" />
<input type="hidden" name="object" value="email_redirect" />
<input type="submit" value="Edit" class="btn btn-primary" />
</form>
<form method="post" onsubmit="return deleteEmailRedirect()">
<input type="hidden" name="id" value="{{ er.id }}" />
<input type="hidden" name="command" value="delete" />
<input type="hidden" name="object" value="email_redirect" />
<input type="submit" value="Delete" class="btn btn-danger" />
</form>
</center>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
<script type="text/javascript" src="/media/scripts/expand_display.js"></script>
{% endblock %}