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

Commit

Permalink
[#840]:Setting new concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0chin committed Jun 6, 2017
1 parent 72f41a5 commit 1e319ff
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 21 deletions.
4 changes: 3 additions & 1 deletion app/MyApp/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ $(function() {
'passwordResetEmail': 'showPasswordResetEmail',
'password-reset': 'showPasswordReset',
'courseCareerPath':'CourseCareerPath',
'courseCareerPath/add':'addCareerPath'
'courseCareerPath/add':'addCareerPath',
'courseCareerPath/manage/:careernmae':'ManageCourseCareer'
},
addOrUpdateWelcomeVideoDoc: function() {
// fetch existing welcome video doc if there is any
Expand Down Expand Up @@ -6769,5 +6770,6 @@ $(function() {
applyCorrectStylingSheet(directionOfLang)

}

}))
})
30 changes: 22 additions & 8 deletions app/MyApp/app/views/AddCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ $(function() {
"click #AddCareerPath": function() {
this.saveCareerPath();
},
"click #CancelCOursePath": function(e) {
this.saveCareerPath();
"click #CancelCoursePath": function(e) {
},
},

Expand All @@ -25,23 +24,38 @@ $(function() {
selectedCourseName.push($(this).text());
}
});
console.log(selectedCourseId, selectedCourseName)
var levelname = $('#levelSelect').val()
var courseCareerTitle = $('#careerPath').val()
var savecoursecareer = new App.Models.CoursecareerPath()
savecoursecareer.set('Level_Name',levelname);
savecoursecareer.set('CoursePathName',courseCareerTitle);
savecoursecareer.set('Courses',selectedCourseName);
savecoursecareer.set('CourseIds',selectedCourseId);
savecoursecareer.set('MemberID',$.cookie('Member._id'));
savecoursecareer.save(null, {
error: function() {
console.log("Not Saved")
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
})
}


});
//location.reload();

},


render: function() {
var arrcourses = []
var arrCourseIds = []
Expand Down
17 changes: 17 additions & 0 deletions app/MyApp/app/views/ManageCourseCareer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$(function() {

App.Views.ManageCourseCareer = Backbone.View.extend({
template: $('#template-careerPathManage').html(),
vars: {},

initialize: function() {

},

render: function() {
console.log(this.collection)
this.$el.html(_.template(this.template,this.vars))
},
})

})
37 changes: 25 additions & 12 deletions app/MyApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@

<script src="app/views/AnswerReview.js"></script> <!-- app/views.js -->
<script src="app/views/PasswordReset.js"></script> <!-- app/views.js -->
<script src="app/views/ManageCourseCareer.js"></script> <!-- app/views.js -->


<!-- javaScript -->
Expand Down Expand Up @@ -1456,19 +1457,13 @@ <h4 style="width:25em;word-wrap:break-word;">
</table>
</div>
</script>

<script type="text/template" id="template-addCourseCareer">
<button class="back_button btn btn-primary" onclick = "document.location.href='#courseCareerPath'"><%= languageDict.attributes.Back_To_Course_Career %></button>
<hr/>
<h4 id="new-quiz"><%= languageDict.attributes.New_Career_Path %></h4>
<div class ="multipleCourse">
<form>
<label for="lName"><%= languageDict.attributes.Level_Name %></label>
<select id="levelSelect" style="padding: 2px; margin-top: 8px;">
<option selected><%= languageDict.attributes.Select_An_option %></option>
<option value='Beginners'><%= languageDict.attributes.Beginners %></option>
<option value='Intermediate'><%= languageDict.attributes.Intermediate %></option>
<option value='Professional'><%= languageDict.attributes.Professional %></option>
</select>
<label for="cpName"><%= languageDict.attributes.Course_Career_Path_Name %></label>
<input type="text" id="careerPath" placeholder="Course Career Path Name" style="padding: 2px; margin-top: 8px;">
<label for="LCourse"><%= languageDict.attributes.List_of_Courses %></label>
Expand All @@ -1482,24 +1477,42 @@ <h4 id="new-quiz"><%= languageDict.attributes.New_Career_Path %></h4>
</form>
</div>
<div>
<table class="btable btable-striped">
<!-- <table class="btable btable-striped">
<th style="width: 430px"><%= languageDict.attributes.Course_Career %></th>
<th style="width: 430px"><%= languageDict.attributes.Level_Name %></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].Courses %></td>
<td><%= careerList[i].CoursePathName %></td>
<td><%= careerList[i].Level_Name %></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>
</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>
</script>

<script type="text/html" id="template-courseLevelsTable">
<h3 class="bigheader">
<div style="width:95%"><%= languageDict.attributes.Step%>-<%= step%>: <b>&nbsp;&nbsp; <%=title%></b>
Expand Down
2 changes: 2 additions & 0 deletions init_docs/Text.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"level": "Level(s)",
"Level_Name":"Level Name",
"Course_Career_Path_Name":"Course Career Path Name",
"Add_Course_Career_Level":"Add Course Career Level",
"Course_Career":"Course Career",
"Courses_List":"Courses List",
"Course_Career_Title":"Course Career Title",
Expand Down Expand Up @@ -326,6 +327,7 @@
"Paper": "Paper",
"Test": "Test",
"Add_Resource": "Add Resource",
"Add_Level":"Add Level",
"Required_Text": "Required",
"Step": "Step",
"View_Details": "View Details",
Expand Down

0 comments on commit 1e319ff

Please sign in to comment.