From 54ab3804a74d257e50943a4d7226e3ade8d2573e Mon Sep 17 00:00:00 2001 From: Bhanu Date: Fri, 11 Apr 2014 20:11:24 +0530 Subject: [PATCH] Added new model, for People --- mouchak/static/js/editor.js | 10 +++++++++ mouchak/static/js/models.js | 21 +++++++++++++++++-- mouchak/templates/editor.html | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/mouchak/static/js/editor.js b/mouchak/static/js/editor.js index 8649a23..7cf27c1 100644 --- 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(); diff --git a/mouchak/static/js/models.js b/mouchak/static/js/models.js index 0e5a0b8..5117ca2 100644 --- 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,10 +238,12 @@ '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); diff --git a/mouchak/templates/editor.html b/mouchak/templates/editor.html index b2b2bfc..6988a7a 100644 --- a/mouchak/templates/editor.html +++ b/mouchak/templates/editor.html @@ -282,6 +282,52 @@ +