From efee3b0506aad726348eb7ea4f23fb4c36f9cac1 Mon Sep 17 00:00:00 2001 From: pr0chin Date: Thu, 8 Jun 2017 14:18:25 +0545 Subject: [PATCH] [#840]:Some changes made --- app/MyApp/app/Router.js | 21 ++++++++++++++++++- app/MyApp/app/views/AddCourseCareer.js | 22 ++------------------ app/MyApp/app/views/ManageCourseCareer.js | 2 ++ app/MyApp/index.html | 25 +++++++---------------- 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/app/MyApp/app/Router.js b/app/MyApp/app/Router.js index 089aa4166..9371e2257 100644 --- a/app/MyApp/app/Router.js +++ b/app/MyApp/app/Router.js @@ -98,7 +98,7 @@ $(function() { 'password-reset': 'showPasswordReset', 'courseCareerPath':'CourseCareerPath', 'courseCareerPath/add':'addCareerPath', - 'courseCareerPath/manage/:careernmae':'ManageCourseCareer' + 'courseCareerPath/manage/:careernmae':'manageCourseCareer' }, addOrUpdateWelcomeVideoDoc: function() { // fetch existing welcome video doc if there is any @@ -6769,6 +6769,25 @@ $(function() { var directionOfLang = App.languageDict.get('directionOfLang'); applyCorrectStylingSheet(directionOfLang) + }, + manageCourseCareer: function(cname){ + var courseCareerPath = new App.Collections.CourseCareerPath() + courseCareerPath.memberId = $.cookie('Member._id'); + courseCareerPath.CoursePathName =cname; + courseCareerPath.fetch({ + async:false + }); + console.log(courseCareerPath) + var manageCouseCareer = new App.Views.ManageCourseCareer({ + collection:courseCareerPath + }); + manageCouseCareer.render(); + App.$el.children('.body').html('
'); + $('#CourseCareerManage').append('

'+App.languageDict.attributes.Add_Multiple_Courses+'

') + $('#CourseCareerManage').append(manageCouseCareer.el); + var directionOfLang = App.languageDict.get('directionOfLang'); + applyCorrectStylingSheet(directionOfLang) + } })) diff --git a/app/MyApp/app/views/AddCourseCareer.js b/app/MyApp/app/views/AddCourseCareer.js index 528246729..511dfbd2e 100644 --- a/app/MyApp/app/views/AddCourseCareer.js +++ b/app/MyApp/app/views/AddCourseCareer.js @@ -31,28 +31,10 @@ $(function() { savecoursecareer.set('CourseIds',selectedCourseId); savecoursecareer.set('MemberID',$.cookie('Member._id')); savecoursecareer.save(null, { - success: function() { - var coursecareer = new App.Collections.CourseCareerPath() - coursecareer.memberId = $.cookie('Member._id'); - coursecareer.CoursePathName = courseCareerTitle - coursecareer.fetch({ - async:false - }); - console.log(coursecareer) - var manageCaoursecareer = new App.Views.ManageCourseCareer({ - collection:coursecareer - }); - manageCaoursecareer.render() - - $('#ManageCourseCareer').append(manageCaoursecareer.el) - Backbone.history.navigate('courseCareerPath/add', { - trigger: true - }) + error: function() { + console.log("Not Saved") } - - }); - }, diff --git a/app/MyApp/app/views/ManageCourseCareer.js b/app/MyApp/app/views/ManageCourseCareer.js index fc2b93c8f..0b1c928ca 100644 --- a/app/MyApp/app/views/ManageCourseCareer.js +++ b/app/MyApp/app/views/ManageCourseCareer.js @@ -3,6 +3,7 @@ $(function() { App.Views.ManageCourseCareer = Backbone.View.extend({ template: $('#template-careerPathManage').html(), vars: {}, + events: {}, initialize: function() { @@ -10,6 +11,7 @@ $(function() { render: function() { console.log(this.collection) + this.$el.html(_.template(this.template,this.vars)) }, }) diff --git a/app/MyApp/index.html b/app/MyApp/index.html index c535475cf..bb291ddea 100644 --- a/app/MyApp/index.html +++ b/app/MyApp/index.html @@ -1477,21 +1477,20 @@

<%= languageDict.attributes.New_Career_Path %>

- +
@@ -1499,18 +1498,8 @@

<%= languageDict.attributes.New_Career_Path %>