2b4c217 by Anon Ray at 2013-10-03 |
1 |
{% extends "base.html" %} |
|
2 |
|
|
3 |
{% block head %} |
|
4 |
<link rel="stylesheet" href="{{url_for('static', filename='css/editor.css')}}"> |
|
5 |
<title> Editing.. | {{ title }} </title> |
|
6 |
{% endblock %} |
|
7 |
|
|
8 |
{% block body %} |
|
9 |
<div class="container" id="container"> |
|
10 |
<div id="header"> |
|
11 |
<div id="hud"> |
|
12 |
<span class="pull-right">Howdy! | <a href="{{ url_for('logout') }}">Logout</a></span> |
4a1fae7 by Anon Ray at 2013-05-09 |
13 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
14 |
<div id="notifications"></div> |
4a1fae7 by Anon Ray at 2013-05-09 |
15 |
</div> |
77b14a4 by Anon Ray at 2013-10-06 |
16 |
<div id="content-container"></div> |
|
17 |
<div id="footer"></div> |
2b4c217 by Anon Ray at 2013-10-03 |
18 |
</div> |
77b14a4 by Anon Ray at 2013-10-06 |
19 |
<div id="editor-overlay"></div> |
2b4c217 by Anon Ray at 2013-10-03 |
20 |
|
|
21 |
<script> |
|
22 |
// initialize editor |
|
23 |
window.M = window.M || {}; |
|
24 |
M.MenuURL = function() { return "{{ url_for('insertMenu') }}"}; |
|
25 |
M.PageURL = function() { return "{{ url_for('insertPage') }}"}; |
|
26 |
M.site_content = {{ content|tojson|safe }}; |
|
27 |
window.onload = function() { |
|
28 |
M.editor.init(); |
|
29 |
}; |
|
30 |
</script> |
|
31 |
{% endblock %} |
|
32 |
|
|
33 |
{% block scripts %} |
|
34 |
<script src="{{url_for('static', filename='js/lib/tinymce/tinymce.min.js')}}"></script> |
|
35 |
<script src="{{url_for('static', filename='js/lib/tinymce/jquery.tinymce.min.js')}}"></script> |
505d72a by Anon Ray at 2013-10-06 |
36 |
<script src="{{url_for('static', filename='js/lib/ace/ace.js')}}"></script> |
2b4c217 by Anon Ray at 2013-10-03 |
37 |
<script src="{{url_for('static', filename='js/mouchak.js')}}"></script> |
|
38 |
<script src="{{url_for('static', filename='js/models.js')}}"></script> |
|
39 |
<script src="{{url_for('static', filename='js/views.js')}}"></script> |
|
40 |
<script src="{{url_for('static', filename='js/editor.js')}}"></script> |
|
41 |
{% endblock %} |
|
42 |
|
|
43 |
{% block templates %} |
|
44 |
|
|
45 |
<!-- Underscore templates --> |
|
46 |
<script type="text/template" id="menu-config-template"> |
|
47 |
<div class="page"> |
|
48 |
<div class="menu-config"> |
|
49 |
<h4> Menu Config </h4> |
|
50 |
|
e5d3482 by Anon Ray at 2013-10-06 |
51 |
<div class="row"> |
|
52 |
<div class="form-group col-lg-12" id="menu-order-wrap"> |
|
53 |
<div class="input-group"> |
|
54 |
<span class="input-group-addon"> <strong> Menu Order</strong></span> |
|
55 |
<input class="form-control" id="menu-order" type="text" |
|
56 |
placeholder="list,page,slugs,for,menu,order" value="<%= menu_order %>"> |
|
57 |
</div> |
|
58 |
<span class="help-block"> |
|
59 |
<small>csv list of page slugs to come up in the navigation menu |
|
60 |
in that order |
|
61 |
</small> |
|
62 |
</span> |
66e3c71 by Anon Ray at 2013-08-30 |
63 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
64 |
</div> |
66e3c71 by Anon Ray at 2013-08-30 |
65 |
|
e5d3482 by Anon Ray at 2013-10-06 |
66 |
<div class="row"> |
|
67 |
<div class="form-group col-lg-6"> |
|
68 |
<div class="input-group"> |
|
69 |
<span class="input-group-addon"> |
|
70 |
<input id="custom-menu" type="checkbox"> |
|
71 |
</span> |
|
72 |
<span class="input-group-addon"><strong>Custom Menu |
|
73 |
</strong></span> |
|
74 |
</div> |
|
75 |
<span class="help-block"> |
|
76 |
<small> |
|
77 |
activate to write your own custom menu |
|
78 |
</small> |
|
79 |
</span> |
|
80 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
81 |
</div> |
66e3c71 by Anon Ray at 2013-08-30 |
82 |
|
2b4c217 by Anon Ray at 2013-10-03 |
83 |
<div class="menu-options" style="display: none;"> |
e5d3482 by Anon Ray at 2013-10-06 |
84 |
<div class="row"> |
|
85 |
<div class="form-group col-lg-6"> |
|
86 |
<div class="input-group"> |
|
87 |
<span class="input-group-addon"> <strong> Position </strong></span> |
|
88 |
<input class="form-control" id="pos" type="text" placeholder="[left, top]" |
|
89 |
value="<%= pos %>"> |
|
90 |
</div> |
63c7919 by Anon Ray at 2013-05-30 |
91 |
</div> |
3fd837c by Anon Ray at 2013-08-23 |
92 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
93 |
<div class="row"> |
|
94 |
<label><strong> HTML for menu: </strong></label> |
|
95 |
<textarea class="form-control" cols="25" rows="8" id="menu"><%= menu %></textarea> |
|
96 |
</div> |
63c7919 by Anon Ray at 2013-05-30 |
97 |
</div> |
|
98 |
|
4a1fae7 by Anon Ray at 2013-05-09 |
99 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
100 |
<div class="clearfix"></div> |
|
101 |
<div class="row"> |
|
102 |
<button id="updateMenu" class="btn btn-primary pull-right"> Update </button> |
|
103 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
104 |
<div class="clearfix"></div> |
|
105 |
</div> |
|
106 |
</script> |
|
107 |
|
|
108 |
<script type="text/template" id="page-list-template"> |
|
109 |
<div id="pagelistview"> |
|
110 |
<h4> List of Pages </h4> |
|
111 |
<div id="pagelist"></div> |
|
112 |
<button class="btn btn-primary" id="addPage">Add Page</button> |
|
113 |
<hr> |
|
114 |
<p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p> |
|
115 |
<p><a href="{{ url_for('index') }}"> Go to site </a></p> |
|
116 |
</div> |
|
117 |
</script> |
|
118 |
|
|
119 |
<script type="text/template" id="page-list-item-template"> |
|
120 |
<div class="pagename"> |
|
121 |
<a class="disp" id="<%= id %>" href="javascript:void(0);"><%= name %></a> |
|
122 |
<span class="pull-right"> |
|
123 |
<a href="javascript:void(0);" class="remove" for="<%= id %>"> |
|
124 |
<span class="glyphicon glyphicon-trash"></span> |
|
125 |
</a> |
|
126 |
</span> |
|
127 |
<span class="clearfix"></span> |
|
128 |
</div> |
|
129 |
</script> |
|
130 |
|
|
131 |
<script type="text/template" id="page-template"> |
|
132 |
<div class="page"> |
bf40f62 by Anon Ray at 2013-10-06 |
133 |
<div class="row"> |
aaba218 by Anon Ray at 2013-10-06 |
134 |
<h4> <strong><%= name %></strong> : Page Details </h4> |
bf40f62 by Anon Ray at 2013-10-06 |
135 |
</div> |
|
136 |
<hr/> |
2b4c217 by Anon Ray at 2013-10-03 |
137 |
<form class="form-horizontal"> |
|
138 |
<div class="form-group"> |
|
139 |
<div class="input-group"> |
e5d3482 by Anon Ray at 2013-10-06 |
140 |
<span class="input-group-addon"> <strong> Slug </strong></span> |
|
141 |
<input class="form-control" id="name" type="text" |
|
142 |
placeholder="slug of the page" value="<%= name %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
143 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
144 |
<span class="help-block"> |
|
145 |
<small>The URL part of the page, as it will appear in the URL</small> |
|
146 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
147 |
</div> |
|
148 |
<div class="form-group"> |
bf40f62 by Anon Ray at 2013-10-06 |
149 |
<strong> Content </strong> |
|
150 |
<div id="content" class="content well"> |
|
151 |
<%= content %> |
|
152 |
<p></p> |
|
153 |
<button class="addContent btn btn-sm btn-primary">Add Content</button> |
|
154 |
</div> |
|
155 |
</div> |
|
156 |
<div class="form-group"> |
2b4c217 by Anon Ray at 2013-10-03 |
157 |
<div class="input-group"> |
|
158 |
<span class="input-group-addon"> <strong>Title</strong> </span> |
|
159 |
<input class="form-control" id="title" type="text" placeholder="title of the page" |
|
160 |
value="<%= title %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
161 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
162 |
<span class="help-block"> |
|
163 |
<small>title of the page</small> |
|
164 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
165 |
</div> |
|
166 |
<div class="form-group"> |
|
167 |
<div class="input-group"> |
|
168 |
<span class="input-group-addon"> <strong>Children</strong> </span> |
|
169 |
<input class="form-control" id="children" type="text" placeholder="csv of child pages" |
|
170 |
value="<%= children %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
171 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
172 |
<span class="help-block"> |
|
173 |
<small> leave this blank for now</small> |
|
174 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
175 |
</div> |
|
176 |
<div class="form-group"> |
505d72a by Anon Ray at 2013-10-06 |
177 |
<div class="input-group"> |
|
178 |
<span class="input-group-addon"> |
|
179 |
<input id="showNav" type="checkbox" <%= checked %> > |
|
180 |
</span> |
e5d3482 by Anon Ray at 2013-10-06 |
181 |
<input class="form-control" type="text" value="Show Navigation" disabled> |
4a1fae7 by Anon Ray at 2013-05-09 |
182 |
</div> |
e5d3482 by Anon Ray at 2013-10-06 |
183 |
<span class="help-block"> |
|
184 |
<small>Show navigation menu in this page? </small> |
|
185 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
186 |
</div> |
|
187 |
<button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button> |
|
188 |
<div class="clearfix"></div> |
|
189 |
</form> |
|
190 |
</div> |
|
191 |
</script> |
|
192 |
|
|
193 |
<script type="text/template" id="content-list-template"> |
|
194 |
<div class="content-item-wrapper"> |
|
195 |
<span class="content-item" id="content-<%= no %>"> |
|
196 |
<span class="label label-default"> <%= type %> </span> |
|
197 |
<span class="content-snippet"> |
|
198 |
[ <small> <%= title %> <%= more %> </small> ] |
4a1fae7 by Anon Ray at 2013-05-09 |
199 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
200 |
</span> |
|
201 |
<span class="pull-right"> |
|
202 |
<a href="javascript:void(0);" class="remove" for="<%=no%>"> |
|
203 |
<span class="glyphicon glyphicon-trash"></span> |
|
204 |
</a> |
|
205 |
</span> |
|
206 |
<span class="clearfix"></span> |
|
207 |
</div> |
|
208 |
</script> |
4a1fae7 by Anon Ray at 2013-05-09 |
209 |
|
2b4c217 by Anon Ray at 2013-10-03 |
210 |
<script type="text/template" id="content-template"> |
|
211 |
<div class="contentview"> |
|
212 |
<form class="form-horizontal"> |
505d72a by Anon Ray at 2013-10-06 |
213 |
<div class="row"> |
|
214 |
<div class="form-group col-lg-6"> |
|
215 |
<label><b>Type</b></label> |
|
216 |
<select class="form-control"> |
|
217 |
<% _.each(M.contentTypes, function(type) { %> |
|
218 |
<option><%= type %></option> |
|
219 |
<% }); %> |
|
220 |
</select> |
|
221 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
222 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
223 |
<div class="row"> |
|
224 |
<div class="form-group col-lg-6"> |
|
225 |
<div class="input-group"> |
|
226 |
<span class="input-group-addon"> <b>Title</b> </span> |
|
227 |
<input class="form-control" type="text" placeholder="title of the content" value="<%= |
|
228 |
title %>" m-data-target="title"> |
|
229 |
</div> |
748ffb6 by Arvind at 2013-09-30 |
230 |
</div> |
|
231 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
232 |
<div class="row"> |
|
233 |
<div class="form-group col-lg-6"> |
|
234 |
<div class="input-group"> |
|
235 |
<span class="input-group-addon"> <strong>Tags</strong> </span> |
|
236 |
<input class="form-control" type="text" placeholder="csv of tags for this content" |
|
237 |
value="<%= tags %>" m-data-target="tags"> |
|
238 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
239 |
</div> |
|
240 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
241 |
</form> |
505d72a by Anon Ray at 2013-10-06 |
242 |
<div class="row"> |
|
243 |
<div id="specific-content"></div> |
|
244 |
</div> |
|
245 |
<div class="row"> |
bf40f62 by Anon Ray at 2013-10-06 |
246 |
<button class="btn btn-primary" id="done">Done</button> |
|
247 |
<button class="btn btn-default" id="back">Back</button> |
|
248 |
<!--button class="btn btn-primary" id="updateContent">Update</button--> |
505d72a by Anon Ray at 2013-10-06 |
249 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
250 |
</div> |
|
251 |
</script> |
|
252 |
|
|
253 |
<script type="text/template" id="map-template"> |
|
254 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
255 |
<div class="row"> |
|
256 |
<div class="form-group col-lg-6"> |
|
257 |
<div class="input-group"> |
|
258 |
<span class="input-group-addon"><strong>Tile Provider URL</strong></span> |
|
259 |
<input class="form-control" type="text" placeholder="http://{s}.tile.cloudmade.com/<API_KEY>/997/256/{z}/{x}/{y}.png" value="<%= tileLayer %>" |
|
260 |
m-data-target="tileLayer"> |
|
261 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
262 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
263 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
264 |
<div class="row"> |
|
265 |
<div class="form-group col-lg-6"> |
|
266 |
<div class="input-group"> |
|
267 |
<span class="input-group-addon"><strong>Shapefile</strong></span> |
|
268 |
<input class="form-control" type="text" placeholder="" value="<%= shp %>" |
|
269 |
m-data-target="shp"> |
|
270 |
</div> |
8c2ed2e by Arvind at 2013-10-04 |
271 |
</div> |
|
272 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
273 |
<div class="preview"></div> |
|
274 |
</div> |
|
275 |
</script> |
aeb1feb by Anon Ray at 2013-08-23 |
276 |
|
|
277 |
|
2b4c217 by Anon Ray at 2013-10-03 |
278 |
<script type="text/template" id="media-template"> |
|
279 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
280 |
<div class="form-group col-lg-6"> |
2b4c217 by Anon Ray at 2013-10-03 |
281 |
<div class="input-group"> |
|
282 |
<span class="input-group-addon"><strong>path to file</strong></span> |
505d72a by Anon Ray at 2013-10-06 |
283 |
<input class="form-control" type="text" placeholder="src" value="<%= src %>" |
2b4c217 by Anon Ray at 2013-10-03 |
284 |
m-data-target="src"> |
|
285 |
</div> |
aeb1feb by Anon Ray at 2013-08-23 |
286 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
287 |
<div class="preview"></div> |
|
288 |
</div> |
|
289 |
</script> |
|
290 |
|
4f0c87d by Anon Ray at 2013-10-06 |
291 |
<script type="text/template" id="plugin-template"> |
|
292 |
<div class="data"> |
|
293 |
<div class="row"> |
|
294 |
<div class="form-group col-lg-6"> |
|
295 |
<div class="input-group"> |
|
296 |
<span class="input-group-addon"><strong>path to file</strong></span> |
|
297 |
<input class="form-control" type="text" placeholder="src" value="<%= src %>" |
|
298 |
m-data-target="src"> |
|
299 |
</div> |
|
300 |
</div> |
|
301 |
</div> |
|
302 |
<div class="row"> |
|
303 |
<div class="form-group col-lg-6"> |
|
304 |
<div class="input-group"> |
|
305 |
<span class="input-group-addon"><strong>callback</strong></span> |
|
306 |
<input class="form-control" type="text" placeholder= |
|
307 |
"callback function for js plugin" value="<%= callback %>" |
|
308 |
m-data-target="callback"> |
|
309 |
</div> |
|
310 |
</div> |
|
311 |
</div> |
|
312 |
<div class="preview"></div> |
|
313 |
</div> |
|
314 |
</script> |
|
315 |
|
2b4c217 by Anon Ray at 2013-10-03 |
316 |
<script type="text/template" id="text-template"> |
|
317 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
318 |
<div class="edit-type-wrap"> |
|
319 |
<div class="row"> |
|
320 |
<b> Content </b> |
|
321 |
</div> |
|
322 |
<div class="row"> |
|
323 |
<div class="col-lg-4"> |
|
324 |
<!-- code vs wysiwyg switch --> |
|
325 |
<div class="btn-group" id="edit-type"> |
|
326 |
<button type="button" class="btn btn-default" value="wysiwyg">WYSIWYG</button> |
|
327 |
<button type="button" class="btn btn-default" value="code">Code</button> |
|
328 |
</div> |
|
329 |
<p class="help-block"> |
|
330 |
<span class="label label-info">Heads Up!</span> |
|
331 |
<span><small><b> Switch editing mode </b></small></span> |
|
332 |
</p> |
|
333 |
</div> |
|
334 |
</div> |
|
335 |
</div> |
|
336 |
<div class="row"> |
|
337 |
<% if(wysiwyg === true) { %> |
|
338 |
<textarea id="edit" m-data-target="data"> |
|
339 |
<%= data %> |
|
340 |
</textarea> |
|
341 |
<% } else { %> |
|
342 |
<div id="code-edit" m-data-target="data"> |
|
343 |
<%= M.escapeHtml(data) %> |
|
344 |
</div> |
|
345 |
<% } %> |
|
346 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
347 |
</div> |
|
348 |
</script> |
|
349 |
|
|
350 |
<!-- notification templates --> |
|
351 |
<script type="text/template" id="success-notif"> |
|
352 |
<div class="alert alert-success"> |
|
353 |
<button type="button" class="close" data-dismiss="alert">×</button> |
|
354 |
<h4> <%= title %> </h4> |
|
355 |
<%= msg %> |
|
356 |
</div> |
|
357 |
</script> |
aeb1feb by Anon Ray at 2013-08-23 |
358 |
|
2b4c217 by Anon Ray at 2013-10-03 |
359 |
<script type="text/template" id="fail-notif"> |
|
360 |
<div class="alert alert-danger"> |
|
361 |
<button type="button" class="close" data-dismiss="alert">×</button> |
|
362 |
<h4> <%= title %> </h4> |
|
363 |
<%= msg %> |
|
364 |
</div> |
|
365 |
</script> |
|
366 |
{% endblock %} |