Commit b452e3f08d7d47e126e9bc9ea4b856f23ec7ec17
1 parent
ce248b25
Committing updated code of making user modules data dynamic
Showing
2 changed files
with
21 additions
and
71 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -271,31 +271,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -271,31 +271,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
271 | } | 271 | } |
272 | 272 | ||
273 | function ShowAssignedModulesPopup(userModules) { | 273 | function ShowAssignedModulesPopup(userModules) { |
274 | + $('#dvUserModulesInfo').modal('hide'); | ||
275 | + $('#dvPending').modal('hide'); | ||
274 | var allModules = Modules; | 276 | var allModules = Modules; |
275 | var arrPendingModules = []; | 277 | var arrPendingModules = []; |
276 | - if ($('#dvPendingModules').length > 0) { | ||
277 | - $('#dvPending').hide(); | ||
278 | - } | ||
279 | - for (var module = 1; module <= allModules.length; module++) { | ||
280 | - $('#moduleDiv' + module).hide(); | ||
281 | - } | ||
282 | - if (('#moduleDiv1017').length > 0) { | ||
283 | - $('#moduleDiv1017').hide(); | ||
284 | - } | ||
285 | 278 | ||
286 | for (var count = 0; count < userModules.length; count++) { | 279 | for (var count = 0; count < userModules.length; count++) { |
287 | for (var module = 0; module < allModules.length; module++) { | 280 | for (var module = 0; module < allModules.length; module++) { |
288 | if (userModules[count].id == allModules[module].Id) { | 281 | if (userModules[count].id == allModules[module].Id) { |
289 | - $('#moduleDiv' + userModules[count].id).show(); | 282 | + $('#dvUserModules').append('<div class="form-group"><div class="col-sm-8">• ' + userModules[count].name + '</div></div>'); |
290 | break; | 283 | break; |
291 | } | 284 | } |
292 | 285 | ||
293 | - if (userModules[count].id == 7) | ||
294 | - arrPendingModules.push(userModules[count].id); | ||
295 | - if (userModules[count].id == 8) | ||
296 | - arrPendingModules.push(userModules[count].id); | ||
297 | - if (userModules[count].id == 10) | ||
298 | - arrPendingModules.push(userModules[count].id); | 286 | + if (userModules[count].id == 7) { |
287 | + arrPendingModules.push(userModules[count]); | ||
288 | + break; | ||
289 | + } | ||
290 | + if (userModules[count].id == 8) { | ||
291 | + arrPendingModules.push(userModules[count]); | ||
292 | + break; | ||
293 | + } | ||
294 | + if (userModules[count].id == 10) { | ||
295 | + arrPendingModules.push(userModules[count]); | ||
296 | + break; | ||
297 | + } | ||
299 | } | 298 | } |
300 | } | 299 | } |
301 | if (userModules.length > 0) { | 300 | if (userModules.length > 0) { |
@@ -303,6 +302,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -303,6 +302,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
303 | } | 302 | } |
304 | 303 | ||
305 | if (arrPendingModules.length > 0) { | 304 | if (arrPendingModules.length > 0) { |
305 | + $('#dvPending').modal('show'); | ||
306 | + for (var module = 0; module < arrPendingModules.length; module++) { | ||
307 | + $('#dvPendingModules').append('<div class="form-group"><div class="col-sm-8"><i>• ' + arrPendingModules[module].name + '</i></div></div>'); | ||
308 | + } | ||
306 | $('#dvPendingModules').show(); | 309 | $('#dvPendingModules').show(); |
307 | } | 310 | } |
308 | } | 311 | } |
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1244,64 +1244,11 @@ | @@ -1244,64 +1244,11 @@ | ||
1244 | <div class="panel-body"> | 1244 | <div class="panel-body"> |
1245 | <!-- form --> | 1245 | <!-- form --> |
1246 | <form class="form-horizontal"> | 1246 | <form class="form-horizontal"> |
1247 | - <div> | ||
1248 | - <div class="form-group" id="moduleDiv1"> | ||
1249 | - <div class="col-sm-8">• Dissectible Anatomy</div> | ||
1250 | - </div> | ||
1251 | - <div class="form-group" id="moduleDiv2"> | ||
1252 | - <div class="col-sm-8">• Atlas Anatomy</div> | ||
1253 | - </div> | ||
1254 | - <div class="form-group" id="moduleDiv3"> | ||
1255 | - <div class="col-sm-8">• 3D Anatomy</div> | ||
1256 | - </div> | ||
1257 | - <div class="form-group" id="moduleDiv4"> | ||
1258 | - <div class="col-sm-8">• Clinical Illustrations</div> | ||
1259 | - </div> | ||
1260 | - <div class="form-group" id="moduleDiv5"> | ||
1261 | - <div class="col-sm-8">• Clinical Animations</div> | ||
1262 | - </div> | ||
1263 | - <div class="form-group" id="moduleDiv6"> | ||
1264 | - <div class="col-sm-8">• Encyclopedia</div> | ||
1265 | - </div> | ||
1266 | - <div class="form-group" id="moduleDiv9"> | ||
1267 | - <div class="col-sm-8">• IP 10</div> | ||
1268 | - </div> | ||
1269 | - <div class="form-group" id="moduleDiv11"> | ||
1270 | - <div class="col-sm-8">• In - Depth Reports</div> | ||
1271 | - </div> | ||
1272 | - <div class="form-group" id="moduleDiv12"> | ||
1273 | - <div class="col-sm-8">• Complementary and Alternative Medicine</div> | ||
1274 | - </div> | ||
1275 | - <div class="form-group" id="moduleDiv13"> | ||
1276 | - <div class="col-sm-8">• A.D.A.M Images</div> | ||
1277 | - </div> | ||
1278 | - <div class="form-group" id="moduleDiv14"> | ||
1279 | - <div class="col-sm-8">• Body Guide</div> | ||
1280 | - </div> | ||
1281 | - <div class="form-group" id="moduleDiv15"> | ||
1282 | - <div class="col-sm-8">• Symptom Navigator</div> <!--Health--> | ||
1283 | - </div> | ||
1284 | - <div class="form-group" id="moduleDiv16"> | ||
1285 | - <div class="col-sm-8">• The Wellness Tools</div> | ||
1286 | - </div> | ||
1287 | - <div class="form-group" id="moduleDiv1017"> | ||
1288 | - <div class="col-sm-8">• A.D.A.M on Demand</div> | ||
1289 | - </div> | ||
1290 | - </div> | 1247 | + <div id="dvUserModules" ></div> |
1291 | <!--<hr style="border: 1px solid;"/>--> | 1248 | <!--<hr style="border: 1px solid;"/>--> |
1292 | <div id="dvPending" style="margin: 15px 0;"><b>Pending Modules</b></div> | 1249 | <div id="dvPending" style="margin: 15px 0;"><b>Pending Modules</b></div> |
1293 | <!--<hr style="border: 1px solid;" />--> | 1250 | <!--<hr style="border: 1px solid;" />--> |
1294 | - <div> | ||
1295 | - <div class="form-group" id="moduleDiv7"> | ||
1296 | - <div class="col-sm-12"><i>• Curriculum Builder</i></div> <!--(To be available by 09/25/2017)--> | ||
1297 | - </div> | ||
1298 | - <div class="form-group" id="moduleDiv8"> | ||
1299 | - <div class="col-sm-8"><i>• Anatomy Test</i></div> <!--(To be available by 08/28/2017)--> | ||
1300 | - </div> | ||
1301 | - <div class="form-group" id="moduleDiv10"> | ||
1302 | - <div class="col-sm-8"><i>• Lab Exercises</i></div> <!--(To be available by 08/16/2017)--> | ||
1303 | - </div> | ||
1304 | - </div> | 1251 | + <div id="dvPendingModules"></div> |
1305 | <div class="form-group"> | 1252 | <div class="form-group"> |
1306 | <div style="text-align: center"> | 1253 | <div style="text-align: center"> |
1307 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" data-dismiss="modal"><i class="fa fa-check"></i> OK</button> | 1254 | <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" data-dismiss="modal"><i class="fa fa-check"></i> OK</button> |