[Aimmath-commit] AIM/WEB-INF/maple/aim Zone.mpl,1.5,1.6
                
                Brought to you by:
                
                    gustav_delius,
                    
                
                    npstrick
                    
                
            
            
        
        
        
    | 
      
      
      From: <gr...@us...> - 2004-01-09 06:12:40
      
     | 
| Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv28906
Modified Files:
	Zone.mpl 
Log Message:
When there are >9 subjects, the index.html and admin.html pages 
now set the subjects in columns of at most 9 subjects in a column. - GG
Index: Zone.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Zone.mpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Zone.mpl	26 Aug 2003 21:31:48 -0000	1.5
--- Zone.mpl	9 Jan 2004 06:12:37 -0000	1.6
***************
*** 165,169 ****
         # optional
         subjname_::string)
!    local subjname,subjects,subjecttable,subj,c;
  
     subjects := this['Subjects'];
--- 165,169 ----
         # optional
         subjname_::string)
!    local subjname,subjects,subjecttable,subj,c,i,row,nrows,ncols,subjectrows;
  
     subjects := this['Subjects'];
***************
*** 181,184 ****
--- 181,193 ----
     subjecttable := `new/HTML/Table`([]);
  
+    #The number 9 in the next line is the maximum number of
+    #subjects in a column ... it can be changed to any reasonable
+    #integer >= 1. It should probably be a global constant set in
+    #Config.mpl
+    ncols := ceil(nops(subjects)/9);
+    nrows := ceil(nops(subjects)/ncols);
+    subjectrows := Array(0..nrows - 1, i -> "tr");
+    row := 0;
+    
     for subj in subjects do
      if subj['Name'] = subjname then
***************
*** 188,197 ****
      fi;
  
!     subjecttable['AddContents',
!      ["tr",
        ["td",
          [["inputradio","name" = "SubjectName","value" = subj['Name'],c]]],
        ["td",
!         subj['Title']]]];
     od;
  
--- 197,210 ----
      fi;
  
!     subjectrows[row] := subjectrows[row],
        ["td",
          [["inputradio","name" = "SubjectName","value" = subj['Name'],c]]],
        ["td",
!         subj['Title']];
!     row := (row + 1) mod nrows;
!    od;
!    
!    for row from 0 to nrows - 1 do
!     subjecttable['AddContents',[subjectrows[row]]];
     od;
  
 |