Commit 54ab3804a74d257e50943a4d7226e3ade8d2573e
- Diff rendering mode:
- inline
- side by side
mouchak/static/js/editor.js
(10 / 0)
  | |||
391 | 391 | shp: this.model.get('shp') | |
392 | 392 | })); | |
393 | 393 | } | |
394 | |||
395 | else if(type === 'people') { | ||
396 | var template = _.template($('#people-template').html()); | ||
397 | $('#specific-content').html(template({ | ||
398 | name: this.model.get('name'), | ||
399 | title: this.model.get('title'), | ||
400 | content: this.model.get('content') | ||
401 | // src: this.model.get('image') | ||
402 | })); | ||
403 | } | ||
394 | 404 | }, | |
395 | 405 | typeChanged: function(event) { | |
396 | 406 | var type = this.$select.val(); |
mouchak/static/js/models.js
(19 / 2)
  | |||
70 | 70 | } | |
71 | 71 | }); | |
72 | 72 | ||
73 | //Vijaynagara Hampi - Extending base type | ||
74 | |||
75 | |||
76 | var People = BaseType.extend({ | ||
77 | defaults: _.extend({ | ||
78 | name:"", | ||
79 | title:"", | ||
80 | content:"" | ||
81 | // image:"" | ||
82 | |||
83 | }, BaseType.prototype.defaults), | ||
84 | initialize: function() { | ||
85 | BaseType.prototype.initialize.call(this, arguments); | ||
86 | } | ||
87 | }); | ||
73 | 88 | // Plugin model can be used to load dynamic components | |
74 | 89 | // to the website by loading external JS files. | |
75 | 90 | // Also the website can be styled by using external CSS files, | |
… | … | ||
238 | 238 | 'plugin': Plugin, | |
239 | 239 | 'map': Map, | |
240 | 240 | 'Page': Page, | |
241 | 'Pages': Pages | ||
241 | 'Pages': Pages, | ||
242 | 'people': People | ||
243 | |||
242 | 244 | }; | |
243 | 245 | ||
244 | 246 | //content types to render in content menu | |
245 | M.contentTypes = ['text', 'image', 'video', 'table', 'plugin', 'map']; | ||
247 | M.contentTypes = ['text', 'image', 'video', 'table', 'plugin', 'map', 'people']; | ||
246 | 248 | ||
247 | 249 | })(M); |
mouchak/templates/editor.html
(46 / 0)
  | |||
282 | 282 | </div> | |
283 | 283 | </div> | |
284 | 284 | </script> | |
285 | <script type="text/template" id="people-template"> | ||
286 | <div class="contentview"> | ||
287 | <form class="form-horizontal"> | ||
288 | <div class="row"> | ||
289 | <div class="form-group col-lg-6"> | ||
290 | <label><b>Type</b></label> | ||
291 | <select class="form-control"> | ||
292 | <% _.each(M.contentTypes, function(type) { %> | ||
293 | <option><%= type %></option> | ||
294 | <% }); %> | ||
295 | </select> | ||
296 | </div> | ||
297 | </div> | ||
298 | <div class="row"> | ||
299 | <div class="form-group col-lg-6"> | ||
300 | <div class="input-group"> | ||
301 | <span class="input-group-addon"> <b>Name</b> </span> | ||
302 | <input class="form-control" type="text" placeholder="Name of the | ||
303 | Person" value="<%= | ||
304 | name %>" m-data-target="name"> | ||
305 | </div> | ||
306 | </div> | ||
307 | </div> | ||
308 | <div class="row"> | ||
309 | <div class="form-group col-lg-6"> | ||
310 | <div class="input-group"> | ||
311 | <span class="input-group-addon"> <strong>Title</strong> </span> | ||
312 | <input class="form-control" type="text" placeholder="Please | ||
313 | enter Title" | ||
314 | value="<%= title %>" m-data-target="title"> | ||
315 | </div> | ||
316 | </div> | ||
317 | </div> | ||
318 | <div class="row"> | ||
319 | <div class="form-group col-lg-6"> | ||
320 | <div class="input-group"> | ||
321 | <span class="input-group-addon"> <strong>Profile Image</strong> </span> | ||
322 | <input class="form-control" type="text" placeholder="Image URL" | ||
323 | value="<%= image %>" m-data-target="image"> | ||
324 | </div> | ||
325 | </div> | ||
326 | </div> | ||
327 | </form> | ||
328 | <div class="row"> | ||
329 | <div id="specific-content"></div> | ||
330 | </script> | ||
285 | 331 | ||
286 | 332 | <script type="text/template" id="map-template"> | |
287 | 333 | <div class="data"> |