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

Commit

Permalink
[#840]:Some changes made
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0chin committed Jun 8, 2017
1 parent 1e319ff commit efee3b0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 39 deletions.
21 changes: 20 additions & 1 deletion app/MyApp/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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('<div id="CourseCareerManage"></div>');
$('#CourseCareerManage').append('<div><h2>'+App.languageDict.attributes.Add_Multiple_Courses+'</h2></div>')
$('#CourseCareerManage').append(manageCouseCareer.el);
var directionOfLang = App.languageDict.get('directionOfLang');
applyCorrectStylingSheet(directionOfLang)

}

}))
Expand Down
22 changes: 2 additions & 20 deletions app/MyApp/app/views/AddCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}


});

},


Expand Down
2 changes: 2 additions & 0 deletions app/MyApp/app/views/ManageCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ $(function() {
App.Views.ManageCourseCareer = Backbone.View.extend({
template: $('#template-careerPathManage').html(),
vars: {},
events: {},

initialize: function() {

},

render: function() {
console.log(this.collection)

this.$el.html(_.template(this.template,this.vars))
},
})
Expand Down
25 changes: 7 additions & 18 deletions app/MyApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1477,40 +1477,29 @@ <h4 id="new-quiz"><%= languageDict.attributes.New_Career_Path %></h4>
</form>
</div>
<div>
<!-- <table class="btable btable-striped">
<th style="width: 430px"><%= languageDict.attributes.Course_Career %></th>
<th style="width: 430px"><%= languageDict.attributes.Level_Name %></th>
<table class="btable btable-striped">
<th style="width: 230px"><%= languageDict.attributes.Course_Career %></th>
<th style="width: 430px"><%= languageDict.attributes.Courses_List %></th>
<th><%= languageDict.attributes.Actions %><th>
<% for (var i=0; i < careerList.length; i++){%>
<tr>
<td><%= careerList[i].CoursePathName %></td>
<td><%= careerList[i].Level_Name %></td>
<td><%= careerList[i].CoursePathName %></td>
<td><ul><li><%= careerList[i].Courses %></li></ul></td>
<td><button class='course btn btn-success'><%=languageDict.attributes.EditLabel%></button></td>
<td><button class='destroy btn btn-danger' style="margin-right: 420px;"><%=languageDict.attributes.DeleteLabel%></button></td>
<td><button class='btn btn-info' id="ManageCareer" onclick = "document.location.href='#courseCareerPath/manage/<%= careerList[i].CoursePathName %>'" style="margin-left: -550px;"><%=languageDict.attributes.View_Details%></button></td>
</tr>
<% } %>
</table>-->
</table>

</div>

</script>

<script type="text/template" id="template-careerPathManage">
<hr/>
<h4 id="new-quiz"><%= languageDict.attributes.Add_Level %></h4>
<form>
Title<br/>
<input type = "text" name = "title"/><br/>
Description<br/><textarea></textarea><br/>
Level<br/>
<input type = "text" name = "title" disabled ="disabled"/><br/>
Courses<br/>
<select id="LCourse" name = "LCourse"><br/>
<option value=''></option>
</select>
</form>
<div id ="Manage">
</div>
</script>

<script type="text/html" id="template-courseLevelsTable">
Expand Down

0 comments on commit efee3b0

Please sign in to comment.