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

Commit

Permalink
[#840]: Career Path
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0chin committed Jun 2, 2017
1 parent 72c77d2 commit 1c0bfd5
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 37 deletions.
9 changes: 8 additions & 1 deletion app/MyApp/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6742,7 +6742,14 @@ $(function() {
applyCorrectStylingSheet(directionOfLang)
},
addCareerPath:function(){
var addCourseCareer = new App.Views.AddCourseCareer();
var courses = new App.Collections.Courses()
courses.memberId = $.cookie('Member._id');
courses.fetch({
async:false
});
var addCourseCareer = new App.Views.AddCourseCareer({
collection:courses
});
addCourseCareer.render()
App.$el.children('.body').html('<div id="ManageCourseCareer"></div>');
$('#ManageCourseCareer').append('<div><h2>'+App.languageDict.attributes.Add_Multiple_Courses+'</h2></div>')
Expand Down
30 changes: 23 additions & 7 deletions app/MyApp/app/views/AddCourseCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,34 @@ $(function() {
vars: {},
events: {
},
"click .back_button":function()
{
Backbone.history.navigate('courseCareerPath' + this.levelId + '/' + this.revId, {
trigger: true
})
},

"click #AddCareerPath": function(e) {
this.saveCareerPath();
},
"click #CancelCOursePath": function(e) {
this.saveCareerPath();
},
initialize: function() {

},

saveCareerPath: function(){
alert("What's up");
},

render: function() {
console.log(this.collection.models)
var arrcourses = []
for(var i = 0; i <this.collection.models.length; i++){
var courseslist = this.collection.models[i].attributes.CourseTitle
console.log(courseslist)
arrcourses.push(courseslist)
}
this.$el.find('.multipleCourse').append('<div class="btn btn-info" id="finishPressed">'+App.languageDict.attributes.Finish+'</div>&nbsp&nbsp');
this.vars.Courselist = arrcourses
this.vars.Course_Length = this.collection.models.length
this.$el.html(_.template(this.template,this.vars))
}
},


})
Expand Down
57 changes: 28 additions & 29 deletions app/MyApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1445,48 +1445,47 @@ <h4 style="width:25em;word-wrap:break-word;">
<button style="margin-top: -186px; margin-left: 536px;" class='btn btn-primary' id="addNewCoursePath" onclick = "document.location.href='#courseCareerPath/add'" >Add New Career</button>
<button class="back_button btn btn-primary" style = "margin-left: -677px;"
onclick = "document.location.href='#courses'"><%= languageDict.attributes.Back_To_Course %></button>
<input id="searchText" type="Text" placeholder="Course Career Name" style="margin-top: -165px; margin-left: 1051px; height: 28px; width: 170px;">
<input id="searchText" type="Text" placeholder="Course Career Name" style="margin-top: -173px; margin-left: 1051px; height: 28px; width: 170px;">
<button style="margin-top: -242px; margin-left: 1395px;" class="Search btn btn-info" id="SearchCoursePath" >Search</button>
<div>
<table class="btable btable-striped">>
<th>Course Career</th>
<table class="btable btable-striped">
<th style="width: 430px">Course Career</th>
<th>Action<th>
</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>
<style>
input[type=text], select { width: 22%%;padding: 26px 16px; margin:15px 4px;display: inline-block;border: 1px solid #ccc;border-radius: 4px;box-sizing: border-box;}
input[type=submit] { width: 100%;background-color: #4CAF50;color: white;padding: 14px 20px;margin: 8px 0;
border: none;border-radius: 4px;cursor: pointer;}}
</style>
<div>
<form action="/action_page.php">
<label for="fname">Level Name</label>
<input type="text" id="fname" name="firstname" placeholder="Leve Name">
<label for="lname">Course Career Path Name</label>
<input type="text" id="lname" name="lastname" placeholder="Course Career Path Name">
<label for="country">List of Courses</label>
<select id="country" Placeholder="List of Courses" name="country">
<option value="australia">Australia</option>
<option value="canada">Canada</option>
<option value="usa">USA</option>
<div class ="multipleCourse">
<form>
<label for="lName"><%= languageDict.attributes.Level_Name %></label>
<select id="LCourse" style="font-size: 15px;font-weight: 500;">
<option selected><%= languageDict.attributes.Select_An_option %></option>
<option value='Begineers'>Begineers</option>
<option value='Intermediate'>Intermediate</option>
<option value='Professional'>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-top: 12px; padding-bottom: 11px;">
<label for="LCourse"><%= languageDict.attributes.List_of_Courses %></label>
<select id="LCourse" style="font-size: 15px;font-weight: 500;">
<option selected><%= languageDict.attributes.Select_An_option %></option>
<%for(var i =0; i<Course_Length;i++){%>
<option value='<%=Courselist[i]%>'><%=Courselist[i]%></option>
<%}%>
</select>
<button id="AddCareerPath" class="course btn btn-success" style="margin-left: 23px;">Create Course Career</button>
<button id ="CancelCOursePath" class="btn resignBtn btn-danger" style="margin-left: 23px;" >Cancel</button>
<button id="AddCareerPath" class="course btn btn-success" style="margin-left: 23px; margin-top: -15px;"><%= languageDict.attributes.Create_Course_Career %></button>
<button id ="CancelCOursePath" class="btn resignBtn btn-danger" style="margin-left: 23px;margin-top: -15px;" ><%= languageDict.attributes.Cancel %></button>
</form>
</div>
<div>
<table class="btable btable-striped">
<tbody><tr><th style="width: 430px">Course Career</th>
<th>Action</th>
</tr>
<td> </td>
</tr>
</tbody>
</table
<table class="btable btable-striped">
<th style="width: 430px">Course Career</th>
<th style="width: 430px">Courses List</th>
<th>Action<th>
</table>
</div>

</script>
Expand Down
4 changes: 4 additions & 0 deletions init_docs/Text.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
"language": "Language",
"subject": "Subject(s)",
"level": "Level(s)",
"Level_Name":"Level Name",
"Course_Career_Path_Name":"Course Career Path Name",
"List_of_Courses":"List of Courses",
"Create_Course_Career":"Create Course Career",
"publisher_attribution": "Publisher/Attribution",
"link_to_license": "Link to License",
"resource_for": "Resource For",
Expand Down

0 comments on commit 1c0bfd5

Please sign in to comment.