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.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> |
36 |
<script src="{{url_for('static', filename='js/lib/ace/ace.js')}}"></script> |
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 |
|
51 |
<div class="form-group col-lg-6" id="menu-order-wrap"> |
52 |
<div class="input-group"> |
53 |
<span class="input-group-addon"> <strong> Menu Order</strong></span> |
54 |
<input class="form-control" id="menu-order" type="text" |
55 |
placeholder="list,page,names,for,menu,order" value="<%= menu_order %>"> |
56 |
</div> |
57 |
</div> |
58 |
|
59 |
<div class="form-group col-lg-6"> |
60 |
<input class="form-control" id="custom-menu" type="checkbox"> |
61 |
<span class=""><strong> Custom Menu </strong></span> |
62 |
</div> |
63 |
|
64 |
<div class="menu-options" style="display: none;"> |
65 |
<div class="form-group col-lg-6"> |
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 %>"> |
70 |
</div> |
71 |
</div> |
72 |
<label><strong> HTML for menu: </strong></label> |
73 |
<textarea cols="25" rows="8" id="menu"><%= menu %></textarea> |
74 |
</div> |
75 |
|
76 |
</div> |
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 %>"> |
113 |
</div> |
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 %>"> |
120 |
</div> |
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 %>"> |
127 |
</div> |
128 |
</div> |
129 |
<div class="form-group"> |
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> |
136 |
</div> |
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> ] |
156 |
</span> |
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> |
166 |
|
167 |
<script type="text/template" id="content-template"> |
168 |
<div class="contentview"> |
169 |
<form class="form-horizontal"> |
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> |
179 |
</div> |
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> |
187 |
</div> |
188 |
</div> |
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> |
196 |
</div> |
197 |
</div> |
198 |
</form> |
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> |
206 |
</div> |
207 |
</script> |
208 |
|
209 |
<script type="text/template" id="map-template"> |
210 |
<div class="data"> |
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> |
218 |
</div> |
219 |
</div> |
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> |
227 |
</div> |
228 |
</div> |
229 |
<div class="preview"></div> |
230 |
</div> |
231 |
</script> |
232 |
|
233 |
|
234 |
<script type="text/template" id="media-template"> |
235 |
<div class="data"> |
236 |
<div class="form-group col-lg-6"> |
237 |
<div class="input-group"> |
238 |
<span class="input-group-addon"><strong>path to file</strong></span> |
239 |
<input class="form-control" type="text" placeholder="src" value="<%= src %>" |
240 |
m-data-target="src"> |
241 |
</div> |
242 |
</div> |
243 |
<div class="preview"></div> |
244 |
</div> |
245 |
</script> |
246 |
|
247 |
<script type="text/template" id="text-template"> |
248 |
<div class="data"> |
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> |
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> |
289 |
|
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 %} |