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

bisitz bisitz@source.lon-capa.org
Fri, 12 Feb 2010 17:22:25 -0000


bisitz		Fri Feb 12 17:22:25 2010 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmsgdisplay.pm 
  Log:
  - Standard alternating background color for internal message box rows; hover color not needed anymore(?)
  - Use standard data_table (call appropriate sub routines and removed now unnecessary styles)
  - Moved color indicator to status column
  - Localization: added missing &mt() call to status
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.937 loncom/interface/loncommon.pm:1.938
--- loncom/interface/loncommon.pm:1.937	Fri Feb 12 15:42:39 2010
+++ loncom/interface/loncommon.pm	Fri Feb 12 17:22:24 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.937 2010/02/12 15:42:39 bisitz Exp $
+# $Id: loncommon.pm,v 1.938 2010/02/12 17:22:24 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5025,8 +5025,7 @@
   background: $tabbg;
 }
 
-table.LC_data_table,
-table.LC_mail_list {
+table.LC_data_table {
   border: 1px solid #000000;
   border-collapse: separate;
   border-spacing: 1px;
@@ -5062,7 +5061,6 @@
 
 table.LC_data_table tr th,
 table.LC_calendar tr th,
-table.LC_mail_list tr th,
 table.LC_prior_tries tr th,
 table.LC_innerpickbox tr th {
   font-weight: bold;
@@ -5226,37 +5224,43 @@
   background-color: $data_table_highlight;
 }
 
-table.LC_mail_list tr.LC_mail_new {
+table.LC_data_table tr td.LC_mail_new {
   background-color: $mail_new;
 }
 
-table.LC_mail_list tr.LC_mail_new:hover {
+table.LC_data_table tr.LC_mail_new:hover {
   background-color: $mail_new_hover;
 }
 
-table.LC_mail_list tr.LC_mail_read {
+table.LC_data_table tr td.LC_mail_read {
   background-color: $mail_read;
 }
 
-table.LC_mail_list tr.LC_mail_read:hover {
+/*
+table.LC_data_table tr.LC_mail_read:hover {
   background-color: $mail_read_hover;
 }
+*/
 
-table.LC_mail_list tr.LC_mail_replied {
+table.LC_data_table tr td.LC_mail_replied {
   background-color: $mail_replied;
 }
 
-table.LC_mail_list tr.LC_mail_replied:hover {
+/*
+table.LC_data_table tr.LC_mail_replied:hover {
   background-color: $mail_replied_hover;
 }
+*/
 
-table.LC_mail_list tr.LC_mail_other {
+table.LC_data_table tr td.LC_mail_other {
   background-color: $mail_other;
 }
 
-table.LC_mail_list tr.LC_mail_other:hover {
+/*
+table.LC_data_table tr.LC_mail_other:hover {
   background-color: $mail_other_hover;
 }
+*/
 
 table.LC_data_table tr > td.LC_browser_file,
 table.LC_data_table tr > td.LC_browser_file_published {
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.148 loncom/interface/lonmsgdisplay.pm:1.149
--- loncom/interface/lonmsgdisplay.pm:1.148	Fri Feb 12 15:21:37 2010
+++ loncom/interface/lonmsgdisplay.pm	Fri Feb 12 17:22:24 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.148 2010/02/12 15:21:37 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.149 2010/02/12 17:22:24 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1098,7 +1098,9 @@
     if ($lastdis>$#temp) { $lastdis=$#temp; }
     $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus));
     $r->print('<form method="post" name="disall" action="/adm/email">'.
-	      '<table class="LC_mail_list"><tr><th colspan="1">&nbsp;</th><th>');
+	      &Apache::loncommon::start_data_table().
+          &Apache::loncommon::start_data_table_row().
+          '<th colspan="1">&nbsp;</th><th>');
     if ($env{'form.sortedby'} eq "revdate") {
 	$r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {
@@ -1128,7 +1130,7 @@
     } else {
         $r->print('<a href = "/adm/email?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');
     }
-    $r->print('</th><th>');
+    $r->print('</th><th colspan="2">');
     if ($env{'form.sortedby'} eq "revstatus") {
 	$r->print('<a href = "/adm/email?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');
     } else {
@@ -1142,17 +1144,19 @@
 	my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,
 	    $description,$recv_name,$recv_domain)= 
 		@{$temp[$n]};
-	if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
+        if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
+            my $class_msgstatus = '';
             $count ++;
-	    if ($status eq 'new') {
-		$r->print('<tr class="LC_mail_new">');
-	    } elsif ($status eq 'read') {
-		$r->print('<tr class="LC_mail_read">');
-	    } elsif ($status eq 'replied') {
-		$r->print('<tr class="LC_mail_replied">'); 
-	    } else {
-		$r->print('<tr class="LC_mail_other">');
-	    }
+            if ($status eq 'new') {
+                $class_msgstatus = 'LC_mail_new';
+            } elsif ($status eq 'read') {
+                $class_msgstatus = 'LC_mail_read';
+            } elsif ($status eq 'replied') {
+                $class_msgstatus = 'LC_mail_replied'; 
+            } else {
+                $class_msgstatus = 'LC_mail_other';
+            }
+            $r->print(&Apache::loncommon::start_data_table_row($class_msgstatus));
 	    my ($dis_name,$dis_domain) = ($fromname,$fromdomain);
 	    if ($folder eq 'sent') {
                 if (defined($recv_name) && defined($recv_domain)) {
@@ -1184,6 +1188,7 @@
                           '<a href="/adm/email?display='.$origID.$sqs.'">'.
                           $item.(($status eq 'new')?'</b>':'').'</a></td>');
             }
+            # Description and Status
             my $showstatus;
             my %statushash = &get_msgstatus_types();
             if ($status eq '') {
@@ -1191,18 +1196,27 @@
             } else {
                 $showstatus = $statushash{$status};
             }
-	    $r->print('<td>'.(($status eq 'new')?'<b>':'').$description.
-                      (($status eq 'new')?'</b>':'').'</td><td>'.
-                      (($status eq 'new')?'<b>':'').$showstatus.
-                      (($status eq 'new')?'</b>':'').'</td></tr>'."\n");
-	} elsif ($status eq 'deleted') {
+            $r->print('<td>'.(($status eq 'new')?'<b>':'').$description.
+                      (($status eq 'new')?'</b>':'').
+                      '</td>');
+            $r->print('<td class="'.$class_msgstatus.'">&nbsp;&nbsp;</td>'.
+                      '<td>'.
+                      (($status eq 'new')?'<b>':'').&mt($showstatus).
+                      (($status eq 'new')?'</b>':'').
+                      '</td>');
+
+            $r->print(&Apache::loncommon::end_data_table_row());
+
+        } elsif ($status eq 'deleted') {
 # purge
-	    my ($result,$msg) = 
-		&movemsg(&unescape($origID),$folder,'trash');
-	    
-	}
+            my ($result,$msg) = 
+        	&movemsg(&unescape($origID),$folder,'trash');
+        }
     }   
-    $r->print("</table>\n");
+    $r->print(&Apache::loncommon::end_data_table());
+
+
+    # Bottom Functions
     $r->print('<table border="0" cellspacing="2" cellpadding="8">
  <tr>
   <td>