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 |
|
505d72a by Anon Ray at 2013-10-06 |
51 |
<div class="form-group col-lg-6" id="menu-order-wrap"> |
2b4c217 by Anon Ray at 2013-10-03 |
52 |
<div class="input-group"> |
|
53 |
<span class="input-group-addon"> <strong> Menu Order</strong></span> |
505d72a by Anon Ray at 2013-10-06 |
54 |
<input class="form-control" id="menu-order" type="text" |
2b4c217 by Anon Ray at 2013-10-03 |
55 |
placeholder="list,page,names,for,menu,order" value="<%= menu_order %>"> |
66e3c71 by Anon Ray at 2013-08-30 |
56 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
57 |
</div> |
66e3c71 by Anon Ray at 2013-08-30 |
58 |
|
505d72a by Anon Ray at 2013-10-06 |
59 |
<div class="form-group col-lg-6"> |
2b4c217 by Anon Ray at 2013-10-03 |
60 |
<input class="form-control" id="custom-menu" type="checkbox"> |
|
61 |
<span class=""><strong> Custom Menu </strong></span> |
|
62 |
</div> |
66e3c71 by Anon Ray at 2013-08-30 |
63 |
|
2b4c217 by Anon Ray at 2013-10-03 |
64 |
<div class="menu-options" style="display: none;"> |
505d72a by Anon Ray at 2013-10-06 |
65 |
<div class="form-group col-lg-6"> |
2b4c217 by Anon Ray at 2013-10-03 |
66 |
<div class="input-group"> |
|
67 |
<span class="input-group-addon"> <strong> Position </strong></span> |
|
68 |
<input class="form-control" id="pos" type="text" placeholder="[left, top]" |
|
69 |
value="<%= pos %>"> |
63c7919 by Anon Ray at 2013-05-30 |
70 |
</div> |
3fd837c by Anon Ray at 2013-08-23 |
71 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
72 |
<label><strong> HTML for menu: </strong></label> |
|
73 |
<textarea cols="25" rows="8" id="menu"><%= menu %></textarea> |
63c7919 by Anon Ray at 2013-05-30 |
74 |
</div> |
|
75 |
|
4a1fae7 by Anon Ray at 2013-05-09 |
76 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
77 |
<button id="updateMenu" class="btn btn-primary pull-right"> Update </button> |
|
78 |
<div class="clearfix"></div> |
|
79 |
</div> |
|
80 |
</script> |
|
81 |
|
|
82 |
<script type="text/template" id="page-list-template"> |
|
83 |
<div id="pagelistview"> |
|
84 |
<h4> List of Pages </h4> |
|
85 |
<div id="pagelist"></div> |
|
86 |
<button class="btn btn-primary" id="addPage">Add Page</button> |
|
87 |
<hr> |
|
88 |
<p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p> |
|
89 |
<p><a href="{{ url_for('index') }}"> Go to site </a></p> |
|
90 |
</div> |
|
91 |
</script> |
|
92 |
|
|
93 |
<script type="text/template" id="page-list-item-template"> |
|
94 |
<div class="pagename"> |
|
95 |
<a class="disp" id="<%= id %>" href="javascript:void(0);"><%= name %></a> |
|
96 |
<span class="pull-right"> |
|
97 |
<a href="javascript:void(0);" class="remove" for="<%= id %>"> |
|
98 |
<span class="glyphicon glyphicon-trash"></span> |
|
99 |
</a> |
|
100 |
</span> |
|
101 |
<span class="clearfix"></span> |
|
102 |
</div> |
|
103 |
</script> |
|
104 |
|
|
105 |
<script type="text/template" id="page-template"> |
|
106 |
<div class="page"> |
|
107 |
<h4> Page Details </h4> |
|
108 |
<form class="form-horizontal"> |
|
109 |
<div class="form-group"> |
|
110 |
<div class="input-group"> |
|
111 |
<span class="input-group-addon"> <strong> Name </strong></span> |
|
112 |
<input class="form-control" id="name" type="text" placeholder="name of the page" value="<%= name %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
113 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
114 |
</div> |
|
115 |
<div class="form-group"> |
|
116 |
<div class="input-group"> |
|
117 |
<span class="input-group-addon"> <strong>Title</strong> </span> |
|
118 |
<input class="form-control" id="title" type="text" placeholder="title of the page" |
|
119 |
value="<%= title %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
120 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
121 |
</div> |
|
122 |
<div class="form-group"> |
|
123 |
<div class="input-group"> |
|
124 |
<span class="input-group-addon"> <strong>Children</strong> </span> |
|
125 |
<input class="form-control" id="children" type="text" placeholder="csv of child pages" |
|
126 |
value="<%= children %>"> |
4a1fae7 by Anon Ray at 2013-05-09 |
127 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
128 |
</div> |
|
129 |
<div class="form-group"> |
505d72a by Anon Ray at 2013-10-06 |
130 |
<div class="input-group"> |
|
131 |
<span class="input-group-addon"> |
|
132 |
<input id="showNav" type="checkbox" <%= checked %> > |
|
133 |
</span> |
|
134 |
<input class="form-control" type="text" value="Show Navigation" |
|
135 |
disabled> |
4a1fae7 by Anon Ray at 2013-05-09 |
136 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
137 |
</div> |
|
138 |
<label><strong> Content </strong></label> |
|
139 |
<div id="content" class="content well"> |
|
140 |
<%= content %> |
|
141 |
<p></p> |
|
142 |
<button class="addContent btn btn-sm btn-primary">Add Content</button> |
|
143 |
</div> |
|
144 |
<button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button> |
|
145 |
<div class="clearfix"></div> |
|
146 |
</form> |
|
147 |
</div> |
|
148 |
</script> |
|
149 |
|
|
150 |
<script type="text/template" id="content-list-template"> |
|
151 |
<div class="content-item-wrapper"> |
|
152 |
<span class="content-item" id="content-<%= no %>"> |
|
153 |
<span class="label label-default"> <%= type %> </span> |
|
154 |
<span class="content-snippet"> |
|
155 |
[ <small> <%= title %> <%= more %> </small> ] |
4a1fae7 by Anon Ray at 2013-05-09 |
156 |
</span> |
2b4c217 by Anon Ray at 2013-10-03 |
157 |
</span> |
|
158 |
<span class="pull-right"> |
|
159 |
<a href="javascript:void(0);" class="remove" for="<%=no%>"> |
|
160 |
<span class="glyphicon glyphicon-trash"></span> |
|
161 |
</a> |
|
162 |
</span> |
|
163 |
<span class="clearfix"></span> |
|
164 |
</div> |
|
165 |
</script> |
4a1fae7 by Anon Ray at 2013-05-09 |
166 |
|
2b4c217 by Anon Ray at 2013-10-03 |
167 |
<script type="text/template" id="content-template"> |
|
168 |
<div class="contentview"> |
|
169 |
<form class="form-horizontal"> |
505d72a by Anon Ray at 2013-10-06 |
170 |
<div class="row"> |
|
171 |
<div class="form-group col-lg-6"> |
|
172 |
<label><b>Type</b></label> |
|
173 |
<select class="form-control"> |
|
174 |
<% _.each(M.contentTypes, function(type) { %> |
|
175 |
<option><%= type %></option> |
|
176 |
<% }); %> |
|
177 |
</select> |
|
178 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
179 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
180 |
<div class="row"> |
|
181 |
<div class="form-group col-lg-6"> |
|
182 |
<div class="input-group"> |
|
183 |
<span class="input-group-addon"> <b>Title</b> </span> |
|
184 |
<input class="form-control" type="text" placeholder="title of the content" value="<%= |
|
185 |
title %>" m-data-target="title"> |
|
186 |
</div> |
748ffb6 by Arvind at 2013-09-30 |
187 |
</div> |
|
188 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
189 |
<div class="row"> |
|
190 |
<div class="form-group col-lg-6"> |
|
191 |
<div class="input-group"> |
|
192 |
<span class="input-group-addon"> <strong>Tags</strong> </span> |
|
193 |
<input class="form-control" type="text" placeholder="csv of tags for this content" |
|
194 |
value="<%= tags %>" m-data-target="tags"> |
|
195 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
196 |
</div> |
|
197 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
198 |
</form> |
505d72a by Anon Ray at 2013-10-06 |
199 |
<div class="row"> |
|
200 |
<div id="specific-content"></div> |
|
201 |
</div> |
|
202 |
<div class="row"> |
|
203 |
<button class="btn btn-info" id="done">Done</button> |
|
204 |
<button class="btn btn-primary" id="updateContent">Update</button> |
|
205 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
206 |
</div> |
|
207 |
</script> |
|
208 |
|
|
209 |
<script type="text/template" id="map-template"> |
|
210 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
211 |
<div class="row"> |
|
212 |
<div class="form-group col-lg-6"> |
|
213 |
<div class="input-group"> |
|
214 |
<span class="input-group-addon"><strong>Tile Provider URL</strong></span> |
|
215 |
<input class="form-control" type="text" placeholder="http://{s}.tile.cloudmade.com/<API_KEY>/997/256/{z}/{x}/{y}.png" value="<%= tileLayer %>" |
|
216 |
m-data-target="tileLayer"> |
|
217 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
218 |
</div> |
4a1fae7 by Anon Ray at 2013-05-09 |
219 |
</div> |
505d72a by Anon Ray at 2013-10-06 |
220 |
<div class="row"> |
|
221 |
<div class="form-group col-lg-6"> |
|
222 |
<div class="input-group"> |
|
223 |
<span class="input-group-addon"><strong>Shapefile</strong></span> |
|
224 |
<input class="form-control" type="text" placeholder="" value="<%= shp %>" |
|
225 |
m-data-target="shp"> |
|
226 |
</div> |
8c2ed2e by Arvind at 2013-10-04 |
227 |
</div> |
|
228 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
229 |
<div class="preview"></div> |
|
230 |
</div> |
|
231 |
</script> |
aeb1feb by Anon Ray at 2013-08-23 |
232 |
|
|
233 |
|
2b4c217 by Anon Ray at 2013-10-03 |
234 |
<script type="text/template" id="media-template"> |
|
235 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
236 |
<div class="form-group col-lg-6"> |
2b4c217 by Anon Ray at 2013-10-03 |
237 |
<div class="input-group"> |
|
238 |
<span class="input-group-addon"><strong>path to file</strong></span> |
505d72a by Anon Ray at 2013-10-06 |
239 |
<input class="form-control" type="text" placeholder="src" value="<%= src %>" |
2b4c217 by Anon Ray at 2013-10-03 |
240 |
m-data-target="src"> |
|
241 |
</div> |
aeb1feb by Anon Ray at 2013-08-23 |
242 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
243 |
<div class="preview"></div> |
|
244 |
</div> |
|
245 |
</script> |
|
246 |
|
|
247 |
<script type="text/template" id="text-template"> |
|
248 |
<div class="data"> |
505d72a by Anon Ray at 2013-10-06 |
249 |
<div class="edit-type-wrap"> |
|
250 |
<div class="row"> |
|
251 |
<b> Content </b> |
|
252 |
</div> |
|
253 |
<div class="row"> |
|
254 |
<div class="col-lg-4"> |
|
255 |
<!-- code vs wysiwyg switch --> |
|
256 |
<div class="btn-group" id="edit-type"> |
|
257 |
<button type="button" class="btn btn-default" value="wysiwyg">WYSIWYG</button> |
|
258 |
<button type="button" class="btn btn-default" value="code">Code</button> |
|
259 |
</div> |
|
260 |
<p class="help-block"> |
|
261 |
<span class="label label-info">Heads Up!</span> |
|
262 |
<span><small><b> Switch editing mode </b></small></span> |
|
263 |
</p> |
|
264 |
</div> |
|
265 |
</div> |
|
266 |
</div> |
|
267 |
<div class="row"> |
|
268 |
<% if(wysiwyg === true) { %> |
|
269 |
<textarea id="edit" m-data-target="data"> |
|
270 |
<%= data %> |
|
271 |
</textarea> |
|
272 |
<% } else { %> |
|
273 |
<div id="code-edit" m-data-target="data"> |
|
274 |
<%= M.escapeHtml(data) %> |
|
275 |
</div> |
|
276 |
<% } %> |
|
277 |
</div> |
2b4c217 by Anon Ray at 2013-10-03 |
278 |
</div> |
|
279 |
</script> |
|
280 |
|
|
281 |
<!-- notification templates --> |
|
282 |
<script type="text/template" id="success-notif"> |
|
283 |
<div class="alert alert-success"> |
|
284 |
<button type="button" class="close" data-dismiss="alert">×</button> |
|
285 |
<h4> <%= title %> </h4> |
|
286 |
<%= msg %> |
|
287 |
</div> |
|
288 |
</script> |
aeb1feb by Anon Ray at 2013-08-23 |
289 |
|
2b4c217 by Anon Ray at 2013-10-03 |
290 |
<script type="text/template" id="fail-notif"> |
|
291 |
<div class="alert alert-danger"> |
|
292 |
<button type="button" class="close" data-dismiss="alert">×</button> |
|
293 |
<h4> <%= title %> </h4> |
|
294 |
<%= msg %> |
|
295 |
</div> |
|
296 |
</script> |
|
297 |
{% endblock %} |