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