[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncoursegroups.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 07 Jul 2006 16:48:21 -0000


This is a MIME encoded message

--albertel1152290901
Content-Type: text/plain

albertel		Fri Jul  7 12:48:21 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm loncoursegroups.pm 
  Log:
  - cssed more of the groups settings forms 
     - topic bars
     - first step of adding new members
  
  
--albertel1152290901
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060707124821.txt"

Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.422 loncom/interface/loncommon.pm:1.423
--- loncom/interface/loncommon.pm:1.422	Fri Jul  7 11:54:15 2006
+++ loncom/interface/loncommon.pm	Fri Jul  7 12:48:21 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.422 2006/07/07 15:54:15 albertel Exp $
+# $Id: loncommon.pm,v 1.423 2006/07/07 16:48:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3516,6 +3516,28 @@
 table.LC_notify_front_page td {
   padding: 8px;
 }
+.LC_topic_bar {
+  font-family: $sans;
+  font-weight: bold;
+  width: 100%;
+  background: $tabbg;
+  vertical-align: middle;
+  margin: 2ex 0ex 2ex 0ex;
+}
+.LC_topic_bar span {
+  vertical-align: middle;
+}
+.LC_topic_bar img {
+  vertical-align: bottom;
+}
+table.LC_course_group_status {
+  margin: 20px;
+}
+table.LC_status_selector td {
+  vertical-align: top;
+  text-align: center;
+ padding: 4px;
+}
 
 END
 }
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.39 loncom/interface/loncoursegroups.pm:1.40
--- loncom/interface/loncoursegroups.pm:1.39	Fri Jul  7 11:54:15 2006
+++ loncom/interface/loncoursegroups.pm	Fri Jul  7 12:48:21 2006
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursegroups.pm,v 1.39 2006/07/07 15:54:15 albertel Exp $
+# $Id: loncoursegroups.pm,v 1.40 2006/07/07 16:48:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1182,24 +1182,13 @@
         $toolprivs,$fixedprivs,$sectioncount,$stored,$states,$navbuttons,
         $rowColor1,$rowColor2,$gpterm,$ucgpterm,$crstype) = @_;
     my ($nexttext,$prevtext);
-    $r->print(' <br />
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
-');
     &groupsettings_options($r,$tabcol,$functions,$action,$formname,$stored,1,
                            $gpterm,$ucgpterm,$crstype);
-    $r->print(' 
-  <tr>
-   <td colspan="4">&nbsp;</td>
-  </tr>');
     &access_date_settings($r,$tabcol,$action,$formname,$stored,2,$gpterm,
                           $ucgpterm);
-    $r->print('
-  <tr>
-   <td colspan="4">&nbsp;</td>
-  </tr>');
     if ($action eq 'create') {
-        &membership_options($r,$action,$formname,$tabcol,$sectioncount,3,
-                            $gpterm,$ucgpterm);
+        &membership_options($r,$action,$formname,$sectioncount,3,$gpterm,
+			    $ucgpterm);
         $nexttext = $$navbuttons{'gtns'};
     } else {
         my @available = ();
@@ -1209,10 +1198,6 @@
         &privilege_specificity($r,$tabcol,$rowColor1,$rowColor2,$action,
                                3,$tools,$stored,$toolprivs,$fixedprivs,
                                \@available,$formname,$gpterm,$ucgpterm);
-        $r->print('
-  <tr>
-   <td colspan="4">&nbsp;</td>
-  </tr>');
         &mapping_options($r,$action,$formname,$page,$tabcol,$sectioncount,
                          $states,$stored,$navbuttons,4,5,$rowColor1,
                          $rowColor2,$gpterm,$ucgpterm,$crstype);
@@ -1221,8 +1206,6 @@
     $prevtext = $$navbuttons{'gtpp'};
     &display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
                         $$states{$action}[$page+1],$nexttext);
-    $r->print('
- </table>');
     return;
 }
 
@@ -1241,7 +1224,7 @@
                   "to different $gpterm members?",
     );
     my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored);
-    &topic_bar($r,$tabcol,$image,$lt{'gnde'});
+    &topic_bar($r,$image,$lt{'gnde'});
     $r->print('
    <tr>
     <td>&nbsp;</td>
@@ -1358,7 +1341,7 @@
 }
 
 sub membership_options {
-    my ($r,$action,$state,$tabcol,$sectioncount,$image,$gpterm,$ucgpterm) = @_;
+    my ($r,$action,$state,$sectioncount,$image,$gpterm,$ucgpterm) = @_;
     my $crstype = &Apache::loncommon::course_type();
     my %lt = &Apache::lonlocal::texthash(
                 'pipa' => 'Pick parameters to generate membership list',
@@ -1385,12 +1368,9 @@
 
     my @sections = keys(%{$sectioncount});
 
-    &topic_bar($r,$tabcol,$image,$lt{'pipa'});
+    &topic_bar($r,$image,$lt{'pipa'});
     $r->print('
-   <tr>
-    <td>&nbsp;</td>
-    <td colspan="3">
-     <b>'.$lt{'gmem'}.'</b><br/>'.$lt{'picr'});
+     <b>'.$lt{'gmem'}.'</b><br />'.$lt{'picr'});
     if ($action eq 'create') {
         $r->print($lt{'meof'}.'<br />'.$lt{'ifno'}.'<br />'.$lt{'asub'});
     } else {
@@ -1399,34 +1379,28 @@
     $r->print('
      <br />
      <br />
-     <table border="0">
+     <table class="LC_status_selector">
       <tr>
-       <td><b>'.$lt{'acty'}.'</b></td>
-       <td>&nbsp;</td>
-       <td><b>'.$lt{'coro'}.'</b></td>');
+       <th>'.$lt{'acty'}.'</th>
+       <th>'.$lt{'coro'}.'</th>');
     if (@sections >0) {
         $r->print('
-       <td>&nbsp;</td>
-       <td><b>'.$lt{'cose'}.'</b></td>
-       <td>&nbsp;</td>');
+       <th>'.$lt{'cose'}.'</th>');
     }
-    $r->print('</tr><tr>');
+    $r->print('</tr><tr><td>');
     $r->print(&Apache::lonhtmlcommon::status_select_row(\%status_types));
-    $r->print('<td>&nbsp;</td>');
+    $r->print('</td><td>');
     $r->print(&Apache::lonhtmlcommon::role_select_row(\@roles));
     if (@sections > 0) {
         @sections = sort {$a cmp $b} @sections;
         unshift(@sections,'none'); # Put 'no sections' next
         unshift(@sections,'all'); # Put 'all' at the front of the list
-        $r->print('<td>&nbsp;</td>
-                   <td colspan="3" align="center" valign="top">'.
+        $r->print('</td><td>'.
         &sections_selection(\@sections,'sectionpick').'</td>');
     }
     $r->print('
       </tr>
-     </table>
-    </td>
-   </tr>');
+     </table>');
     return;
 }
 
@@ -1468,7 +1442,7 @@
     }
     my ($start_table,$end_table) = &date_setting_table
                                     ($starttime,$endtime,$formname);
-    &topic_bar($r,$tabcol,$image,$lt{'sten'});
+    &topic_bar($r,$image,$lt{'sten'});
     $r->print('
    <tr>
     <td>&nbsp;</td>
@@ -1497,17 +1471,9 @@
          \@regexps));
     my $earlyout = &validate_groupname($groupname,$action,$cdom,$cnum,$gpterm,
                                        $ucgpterm,$crstype);
-    $r->print('
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
-');
     if ($earlyout) {
-        $r->print($earlyout.'</td></tr>');
         &display_navbuttons($r,$formname,$$states{$action}[$page-1],
                            $$navbuttons{'gtps'});
-        $r->print('</table>');
         return;
     } 
     my ($specimg,$memimg);
@@ -1515,10 +1481,9 @@
     my @unavailable = ();
     &check_tools($functions,$tools,\@available,\@unavailable);
     if ($action eq 'create') {
-        &print_current_settings($r,$action,$tabcol,$rowColor1,$rowColor2,
-                                $functions,$startdate,$enddate,$groupname,
-                                $description,$granularity,$quota,\@available,
-                                \@unavailable,$gpterm,$ucgpterm);
+        &print_current_settings($r,$action,$functions,$startdate,$enddate,
+				$groupname,$description,$granularity,$quota,
+				\@available,\@unavailable,$gpterm,$ucgpterm);
         $specimg = 4;
         $memimg = 5;
     } else {
@@ -1553,7 +1518,6 @@
         &display_navbuttons($r,$formname,$$states{$action}[$page-1],
                             $$navbuttons{'gtps'});
     }
-    $r->print('</table>');
     return;
 }
 
@@ -1596,9 +1560,8 @@
 }
 
 sub print_current_settings {
-    my ($r,$action,$tabcol,$rowColor1,$rowColor2,$functions,$startdate,$enddate,
-        $groupname,$description,$granularity,$quota,$available,$unavailable,
-        $gpterm,$ucgpterm) = @_;
+    my ($r,$action,$functions,$startdate,$enddate,$groupname,$description,
+	$granularity,$quota,$available,$unavailable,$gpterm,$ucgpterm) = @_;
 
     my %lt = &Apache::lonlocal::texthash(
         grna => "$ucgpterm Name",
@@ -1620,36 +1583,31 @@
     } else {
         $showend = &Apache::lonlocal::locallocaltime($enddate);
     }
-    $r->print('<table border="0" cellpadding="0" cellspacing="20">');
     if ($action eq 'create') {
         $r->print('
-<tr>
- <td><font face="arial,helvetica,sans-serif"><b>'.$lt{'ygrs'}.'</b></font>
+<div><span>'.$lt{'ygrs'}.'</span>
 <br />'.$lt{'tfwa'}.'
- </td>
-</tr>');
+</div>');
     }
-    $r->print('<tr><td>');
-    $r->print(&Apache::lonhtmlcommon::start_pick_box());
+    $r->print(&Apache::loncommon::start_data_table('LC_course_group_status').
+	      &Apache::loncommon::start_data_table_header_row());
     $r->print('
-<tr>
- <td>
-<table cellspacing="1" cellpadding="4">
- <tr bgcolor="'.$tabcol.'" align="center">
-  <td><b>'.$lt{'grna'}.'</b></td>
-  <td><b>'.$lt{'desc'}.'</b></td>
-  <td><b>'.$lt{'grfn'}.'</b></td>
-  <td><b>'.$lt{'gran'}.'</b></td>
-  <td><b>'.$lt{'quot'}.'</b></td>
-  <td><b>'.$lt{'dfac'}.'</b></td>
- </tr>
- <tr bgcolor="'.$rowColor2.'">
-  <td valign="top"><small>'.$groupname.'</small></td>
-  <td valign="top"><small>'.$description.'</small></td>
+  <th>'.$lt{'grna'}.'</th>
+  <th>'.$lt{'desc'}.'</th>
+  <th>'.$lt{'grfn'}.'</th>
+  <th>'.$lt{'gran'}.'</th>
+  <th>'.$lt{'quot'}.'</th>
+  <th>'.$lt{'dfac'}.'</th>
+');
+    $r->print(&Apache::loncommon::end_data_table_header_row().
+	      &Apache::loncommon::start_data_table_row('LC_data_table_dense'));
+    $r->print('
+  <td valign="top">'.$groupname.'</td>
+  <td valign="top">'.$description.'</td>
   <td>
 ');
     if (@{$available} > 0) {
-        $r->print('<small><b>Available:</b></small>
+        $r->print('<b>Available:</b>
                     <table cellpadding="" cellspacing="1"><tr>');
         my $rowcell = int(@{$available}/2) + @{$available}%2;
         for (my $i=0; $i<@{$available}; $i++) {
@@ -1658,8 +1616,8 @@
                     $r->print('</tr><tr>');
                 }
             }
-            $r->print('<td><small>'.$$functions{$$available[$i]}.
-                                          '</small></td><td>&nbsp;</td>');
+            $r->print('<td>'.$$functions{$$available[$i]}.
+		      '</td><td>&nbsp;</td>');
         }
         if ((@{$available} > 3) && (@{$available}%2)) {
             $r->print('<td>&nbsp;</td><td>&nbsp;</td>');
@@ -1667,7 +1625,7 @@
         $r->print('</tr></table><br />');
     }
     if (@{$unavailable} > 0) {
-        $r->print('<small><b>Unavailable:</b></small>
+        $r->print('<b>Unavailable:</b>
                     <table cellpadding="0" cellspacing="1"  border="0"><tr>');
         my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2;
         for (my $j=0; $j<@{$unavailable}; $j++) {
@@ -1676,8 +1634,8 @@
                     $r->print('</tr><tr>');
                 }
             }
-            $r->print('<td><small>'.$$functions{$$unavailable[$j]}.
-                                              '</small></td><td>&nbsp;</td>');
+            $r->print('<td>'.$$functions{$$unavailable[$j]}.
+		      '</td><td>&nbsp;</td>');
         }
         if ((@{$unavailable} > 3) && (@{$unavailable}%2)) {
             $r->print('<td>&nbsp;</td><td>&nbsp;</td>');
@@ -1686,19 +1644,14 @@
     }
     $r->print(<<"END");
   </td>
-  <td valign="top"><small><b>$lt{'difn'}
-  </b> $granularity</small></td>
-  <td valign="top"><small>$quota Mb</small></td> 
-  <td valign="top"><small><b>$lt{'stda'}</b> $showstart<br />
-      <b>$lt{'enda'}</b> $showend</small>
+  <td valign="top"><b>$lt{'difn'}</b> $granularity</td>
+  <td valign="top">$quota Mb</td> 
+  <td valign="top"><b>$lt{'stda'}</b> $showstart<br />
+      <b>$lt{'enda'}</b> $showend
   </td>
- </tr>
-</table>
-</td>
-</tr>
 END
-    $r->print(&Apache::lonhtmlcommon::end_pick_box());
-    $r->print('</td></tr></table><br />');
+    $r->print(&Apache::loncommon::end_data_table_row().
+	      &Apache::loncommon::end_data_table());
     return;
 }
 
@@ -1741,7 +1694,7 @@
             $r->print(&check_uncheck_tools($r,$available));
         }
     }
-    &topic_bar($r,$tabcol,$img,$lt{'gpme'});
+    &topic_bar($r,$img,$lt{'gpme'});
     if (keys(%members) > 0) {
         $r->print('
  <tr>
@@ -1917,12 +1870,7 @@
             }
         }
     }
-    &topic_bar($r,$tabcol,$img,$lt{'uprv'});
-    $r->print('
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
-  ');
+    &topic_bar($r,$img,$lt{'uprv'});
     if ((($action eq 'create') && (@{$available} > 0)) || 
         (($action eq 'modify') && ($formname eq 'change_settings'))) {  
         my %specific = (
@@ -1948,21 +1896,14 @@
         }
         if ($totaloptionalprivs) {
             $r->print('
-<br /><br /><label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' />&nbsp;'.$lt{'algm'}.'</nobr></label><br/>
-<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' />&nbsp;'.$lt{'smgp'}.'</nobr></label>
-  </td>
- </tr>
- <tr>
-  <td colspan="4">&nbsp;</td>
- </tr>');
+<br /><br />
+<label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' />&nbsp;'.$lt{'algm'}.'</nobr></label><br />
+<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' />&nbsp;'.$lt{'smgp'}.'</nobr></label>');
         } else {
             $r->print('<input type="hidden" name="specificity" value="No" />');
         }
         if ($totaloptionalprivs) {
-            $r->print('
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">'.$lt{'plin'});
+            $r->print($lt{'plin'});
             if ($action eq 'create') {
                 $r->print(' '.$lt{'thwi'});
             }
@@ -1973,24 +1914,15 @@
                 $r->print('('.&mt('if enabled below').').');
             }
             $r->print('<br /><br />
-  </td>
- </tr>
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="2"><table><tr>');
+  <table><tr>');
         &check_uncheck_buttons($r,$formname,'defpriv',$lt{'oppr'});
         $r->print('
     </tr>
    </table>
-  </td>
-  <td width="100%">&nbsp;</td>
- </tr><tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
    <br />
 ');
         } else {
-            $r->print('<tr><td>&nbsp;</td><td colspan="3">'.$lt{'algm'}.'<br /><br />');
+            $r->print($lt{'algm'}.'<br /><br />');
         }
         &default_privileges($r,$action,$tabcol,$rowColor1,$rowColor2,
                             $tools,$toolprivs,$fixedprivs,$available);
@@ -2013,10 +1945,6 @@
                               $toolprivs,\@defprivs);
         }
     }
-    $r->print('
-  </td>
- </tr>
-');
     return;
 }
 
@@ -2189,19 +2117,18 @@
 <br />
 <table width="100%" cellpadding="0" cellspacing="0" border="0">
 ');
-    &topic_bar($r,$tabcol,1,$lt{'grse'});
+    &topic_bar($r,1,$lt{'grse'});
     $r->print('
  <tr>
   <td>&nbsp;</td>
   <td colspan="3">
 ');
-    &print_current_settings($r,$action,$tabcol,$rowColor1,$rowColor2,
-                            $functions,$startdate,$enddate,$groupname,
-                            $description,$granularity,$quota,\@available,
-                            \@unavailable,$gpterm,$ucgpterm);
+    &print_current_settings($r,$action,$functions,$startdate,$enddate,
+			    $groupname,$description,$granularity,$quota,
+			    \@available,\@unavailable,$gpterm,$ucgpterm);
 $r->print('
 </td></tr><tr><td colspan="4">&nbsp;</td></tr>');
-    &topic_bar($r,$tabcol,2,$lt{'mogm'});
+    &topic_bar($r,2,$lt{'mogm'});
     $r->print('
  <tr>
   <td>&nbsp;</td>
@@ -2474,7 +2401,7 @@
         $nexttext = $$navbuttons{'mose'};
     }
     $r->print('<br /><table width="100%" cellpadding="0" cellspacing="0" border="0">');
-    &topic_bar($r,$tabcol,3,&mt('Members to delete or expire'));
+    &topic_bar($r,3,&mt('Members to delete or expire'));
     my $exp_or_del = 0;
     if (ref($$memchg{'deletion'}) eq 'ARRAY') {
         if (@{$$memchg{'deletion'}} > 0) {
@@ -2503,7 +2430,7 @@
                   '</td></tr><tr><td colspan="4">&nbsp;</td></tr>');
     }
     
-    &topic_bar($r,$tabcol,4,&mt('[_1] member privileges',$ucgpterm));
+    &topic_bar($r,4,&mt('[_1] member privileges',$ucgpterm));
 
     my $numchgs = &member_privileges_form($r,$tabcol,$action,$formname,$tools,
                                           $toolprivs,$fixedprivs,$userdata,
@@ -2526,34 +2453,18 @@
     my ($r,$tabcol,$action,$formname,$page,$startdate,$enddate,$groupname,
         $description,$granularity,$quota,$sectioncount,$tools,$functions,
         $stored,$states,$navbuttons,$rowColor1,$rowColor2,$gpterm,$ucgpterm)=@_; 
-    $r->print(' <br />
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
-');
+    $r->print(' <br />');
     my @available = ();
     my @unavailable = ();
     &check_tools($functions,$tools,\@available,\@unavailable);
-    &print_current_settings($r,$action,$tabcol,$rowColor1,$rowColor2,
-                            $functions,$startdate,$enddate,$groupname,
-                            $description,$granularity,$quota,\@available,
-                            \@unavailable,$gpterm,$ucgpterm);
-    $r->print('
-   </td>
-  </tr>
-  <tr>
-   <td colspan="4">&nbsp;</td>
-  </tr>');
-
-    &membership_options($r,$action,$formname,$tabcol,$sectioncount,1,$gpterm,
-                        $ucgpterm);
+    &print_current_settings($r,$action,$functions,$startdate,$enddate,
+			    $groupname,$description,$granularity,$quota,
+			    \@available,\@unavailable,$gpterm,$ucgpterm);
+    &membership_options($r,$action,$formname,$sectioncount,1,$gpterm,$ucgpterm);
     my $nexttext = $$navbuttons{'gtns'};
     my $prevtext = $$navbuttons{'gtpp'};
     &display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
                         $$states{$action}[$page+1],$nexttext);
-    $r->print('
- </table>');
     return;
 }
 
@@ -2579,7 +2490,7 @@
     }
 
     $r->print('<br /><table width="100%" cellpadding="0" cellspacing="0" border="0">');
-    &topic_bar($r,$tabcol,6,&mt('[_1] member privileges',$ucgpterm));
+    &topic_bar($r,6,&mt('[_1] member privileges',$ucgpterm));
 
     &member_privileges_form($r,$tabcol,$action,$formname,$tools,$toolprivs,
                             $fixedprivs,$userdata,$usertools,$idx,undef,
@@ -3271,7 +3182,7 @@
     if (exists($$stored{'autodrop'})) {
         $drop = $$stored{'autodrop'};
     }
-    &topic_bar($r,$tabcol,$image,$$lt{'endi'});
+    &topic_bar($r,$image,$$lt{'endi'});
     $r->print('
   <tr>
    <td>&nbsp;</td>
@@ -3325,7 +3236,7 @@
         unshift(@sections,'none'); # Put 'no sections' next
         unshift(@sections,'all'); # Put 'all' at the front of the list
     }
-    &topic_bar($r,$tabcol,$image,$$lt{'pirs'});
+    &topic_bar($r,$image,$$lt{'pirs'});
     $r->print('
    <tr>
     <td>&nbsp;</td>
@@ -3788,22 +3699,12 @@
 }
 
 sub topic_bar {
-    my ($r,$tabcol,$imgnum,$title) = @_;
+    my ($r,$imgnum,$title) = @_;
     $r->print('
- <tr bgcolor="'.$tabcol.'">
-  <td>&nbsp;</td>
-  <td valign="middle" align="left">
-   <nobr>
-    <img src="/res/adm/pages/bl_step'.$imgnum.'.gif" valign="middle">&nbsp;
-   </nobr>
-  </td>
-  <th align="left"><nobr>'.$title.'<nobr>
-  </th>
-  <td width="100%">&nbsp;</td>
- </tr>
- <tr>
-  <td colspan="4">&nbsp;</td>
- </tr>
+<div class="LC_topic_bar">
+    <img src="/res/adm/pages/bl_step'.$imgnum.'.gif" />&nbsp;
+    <span>'.$title.'<span>
+</div>
 ');
     return;
 }

--albertel1152290901--