Difference between revisions of "Widget:ApprovedMaterials"

From LNF Wiki
Jump to navigation Jump to search
Line 67: Line 67:
  
  
         //Now do the same thing for non-approved materials
+
         Now do the same thing for non-approved materials
         someString2 = "<h4>Materials Not Allowed</h4><table><tr>";
+
         // someString2 = "<h4>Materials Not Allowed</h4><table><tr>";
  
         for(var catKey in uniqueCategories){
+
         // for(var catKey in uniqueCategories){
             var areThereAny = 0;
+
             // var areThereAny = 0;
  
             for(var key in materialApproved){
+
             // for(var key in materialApproved){
  
                 if(materialApproved[key] == 'N' && materialCategory[key] == uniqueCategories[catKey]){
+
                 // if(materialApproved[key] == 'N' && materialCategory[key] == uniqueCategories[catKey]){
  
                     if(areThereAny == 0){
+
                     // if(areThereAny == 0){
                         areThereAny = 1;
+
                         // areThereAny = 1;
                         someString2 = someString2 + '<td valign=top><b>' + uniqueCategories[catKey] + '</b><ul>';
+
                         // someString2 = someString2 + '<td valign=top><b>' + uniqueCategories[catKey] + '</b><ul>';
                     }
+
                     // }
 
                      
 
                      
                     someString2 = someString2 + '<li>' + key + '</li>';
+
                     // someString2 = someString2 + '<li>' + key + '</li>';
                 }  
+
                 // }  
             }
+
             // }
             someString2 = someString2 + '</ul></td>';
+
             // someString2 = someString2 + '</ul></td>';
 
          
 
          
         }
+
         // }
 
          
 
          
 
         document.getElementById("approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString;
 
         document.getElementById("approved_materials_<!--{$toolid|default:10020}-->").innerHTML = someString;

Revision as of 09:47, 12 May 2016

This widget will display the approved and restricted materials for a tool based on its toolid. Use the following code:

{{#widget:ApprovedMaterials|toolid=#####|header=Y/N}}