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