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

Commit

Permalink
[#840]: Removed Conflit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0chin committed Jun 5, 2017
2 parents d79ab6c + 0db709e commit 3e23999
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
12 changes: 11 additions & 1 deletion app/MyApp/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,7 @@ $(function() {
}
$('.form .field-Tag select').attr("multiple", true);
$('.form .field-Tag select').click(function() {
console.log(this.value)
context.AddNewSelect(this.value)
});
$('.form .field-Tag select').dblclick(function() {
Expand Down Expand Up @@ -6754,7 +6755,16 @@ $(function() {
App.$el.children('.body').html('<div id="ManageCourseCareer"></div>');
$('#ManageCourseCareer').append('<div><h2>'+App.languageDict.attributes.Add_Multiple_Courses+'</h2></div>')
$('#ManageCourseCareer').append(addCourseCareer.el);
$('#LCourse').multiselect({columns: 1,placeholder: 'Select Course'});
$('#LCourse').multiselect().multiselectfilter();
$('#LCourse').multiselect({
checkAllText: App.languageDict.attributes.checkAll,
uncheckAllText: App.languageDict.attributes.unCheckAll,
selectedText: '# '+App.languageDict.attributes.Selected
});
$('#LCourse').multiselect().multiselectfilter("widget")[0].children[0].firstChild.data=App.languageDict.attributes.Filter;
$('.ui-multiselect-filter').find('input').attr('placeholder',App.languageDict.attributes.KeyWord_s);
$('#LCourse').attr("multiple", true);
$('#LCourse').multiselect("uncheckAll");
var directionOfLang = App.languageDict.get('directionOfLang');
applyCorrectStylingSheet(directionOfLang)

Expand Down
61 changes: 26 additions & 35 deletions app/MyApp/app/views/AddCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,42 @@ $(function() {
},

saveCareerPath: function(){
var selectedCourseId = []
var selectedCourseName = []
$('#LCourse option:selected').each(function(){
if ($(this).length) {
selectedCourseId.push($(this).val());
selectedCourseName.push($(this).text());
}
});
console.log(selectedCourseId, selectedCourseName)
var levelname = $('#levelSelect').val()
var coursecareerpath = $('#careerPath').val()
var res = $('input:checked[name="multiselect_LCourse"]').val()
/* if ($("input[name = 'LCourse[]']").val() != undefined) {
var res = [];
$("input[name = 'LCourse[]']:checked").each(function(index) {
if($(this).is(':checked')==true){
res.push(decodeURI($(this).val()));
}
});
}
console.log(res)*/
var coursetitle = $('#LCourse').val()
var arrcourseId = []
for(var i = 0; i <this.collection.models.length; i++){
if(coursetitle === this.collection.models[i].attributes.CourseTitle){
var courseid = this.collection.models[i].attributes._id
arrcourseId.push(courseid)
}
}
var courseCareerTitle = $('#careerPath').val()
var savecoursecareer = new App.Models.CoursecareerPath()
savecoursecareer.set('Level_Name',levelname);
savecoursecareer.set('CoursePathName',coursecareerpath);
savecoursecareer.set('Courselist',res);
savecoursecareer.set('CourseIds',arrcourseId);
savecoursecareer.set('MemberID',$.cookie('Member._id'));
savecoursecareer.save(null, {
error: function() {
console.log("Not Saved")
}
});

location.reload();
var Collection = new App.Collections.CourseCareerPath()
Collection.Level_Name=this.levelname
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")
}
});
//location.reload();
},

render: function() {
render: function() {
var arrcourses = []
var arrCourseIds = []
for(var i = 0; i <this.collection.models.length-1; i++){
var courseslist = this.collection.models[i].attributes.CourseTitle
console.log(courseslist)
var courseId = this.collection.models[i].attributes._id
arrcourses.push(courseslist)
arrCourseIds.push(courseId)
}
this.vars.Courselist = arrcourses
this.vars.Courseid = arrCourseIds
this.vars.Course_Length = this.collection.models.length-1
this.$el.html(_.template(this.template,this.vars))
},
Expand Down
4 changes: 2 additions & 2 deletions app/MyApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,8 @@ <h4 id="new-quiz"><%= languageDict.attributes.New_Career_Path %></h4>
<label for="LCourse"><%= languageDict.attributes.List_of_Courses %></label>
<select id="LCourse" name = "LCourse[]">
<%for(var i =0; i<Course_Length;i++){%>
<option value='<%=Courselist[i]%>'><%=Courselist[i]%></option>
<%}%>
<option value='<%=Courseid[i]%>'><%=Courselist[i]%></option>
<%}%>
</select>
<button id="AddCareerPath" class="course btn btn-success" style="margin-left: 23px; margin-top: -1px;"><%= languageDict.attributes.Create_Course_Career %></button>
<button id ="CancelCOursePath" class="btn resignBtn btn-danger" style="margin-left: 23px;margin-top: -1px;" ><%= languageDict.attributes.Cancel %></button>
Expand Down

0 comments on commit 3e23999

Please sign in to comment.