-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate_admin.html
More file actions
267 lines (267 loc) · 11.1 KB
/
template_admin.html
File metadata and controls
267 lines (267 loc) · 11.1 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Admin page - Simple Site Manager For Google App Engine</title>
<style type="text/css">
body {
font-family: Tahoma, sans-selif;
margin: 0;
}
h1 {
font-size: 150%;
}
h2 {
font-size: 120%;
border-left:8px solid #3399FF;
border-bottom:1px solid #3399FF;
margin:0.25em 0em;
padding:0em 1em;
}
div#container {
background-color: #FFFFFF;
}
div#header {
width: 100%;
}
.gradient1 {
background-color: #99CCFF;
background: -ms-linear-gradient(#99CCFF, white); /* IE10 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#99ccff',endColorstr='#ffffff'); /* IE6 IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#99ccff',endColorstr='#ffffff')"; /* IE8+ */
background: -moz-linear-gradient(#99CCFF, white); /* FF 3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #99CCFF), color-stop(100%, #ffffff)); /* Safari 4+, Chrome 2+ */
background: -webkit-linear-gradient(#99CCFF, white); /* Safari 5.1+, Chrome 10+ */
background: -o-linear-gradient(#99CCFF, white); /* Opera 11.10 */
background: linear-gradient(#99CCFF, white); /* the standard */
}
.gradient2 {
background-color: #99CCFF;
background: -ms-linear-gradient(#ffffff, #99ccff); /* IE10 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#99ccff'); /* IE6 IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#99ccff')"; /* IE8+ */
background: -moz-linear-gradient(#ffffff, #99ccff); /* FF 3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #99ccff)); /* Safari 4+, Chrome 2+ */
background: -webkit-linear-gradient(#ffffff, #99ccff); /* Safari 5.1+, Chrome 10+ */
background: -o-linear-gradient(#ffffff, #99ccff); /* Opera 11.10 */
background: linear-gradient(#ffffff, #99ccff); /* the standard */
}
div#main {
width: 80%;
float: right;
margin: 4px;
padding: 10px;
border-left: #99CCFF 2px solid;
display: block;
}
div#menu {
width: 15%;
float: left;
display: block;
}
div#footer {
width: 100%;
clear: both;
background-color: #99CCFF;
text-align: right;
}
div#title {
padding: 10px;
}
div#about {
font-size: 75%;
padding:4px 16px;
}
div#contentslist {
display:block;
}
div#addtext {
display:block;
}
div#addfile {
display:block;
}
p.active {
margin: 4px;
padding: 2px 8px;
background-color: #CCE0FF;
border: 1px solid #99A8B0;
}
p.inactive {
margin: 4px;
padding: 2px 8px;
border: 0px solid #99A8B0;
}
span {
margin: 2px;
padding: 2px;
border: 1px solid #99A8B0;
}
span.errormsg {
border: 0px;
color: #FF0000;
font-weight: bold;
}
span.current {
background-color: #CCE0FF;
}
table.list {
border: 1px solid #99A8B0;
}
td.listcell {
border-top: 1px solid #99A8B0;
}
th {
background-color: #CCE0FF;
padding: 4px;
}
td {
padding: 4px 12px;
}
</style>
<script language="javascript" type="text/javascript"><!--
function inputcheck(form) {
if(form.path){
path=form.path.value;
if(path.charAt(0)!='/'){
path='/'+path;
}
if(path.substring(0,5)=='/_ah/' || path=='/form' || path=='{{ LIST_PATH }}' || path=='{{ EDIT_PATH }}' || path=='{{ UPLOAD_PATH }}' || path=='{{ ALIAS_PATH }}' || path=='{{ SETTING_PATH }}'){
alert('Invalid path.');
return false;
}
}
if(form.content){
if(form.content.value==''){
alert('Empty content.');
return false;
}
}
if(form.file){
if(! form.oldpath && form.file.value==''){
alert('File is not selected.');
return false;
}
}
if(form.utcoffset){
if(isNaN(form.utcoffset.value)){
alert('Invalid UTC offset.');
return false;
}
}
}
// -->
</script>
</head>
<body>
<div id="container">
<div id="header" class="gradient1">
<div id="title">
<h1>Simple Site Manager For Google App Engine</h1>
<p>Admin page</p>
</div>
</div>
<div id="main">
{% if errormsg %}<span class="errormsg">{{ errormsg }}</span>{% endif %}
{% ifequal CURRENT_PATH LIST_PATH %}
<div id="contentslist">
<h2>List of contents</h2>
<table class="list" cellspacing="0">
<tr><th>name</th><th>path</th><th>type</th><th>public</th><th>edit</th><th>delete</th></tr>
{% if contents %}
{% for c in contents %}
<tr>
<td class="listcell">{{ c.name }}</td>
<td class="listcell"><a href="{{ c.path }}" target="_blank">{{ c.path }}</a></td>
<td class="listcell">{{ c.entitytype }}</td>
<td class="listcell">{{ c.public }}</td>
<td class="listcell"><a href="{% ifequal c.entitytype 'file' %}{{ UPLOAD_PATH }}?{% else %}{% ifequal c.entitytype 'alias' %}{{ ALIAS_PATH }}?{% else %}{{ EDIT_PATH }}?mode=modify&{% endifequal %}{% endifequal %}target={{ c.path }}">edit</a></td>
<td class="listcell"><a href="{{ EDIT_PATH }}?mode=delete&target={{ c.path }}" onclick="return confirm('Are you sure you want to delete [{{ c.name }}] ?');">delete</a></td>
</tr>
{% endfor %}
{% else %}
<tr><td colspan="4"><no data></td></tr>
{% endif %}
</table><br><br>
{% for p in allpages %}
<span{% ifequal p currentpage %} class="current">{{ p }}{% else %}><a href="{{ LIST_PATH }}?page={{ p }}">{{ p }}</a>{% endifequal %}</span>
{% endfor %}
</div>
{% endifequal %}
{% ifequal CURRENT_PATH EDIT_PATH %}
<div id="addtext">
<h2>Edit content</h2>
<form action="{{ EDIT_PATH }}" method="post" name="editcontent">
<input type="hidden" name="datatype" value="text">
<table>
<tr><td>name:</td><td><input type="text" name="name"{% if modify %} value="{{ modify.name|escape }}"{% endif %}></td></tr>
{% if modify %}<tr><td>old path:</td><td><input type="text" name="oldpath" value="{{ modify.path|escape }}" readonly></td></tr>{% endif %}
<tr><td>{% if modify %}new {% endif %}path:</td><td><input type="text" name="path"{% if modify %} value="{{ modify.path|escape }}"{% endif %}></td></tr>
<tr><td>public:</td><td><input type="checkbox" name="public"{% if modify %}{% if modify.public %} checked{% endif %}{% else %} checked{% endif %}></td></tr>
<tr><td>encoding:</td><td><select name="encoding"><option{% ifequal modify.encoding 'UTF-8' %} selected{% endifequal %}>UTF-8</option><option{% ifequal modify.encoding 'Shift_JIS' %} selected{% endifequal %}>Shift_JIS</option><option{% ifequal modify.encoding 'EUC-JP' %} selected{% endifequal %}>EUC-JP</option><option{% ifequal modify.encoding 'ISO-2022-JP' %} selected{% endifequal %}>ISO-2022-JP</option></select></td></tr>
<tr><td>text:</td><td><textarea name="content" rows="15" cols="60">{% if modify %}{{ modify.textcontent|escape }}{% endif %}</textarea></td></tr>
<tr><td>description:</td><td><input type="text" name="description"{% if modify %} value="{{ modify.description|escape }}"{% endif %}></td></tr>
<tr><td colspan="2"><input type="submit" value="{% if modify %}modify{% else %}add{% endif %}" onclick="return inputcheck(document.editcontent);"></td></tr>
</table>
</form><br><br>
</div>
{% endifequal %}
{% ifequal CURRENT_PATH UPLOAD_PATH %}
<div id="addfile">
<h2>Upload file</h2>
<form action="{{ UPLOAD_PATH }}" method="post" enctype="multipart/form-data" name="uploadfile">
<input type="hidden" name="datatype" value="file">
<table>
<tr><td>name:</td><td><input type="text" name="name"{% if modify %} value="{{ modify.name|escape }}"{% endif %}></td></tr>
{% if modify %}<tr><td>old path:</td><td><input type="text" name="oldpath" value="{{ modify.path|escape }}" readonly></td></tr>{% endif %}
<tr><td>{% if modify %}new {% endif %}path:</td><td><input type="text" name="path"{% if modify %} value="{{ modify.path|escape }}"{% endif %}></td></tr>
<tr><td>public:</td><td><input type="checkbox" name="public"{% if modify %}{% if modify.public %} checked{% endif %}{% else %} checked{% endif %}></td></tr>
<tr><td>file:</td><td><input type="file" name="file"></td></tr>
<tr><td>description:</td><td><input type="text" name="description"{% if modify %} value="{{ modify.description|escape }}"{% endif %}></td></tr>
<tr><td colspan="2"><input type="submit" value="upload" onclick="return inputcheck(document.uploadfile);"></td></tr>
</table>
</form><br><br>
</div>
{% endifequal %}
{% ifequal CURRENT_PATH ALIAS_PATH %}
<div id="editalias">
<h2>Edit alias</h2>
<form action="{{ ALIAS_PATH }}" method="post" name="editalias">
<input type="hidden" name="datatype" value="alias">
<table>
<tr><td>name:</td><td><input type="text" name="name"{% if modify %} value="{{ modify.name|escape }}"{% endif %}></td></tr>
{% if modify %}<tr><td>old path:</td><td><input type="text" name="oldpath" value="{{ modify.path|escape }}" readonly></td></tr>{% endif %}
<tr><td>{% if modify %}new {% endif %}path:</td><td><input type="text" name="path"{% if modify %} value="{{ modify.path|escape }}"{% endif %}></td></tr>
<tr><td>public:</td><td><input type="checkbox" name="public"{% if modify %}{% if modify.public %} checked{% endif %}{% else %} checked{% endif %}></td></tr>
<tr><td>target path:</td><td><input type="text" name="aliastarget"{% if modify %} value="{{ modify.aliastarget|escape }}"{% endif %}></td></tr>
<tr><td>description:</td><td><input type="text" name="description"{% if modify %} value="{{ modify.description|escape }}"{% endif %}></td></tr>
<tr><td colspan="2"><input type="submit" value="{% if modify %}modify{% else %}add{% endif %}" onclick="return inputcheck(document.editalias);"></td></tr>
</table>
</form>
</div>
{% endifequal %}
{% ifequal CURRENT_PATH SETTING_PATH %}
<div id="setting">
<h2>Setting</h2>
<form action="{{ SETTING_PATH }}" method="post" name="setting">
<table>
<tr><td>UTC offset:</td><td><input type="text" name="utcoffset" size="5" value="{{ setting.utcoffset }}"></td></tr>
<tr><td colspan="2"><input type="submit" value="submit" onclick="return inputcheck(document.setting);"></td></tr>
</table>
</form><br><br>
</div>
{% endifequal %}
</div>
<div id="menu">
<p id="menucontentslist"{% ifequal CURRENT_PATH LIST_PATH %} class="active">List of contents{% else %} class="inactive"><a href="{{ LIST_PATH }}">List of contents</a>{% endifequal %}</p>
<p id="menueditcontent"{% ifequal CURRENT_PATH EDIT_PATH %} class="active">{% if modify %}<a href="{{ EDIT_PATH }}">Edit content</a>{% else %}Edit content{% endif %}{% else %} class="inactive"><a href="{{ EDIT_PATH }}">Edit content</a>{% endifequal %}</p>
<p id="menueditalias"{% ifequal CURRENT_PATH ALIAS_PATH %} class="active">{% if modify %}<a href="{{ ALIAS_PATH }}">Edit alias</a>{% else %}Edit alias{% endif %}{% else %} class="inactive"><a href="{{ ALIAS_PATH }}">Edit alias</a>{% endifequal %}</p>
<p id="menuuploadfile"{% ifequal CURRENT_PATH UPLOAD_PATH %} class="active">{% if modify %}<a href="{{ UPLOAD_PATH }}">Upload file</a>{% else %}Upload file{% endif %}{% else %} class="inactive"><a href="{{ UPLOAD_PATH }}">Upload file</a>{% endifequal %}</p>
<br>
<p id="menusetting"{% ifequal CURRENT_PATH SETTING_PATH %} class="active">Setting{% else %} class="inactive"><a href="{{ SETTING_PATH }}">Setting</a>{% endifequal %}</p>
</div>
<div id="footer" class="gradient2">
<div id="about"> <br><a href="http://code.google.com/appengine/"><img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" border="0"></a></div>
</div>
</div>
</body>
</html>