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

Commit 95d5181

Browse files
razu9861Rupesh87
authored andcommitted
[#1046] Disable sending mail to non nation members
1 parent c83d3df commit 95d5181

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/MyApp/app/views/CourseMembers.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ $(function () {
4343
memberProgress.fetch({
4444
async: false,
4545
success: function(res){
46-
console.log(res)
4746
member_list = []
4847
if(res.length > 0){
4948
for(var i = 0; i < res.length; i++){
@@ -57,7 +56,6 @@ $(function () {
5756
config.fetch({
5857
async: false
5958
})
60-
6159
var currentConfig = config.first().toJSON()
6260
var code = currentConfig.rows[0].doc.code
6361
var na = currentConfig.rows[0].doc.nationName.substring(3,5);
@@ -84,7 +82,11 @@ $(function () {
8482
attchmentURL = attchmentURL + _.keys(mems.get('_attachments'))[0]
8583
src = attchmentURL
8684
}
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>'
85+
if(config.models[0].attributes.rows[0].doc.type == 'nation' && mems.get("community") == 'nationbell' || config.models[0].attributes.rows[0].doc.type == 'community'){
86+
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+
} else {
88+
viewtext += '<tr><td><img width="45px" height="45px" src="' + src + '"/></td><td>' + mems.get('firstName') + ' ' + mems.get('lastName') + '</td><td>'+roleOfMem+'</td><td></td>'
89+
}
8890
var loggedIn = new App.Models.Member({
8991
"_id": $.cookie('Member._id')
9092
})
@@ -181,7 +183,11 @@ $(function () {
181183
attchmentURL = attchmentURL + _.keys(mems.get('_attachments'))[0]
182184
src = attchmentURL
183185
}
184-
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>'
186+
if(config.models[0].attributes.rows[0].doc.type == 'nation' && mems.get("community") == 'nationbell'){
187+
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>'
188+
} else{
189+
viewtext += '<tr><td><img width="45px" height="45px" src="' + src + '"/></td><td>' + mems.get('firstName') + ' ' + mems.get('lastName') + '</td><td>'+roleOfMem+'</td><td></td>'
190+
}
185191
var loggedIn = new App.Models.Member({
186192
"_id": $.cookie('Member._id')
187193
})

0 commit comments

Comments
 (0)