Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Commit

Permalink
[#840]:list of courseCareer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupesh87 committed Jun 5, 2017
1 parent 3e23999 commit 472c573
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function() {
App.Collections.CourseCareerPath = Backbone.Collection.extend({

url: function() {
if (this.CoursePathName != "" && this.MemberID != "") {
if (this.CoursePathName!= undefined && this.MemberID!= undefined ) {
return App.Server + '/coursecareerpath/_design/bell/_view/GetCourseCareerByLevelNameMemberIds/?key=["' +this.CoursePathName + '","' +this.MemberID+ '"]&include_docs=true'
} else {
return App.Server + '/coursecareerpath/_all_docs?include_docs=true'
Expand All @@ -21,9 +21,8 @@ $(function() {
comparator: function(model) {
var type = model.get('Type')
if (type) return type.toLowerCase()
},

model: App.Models.CourseacreerPath
}
})

})

9 changes: 9 additions & 0 deletions app/MyApp/app/views/AddCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ $(function() {
arrcourses.push(courseslist)
arrCourseIds.push(courseId)
}
var courseCareers = new App.Collections.CourseCareerPath()
courseCareers.memberId = $.cookie('Member._id');
courseCareers.fetch({
async:false
});
this.vars.careerList = [];
for(var i = 0; i < (courseCareers.length -1 ); i++) {
this.vars.careerList.push(courseCareers.models[i].attributes);
}
this.vars.Courselist = arrcourses
this.vars.Courseid = arrCourseIds
this.vars.Course_Length = this.collection.models.length-1
Expand Down
7 changes: 7 additions & 0 deletions app/MyApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,13 @@ <h4 id="new-quiz"><%= languageDict.attributes.New_Career_Path %></h4>
<th style="width: 430px">Course Career</th>
<th style="width: 430px">Courses List</th>
<th>Action<th>
<% for (var i=0; i < careerList.length; i++){%>
<tr>
<td><%= careerList[i].CoursePathName %></td>Courses
<td><%= careerList[i].Courses %></td>
<td><button class='destroy btn btn-danger'><%=languageDict.attributes.DeleteLabel%></button></td>
</tr>
<% } %>
</table>
</div>

Expand Down

0 comments on commit 472c573

Please sign in to comment.