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

Commit 8c2031c

Browse files
committed
[#1047] Community member enrolled on course
1 parent 2dd5a4c commit 8c2031c

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

app/MyApp/app/Router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,15 +3062,15 @@ $(function() {
30623062
var CoursecommunityList = "";
30633063
if(App.configuration.get('type') == 'nation'){
30643064
$.ajax({
3065-
url: '/community/_design/bell/_view/getCommunityByCode',
3065+
url: '/members/_design/bell/_view/MembersBySelectedCommunity?group=true',
30663066
type: 'GET',
30673067
dataType: "jsonp",
30683068
async: false,
30693069
success: function(json){
30703070
CoursecommunityList = '<option value="">'+App.languageDict.attributes.All+'</option>';
30713071
CoursecommunityList += '<option value="'+App.configuration.get('code')+'">'+App.configuration.get('name')+'</option>';
30723072
$.each(json.rows, function(rec, index) {
3073-
CoursecommunityList += '<option value="'+this.value.Code+'">'+this.value.Name+'</option>';
3073+
CoursecommunityList += '<option value="'+this.key+'">'+this.key+'</option>';
30743074
})
30753075
CoursecommunityList = '<select id="CommunitySelect">'+CoursecommunityList+'</select>';
30763076
$('.DropDownOptn').append(CoursecommunityList);

app/MyApp/app/views/CourseMembers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $(function () {
6363
var na = currentConfig.rows[0].doc.nationName.substring(3,5);
6464
$('.courseEditStep').empty();
6565
$('.courseEditStep').append('<h3>'+App.languageDict.attributes.Course_Members+ ' | ' + courseModel.get('name') + '</h3>')
66-
var viewtext = '<table id = "Table1" class="btable btable-striped"><th>'+App.languageDict.attributes.Photo+'</th><th>'+App.languageDict.attributes.Name+'</th><th>'+App.languageDict.attributes.Roles+'</th><th colspan=2>'+App.languageDict.attributes.Actions+'</th>'
66+
var viewtext = '<table id = "Table1" class="btable btable-striped"><th>'+App.languageDict.attributes.Photo+'</th><th>'+App.languageDict.attributes.Name+'</th><th>'+App.languageDict.attributes.Roles+'</th><th>'+App.languageDict.attributes.Community+'</th><th colspan="2">'+App.languageDict.attributes.Actions+'</th>'
6767
for (var i = 0; i < member_list.length; i++) {
6868
var mems = new App.Models.Member({
6969
_id: member_list[i]
@@ -84,7 +84,7 @@ $(function () {
8484
attchmentURL = attchmentURL + _.keys(mems.get('_attachments'))[0]
8585
src = attchmentURL
8686
}
87-
viewtext += '<tr><td><img width="45px" height="45px" src="' + src + '"/></td><td>' + mems.get('firstName') + ' ' + mems.get('lastName') + '</td><td>'+roleOfMem+'</td><td><input type="checkbox" name="courseMember" value="' + mail + '">'+App.languageDict.attributes.Send_Email+'</td>'
87+
viewtext += '<tr><td><img width="45px" height="45px" src="' + src + '"/></td><td>' + mems.get('firstName') + ' ' + mems.get('lastName') + '</td><td>'+roleOfMem+'</td><td>'+ mems.get('community') +'</td><td><input type="checkbox" name="courseMember" value="' + mail + '">'+App.languageDict.attributes.Send_Email+'</td>'
8888
var loggedIn = new App.Models.Member({
8989
"_id": $.cookie('Member._id')
9090
})
@@ -105,7 +105,7 @@ $(function () {
105105
'onclick=showComposePopupMultiple("' + mail + '") id="sendMailButton">'
106106
+App.languageDict.attributes.Send_Email+'</button>' +
107107
'<button class="btn" id="retrunBack" onclick=retrunBack()>'
108-
+App.languageDict.attributes.Back+'</button></td><td></td><td></td></tr>';
108+
+App.languageDict.attributes.Back+'</button></td><td></td><td></td><td></td></tr>';
109109
viewtext += '</table>';
110110
$('.courseEditStep').append(viewtext)
111111
}

databases/members.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ ddoc.views = {
114114
}
115115
}
116116
},
117+
MembersBySelectedCommunity: {
118+
map: function(doc) {
119+
if (doc && doc.community) {
120+
emit(doc.community, doc)
121+
}
122+
},
123+
reduce: function(keys, values, rereduce) {
124+
return values[0].community;
125+
}
126+
},
117127
managerMembers: {
118128
map: function (doc) {
119129
if (doc && doc.kind == 'Member' && doc.roles.indexOf('Manager') > -1) {

init_docs/ConfigurationsDoc-Community.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type":"community",
44
"version":"0.13.20",
55
"currentLanguage":"English",
6-
"register": "earthbell.ole.org:5989",
6+
"register": "nbs.ole.org:5997",
77
"registerDev": "nbs.ole.org:5997"
88
}
99

0 commit comments

Comments
 (0)