--- a/mouchak/static/js/editor.js +++ b/mouchak/static/js/editor.js @@ -391,6 +391,16 @@ shp: this.model.get('shp') })); } + + else if(type === 'people') { + var template = _.template($('#people-template').html()); + $('#specific-content').html(template({ + name: this.model.get('name'), + title: this.model.get('title'), + content: this.model.get('content') + // src: this.model.get('image') + })); + } }, typeChanged: function(event) { var type = this.$select.val(); --- a/mouchak/static/js/models.js +++ b/mouchak/static/js/models.js @@ -70,6 +70,21 @@ } }); +//Vijaynagara Hampi - Extending base type + + + var People = BaseType.extend({ + defaults: _.extend({ + name:"", + title:"", + content:"" + // image:"" + + }, BaseType.prototype.defaults), + initialize: function() { + BaseType.prototype.initialize.call(this, arguments); + } + }); // Plugin model can be used to load dynamic components // to the website by loading external JS files. // Also the website can be styled by using external CSS files, @@ -223,11 +238,13 @@ 'plugin': Plugin, 'map': Map, 'Page': Page, - 'Pages': Pages + 'Pages': Pages, + 'people': People + }; //content types to render in content menu - M.contentTypes = ['text', 'image', 'video', 'table', 'plugin', 'map']; + M.contentTypes = ['text', 'image', 'video', 'table', 'plugin', 'map', 'people']; })(M); --- a/mouchak/templates/editor.html +++ b/mouchak/templates/editor.html @@ -282,6 +282,52 @@ +