diff --git a/app/MyApp/app/Home-Urdu.css b/app/MyApp/app/Home-Urdu.css index 381c46631..8b38e8d0f 100644 --- a/app/MyApp/app/Home-Urdu.css +++ b/app/MyApp/app/Home-Urdu.css @@ -1252,3 +1252,8 @@ form > fieldset > ul > li.bbf-field.field-selectLanguage { #addIndividualResource{ width:110px; } +#CommunitySelect{ + float: left; + margin-top: -45px; + margin-right: 15px; +} diff --git a/app/MyApp/app/Home.css b/app/MyApp/app/Home.css index 385c154ab..b85164774 100644 --- a/app/MyApp/app/Home.css +++ b/app/MyApp/app/Home.css @@ -1059,4 +1059,9 @@ form > fieldset > ul > li.bbf-field.field-selectLanguage { .courseInfo{ width:97%; margin-left:20px; -} \ No newline at end of file +} +#CommunitySelect{ + float: right; + margin-top: -45px; + margin-right: 15px; +} diff --git a/app/MyApp/app/Router.js b/app/MyApp/app/Router.js index 02f90000d..a433586a8 100644 --- a/app/MyApp/app/Router.js +++ b/app/MyApp/app/Router.js @@ -420,25 +420,74 @@ $(function() { var creditsView = new App.Views.CreditsLeaderView(); App.$el.children('.body').html('
'); $('#creditsMainTable').append('

' + 'Course Credits' + '

'); + var CoursecommunityList = ""; + if(App.configuration.get('type') == 'nation'){ + $.ajax({ + url: '/community/_design/bell/_view/getCommunityByCode', + type: 'GET', + dataType: "jsonp", + async: false, + success: function(json){ + CoursecommunityList = ''; + CoursecommunityList += ''; + $.each(json.rows, function(rec, index) { + CoursecommunityList += ''; + }) + CoursecommunityList = ''; + $('.DropDownOptn').append(CoursecommunityList); + } + }); + } + $('#creditsMainTable').append(CoursecommunityList); + $('#CommunitySelect').change(function(){ + var selectedvalue = $('#CommunitySelect').val(); + creditsView.addHeading(); + var count=0; + var c1 = new App.Collections.membercourseprogresses(); + c1.fetch({ + async:false, + success: function (courseDocs) { + if(courseDocs.length>0){ + var mem_list1=[] + var course_list1=[] + for(var i=0;i 0){ + for(var i = 0 ; i < mem_list1.length; i++){ + creditsView.courseId= mem_list1[i].courseId; + creditsView.mem_list1 = mem_list1[i]; + } + //console.log(creditsView.courseId) + creditsView.randerTable(selectedvalue); + } + } + } + }); + }); creditsView.addHeading(); var count=0; - var courses = new App.Collections.Courses(); + var courses = new App.Collections.membercourseprogresses(); courses.fetch({ async:false, success: function (courseDocs) { if(courseDocs.length>0){ + var mem_list=[] + var course_list=[] for(var i=0;i0){ - creditsView.courseId=doc.get('_id'); - creditsView.learnerIds = learnerIds; - creditsView.render(); - } + if(courseDocs.models[i].id != '_design/bell') { + mem_list.push({"courseId": courseDocs.models[i].attributes.courseId, "MemberId" : courseDocs.models[i].attributes.memberId}) } } + if(mem_list.length > 0){ + for(var i = 0 ; i < mem_list.length; i++){ + creditsView.courseId= mem_list[i].courseId; + creditsView.mem_list = mem_list; + } + creditsView.render(); + } } } }); @@ -522,7 +571,7 @@ $(function() { { if(learnerCollection.length > 0) { - memberId = learnerCollection.models[0].get("_id"); + memberId = learnerCollection[0].get("_id"); } } if(!memberId) @@ -546,19 +595,18 @@ $(function() { App.$el.children('.body').html('
'); var select = $("