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

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


This is a MIME encoded message

--albertel1152299841
Content-Type: text/plain

albertel		Fri Jul  7 15:17:21 2006 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm loncommon.pm loncoursegroups.pm 
  Log:
  - through step 4 of group creation cssed
  
  
--albertel1152299841
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060707151721.txt"

Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.142 loncom/interface/lonhtmlcommon.pm:1.143
--- loncom/interface/lonhtmlcommon.pm:1.142	Fri Jul  7 09:40:16 2006
+++ loncom/interface/lonhtmlcommon.pm	Fri Jul  7 15:17:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.142 2006/07/07 13:40:16 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.143 2006/07/07 19:17:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1399,14 +1399,19 @@
 }
 
 sub row_closure {
+    my ($no_separator) =@_;
     my $output = <<"ENDTWO";
             </td>
            </tr>
+ENDTWO
+    if (!$no_separator) {
+        $output .= <<"ENDTWO";
            <tr>
-            <td colspan="2" class="LC_pick_box_seperator">
+            <td colspan="2" class="LC_pick_box_separator">
             </td>
            </tr>
 ENDTWO
+    }
     return $output;
 }
 
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.423 loncom/interface/loncommon.pm:1.424
--- loncom/interface/loncommon.pm:1.423	Fri Jul  7 12:48:21 2006
+++ loncom/interface/loncommon.pm	Fri Jul  7 15:17:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.423 2006/07/07 16:48:21 albertel Exp $
+# $Id: loncommon.pm,v 1.424 2006/07/07 19:17:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3107,6 +3107,7 @@
     my $data_table_head      = $tabbg;
     my $data_table_light     = '#EEEEEE';
     my $data_table_dark      = '#DDD';
+    my $data_table_darker    = '#CCC';
     my $data_table_highlight = '#FFFF00';
     my $mail_new             = '#FFBB77';
     my $mail_new_hover       = '#DD9955';
@@ -3495,11 +3496,9 @@
   font-weight: bold;
   text-align: right;
   width: 184px;
-}
-table.LC_pick_box td {
   padding: 8px;
 }
-table.LC_pick_box td.LC_pick_box_seperator {
+table.LC_pick_box td.LC_pick_box_separator {
   padding: 0px;
   height: 1px;
   background: black;
@@ -3508,6 +3507,35 @@
   text-align: right;
 }
 
+table.LC_group_priv_box {
+  background: white;
+  border: 1px solid black;
+  border-spacing: 1px;
+}
+table.LC_group_priv_box td.LC_pick_box_title {
+  background: $tabbg;
+  font-weight: bold;
+  text-align: right;
+  width: 184px;
+}
+table.LC_group_priv_box td.LC_groups_fixed {
+  background: $data_table_light;
+  text-align: center;
+}
+table.LC_group_priv_box td.LC_groups_optional {
+  background: $data_table_dark;
+  text-align: center;
+}
+table.LC_group_priv_box td.LC_groups_functionality {
+  background: $data_table_darker;
+  text-align: center;
+  font-weight: bold;
+}
+table.LC_group_priv td {
+  text-align: left;
+  padding: 0px;
+}
+
 table.LC_notify_front_page {
   background: white;
   border: 1px solid black;
@@ -3516,6 +3544,9 @@
 table.LC_notify_front_page td {
   padding: 8px;
 }
+.LC_navbuttons {
+  margin: 2ex 0ex 2ex 0ex;
+}
 .LC_topic_bar {
   font-family: $sans;
   font-weight: bold;
@@ -3536,7 +3567,12 @@
 table.LC_status_selector td {
   vertical-align: top;
   text-align: center;
- padding: 4px;
+  padding: 4px;
+}
+table.LC_descriptive_input td.LC_description {
+  vertical-align: top;
+  text-align: right;
+  font-weight: bold;
 }
 
 END
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.41 loncom/interface/loncoursegroups.pm:1.42
--- loncom/interface/loncoursegroups.pm:1.41	Fri Jul  7 13:11:04 2006
+++ loncom/interface/loncoursegroups.pm	Fri Jul  7 15:17:19 2006
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursegroups.pm,v 1.41 2006/07/07 17:11:04 albertel Exp $
+# $Id: loncoursegroups.pm,v 1.42 2006/07/07 19:17:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1182,7 +1182,7 @@
         $toolprivs,$fixedprivs,$sectioncount,$stored,$states,$navbuttons,
         $rowColor1,$rowColor2,$gpterm,$ucgpterm,$crstype) = @_;
     my ($nexttext,$prevtext);
-    &groupsettings_options($r,$tabcol,$functions,$action,$formname,$stored,1,
+    &groupsettings_options($r,$functions,$action,$formname,$stored,1,
                            $gpterm,$ucgpterm,$crstype);
     &access_date_settings($r,$action,$formname,$stored,2,$gpterm,$ucgpterm);
     if ($action eq 'create') {
@@ -1209,7 +1209,7 @@
 }
 
 sub groupsettings_options {
-    my ($r,$tabcol,$functions,$action,$formname,$stored,$image,$gpterm,
+    my ($r,$functions,$action,$formname,$stored,$image,$gpterm,
         $ucgpterm,$crstype) = @_;
     my %lt = &Apache::lonlocal::texthash(
         'gdat' => "$ucgpterm open and close dates",
@@ -1225,9 +1225,9 @@
     my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored);
     &topic_bar($r,$image,$lt{'gnde'});
     $r->print('
-     <table border="0" cellpadding="2" cellspacing="2">
+     <table class="LC_descriptive_input">
       <tr>
-       <td><b>'.$lt{'gnam'}.':</b></td>
+       <td class="LC_description">'.$lt{'gnam'}.':</td>
        <td colspan="5">
 ');
     if ($action eq 'create') {
@@ -1240,13 +1240,13 @@
        </td>
       <tr>
       <tr>
-       <td><b>$lt{'desc'}:</b></td>
+       <td class="LC_description">$lt{'desc'}:</td>
        <td colspan="5"><input type="text" name="description" size="40"
                                                     value="" />
        </td>
       <tr>
       <tr>
-       <td><b>$lt{'func'}:</b></td>
+       <td class="LC_description">$lt{'func'}:</td>
 END
     my $numitems = keys(%{$functions});
     my $halfnum = int($numitems/2);
@@ -1280,7 +1280,7 @@
        </td>
       </tr>
       <tr>
-       <td><b>'.&mt('Granularity:').'</b></td>
+       <td class="LC_description">'.&mt('Granularity:').'</td>
        <td colspan="10">'.$lt{'doyo'}.'&nbsp;<label><input type="radio" name="granularity" value="Yes" />'.&mt('Yes').'</label>&nbsp;<label><input type="radio" name="granularity" value="No" checked="checked" />'.&mt('No').'</label>');
     if ($action eq 'modify') {
         $r->print('&nbsp;&nbsp;('.&mt('Currently set to "[_1]"',
@@ -1290,7 +1290,7 @@
        </td>
       </tr>
       <tr>
-       <td valign="top">'.&mt('<b>Disk quota:</b> ').'</td><td colspan="10">');
+       <td class="LC_description">'.&mt('Disk quota: ').'</td><td colspan="10">');
     if ($action eq 'create') {
         $r->print(&mt('If you enable the file repository for the [_1], allocate a disk quota.',$gpterm));
     } else {
@@ -1456,6 +1456,7 @@
     my $earlyout = &validate_groupname($groupname,$action,$cdom,$cnum,$gpterm,
                                        $ucgpterm,$crstype);
     if ($earlyout) {
+	$r->print($earlyout)
         &display_navbuttons($r,$formname,$$states{$action}[$page-1],
                            $$navbuttons{'gtps'});
         return;
@@ -1507,6 +1508,7 @@
 
 sub display_navbuttons {
     my ($r,$formname,$prev,$prevtext,$next,$nexttext) = @_;
+    $r->print('<div class="LC_navbuttons">');
     if ($prev) {
         $r->print('
       <input type="button" name="previous" value = "'.$prevtext.'"
@@ -1518,6 +1520,7 @@
       <input type="button" name="next" value="'.$nexttext.'"
  onclick="javascript:nextPage(document.'.$formname.','."'".$next."'".')" />');
     }
+    $r->print('</div>');
 }
 
 sub check_tools {
@@ -1558,7 +1561,7 @@
     }
     if ($action eq 'create') {
         $r->print('
-<div><span>'.$lt{'ygrs'}.'</span>
+<div><span style="font-size: larger">'.$lt{'ygrs'}.'</span>
 <br />'.$lt{'tfwa'}.'
 </div>');
     }
@@ -1670,9 +1673,6 @@
     &topic_bar($r,$img,$lt{'gpme'});
     if (keys(%members) > 0) {
         $r->print('
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
     <table>
      <tr>');
         &check_uncheck_buttons($r,$formname,'member',$lt{'addm'});
@@ -1687,16 +1687,8 @@
      </fieldset></nobr></td>');
         }
         $r->print('</tr></table>
-  </td>
- </tr>
- <tr>
-  <td colspan="4">&nbsp;</td>
- </tr>
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
         ');
-        $r->print(&Apache::lonhtmlcommon::start_pick_box());
+        $r->print(&Apache::loncommon::start_data_table());
         $r->print('
    <table border="0" cellpadding="4" cellspacing="1">
     <tr bgcolor="'.$tabcol.'" align="center">
@@ -1779,23 +1771,12 @@
             }
         }
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
-        $r->print('
-     </td>
-    </tr>');
     } else {
-        $r->print('
-    <tr>
-     <td>&nbsp;</td>
-     <td colspan="3">
-');
         if ($totalusers > 0) {
             $r->print($lt{'nnew'}.'<br /><br />'.$lt{'yoma'});
         } else { 
             $r->print($lt{'nome'});
         }
-        $r->print('
-     </td>
-    </tr>');
     }
     return $newusers;
 }
@@ -1897,8 +1878,8 @@
         } else {
             $r->print($lt{'algm'}.'<br /><br />');
         }
-        &default_privileges($r,$action,$tabcol,$rowColor1,$rowColor2,
-                            $tools,$toolprivs,$fixedprivs,$available);
+        &default_privileges($r,$action,$tools,$toolprivs,$fixedprivs,
+			    $available);
     } else {
         if ($action eq 'create') {
             $r->print($lt{'asyo'});
@@ -1922,76 +1903,70 @@
 }
 
 sub default_privileges {
-    my ($r,$action,$tabcol,$rowColor1,$rowColor2,$tools,$toolprivs,
-        $fixedprivs,$available) = @_;
+    my ($r,$action,$tools,$toolprivs,$fixedprivs,$available) = @_;
     my %lt = &Apache::lonlocal::texthash(
                                 'addp' => 'Additional privileges',
                                 'fixp' => 'Fixed privileges',
                                 'oppr' => 'Optional privileges',
                                 'func' => 'Function',
     );
-    $r->print(&Apache::loncommon::start_data_table().
-	      &Apache::loncommon::start_data_table_header_row());
-    $r->print('<th>'.$lt{'func'}.'</th>
-                  </tr>
-                  <tr>
-                   <td valign="top"><b>'.$lt{'fixp'}.'</b></td>
-                  </tr>
-                  <tr>
-                   <td valign="top"><b>'.$lt{'oppr'}.'</b></td>
-                  </tr>
-                 </table>
-                </td>
-    ');
+    $r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box').
+	      &Apache::lonhtmlcommon::row_title($lt{'func'},undef,
+						'LC_groups_functionality'));
+    $r->print(join('</td><td class="LC_groups_functionality">',@{$tools}));
+    $r->print(&Apache::lonhtmlcommon::row_closure(1));
+    my $fixed = '';
+    my $dynamic = '';
     foreach my $tool (@{$tools}) {
-        $r->print('<td align="center" valign="top">
-                    <table cellspacing="0" cellpadding="1">
-                     <tr bgcolor="#cccccc">
-                      <td colspan="2" align="center"><b>'.$tool.'</b></td>
-                     </tr>
-        ');
         my $privcount = 0;
-        my $fixed = '';
-        my $dynamic = '';
+	if ($dynamic ne '') {
+	    $dynamic .= '</td><td class="LC_groups_optional">';
+	}
+	$dynamic .= '<table class="LC_group_priv"><tr>';
         foreach my $priv (sort(keys(%{$$toolprivs{$tool}}))) {
             if (exists($$fixedprivs{$tool}{$priv})) {
+		if ($fixed ne '') {
+		    $fixed .= '</td><td class="LC_groups_fixed">';
+		}
                 $fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'&nbsp;';
                 if ($action eq 'modify') {
-                    if (grep/^$tool$/,@{$available}) {
+                    if (grep(/^$tool$/,@{$available})) {
                         $fixed .= '<small>'.&mt('(on)').'<small>&nbsp;';
                     } else {
                         $fixed .= '<small>'.&mt('(off)').'<small>&nbsp;';
                     }
                 }
             } else {
-                $privcount ++;
+                $privcount++;
                 if ($privcount == 3) {
                     $dynamic .= '</tr>
-                                 <tr bgcolor="'.$rowColor1.'">'."\n";
+                                 <tr>'."\n";
                 }
                 $dynamic .= '<td><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></td>'."\n";
             }
         }
-        if ($dynamic eq '') {
-            $dynamic = '<td>None</td>'."\n";
+        if ($privcount == 0) {
+            $dynamic .= '<td>None</td>'."\n";
         }
         if ($privcount < 3) {
-            $dynamic .= '</tr>
-                         <tr bgcolor="'.$rowColor1.'">
-                          <td colspan="2">&nbsp;</td>'."\n";
+            $dynamic .= '</td>
+                         <td>&nbsp;</td>'."\n";
         } elsif ($privcount%2) {
             $dynamic = '<td>&nbsp;</td>'."\n";
         }
-        $r->print('<tr bgcolor="'.$rowColor2.'">
-                    <td colspan="2" align="center"><nobr>'.$fixed.'</nobr></td>
-                   </tr>
-                   <tr bgcolor="'.$rowColor1.'">'."\n".$dynamic.'</tr>'."\n".'</table>'."\n".'</td>
-        ');
+	$dynamic .= '</tr></table>';
     }
-    $r->print('</tr>'."\n");
-    $r->print(&Apache::lonhtmlcommon::end_pick_box());
+    $r->print(&Apache::lonhtmlcommon::row_title($lt{'fixp'},undef,
+						'LC_groups_fixed').
+	      $fixed.
+	      &Apache::lonhtmlcommon::row_closure(1));
+    $r->print(&Apache::lonhtmlcommon::row_title($lt{'oppr'},undef,
+						'LC_groups_optional').
+	      $dynamic.
+	      &Apache::lonhtmlcommon::end_pick_box());
     $r->print('<br />');
     return;
+
 }
 
 sub display_defprivs {
@@ -3396,11 +3371,11 @@
     my $perpetual = 
 	'<nobr><label><input type="checkbox" name="no_end_date" />'.
 	&mt('None').'</label></nobr>';
-    my $table = "<table>\n".
-	'<tr><td align="right">'.&mt('Start:').'</td>'.
+    my $table = "<table class=\"LC_descriptive_input\">\n".
+	'<tr><td class="LC_description">'.&mt('Start:').'</td>'.
         '<td>'.$startform.'</td>'.
         '<td>&nbsp;</td>'."</tr>\n".
-	'<tr><td align="right">'.&mt('End:').'</td>'.
+	'<tr><td class="LC_description">'.&mt('End:').'</td>'.
         '<td>'.$endform.'</td>'.
         '<td>'.$perpetual.'</td>'."</tr>\n".
 	"</table>\n";
@@ -3635,8 +3610,8 @@
                               "existing $gpterm",    
     );
 
-    my $exitmsg = '<b>'.$lt{'igna'}.'</b><br /><br />'.$lt{'tgne'}.' "'.
-                  $groupname.'" ';
+    my $exitmsg = '<span class="LC_error">'.$lt{'igna'}.'</span><br /><br />'.
+	$lt{'tgne'}.' "'.$groupname.'" ';
     my $dupmsg = $lt{'grna'};
     my $earlyout;
     if (($groupname eq '') || ($groupname =~ /\W/)) {

--albertel1152299841--