[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm /localize/localize de.pm

bisitz bisitz@source.lon-capa.org
Wed, 10 Dec 2008 18:43:32 -0000


This is a MIME encoded message

--bisitz1228934612
Content-Type: text/plain

bisitz		Wed Dec 10 18:43:32 2008 EDT

  Modified files:              
    /loncom/localize/localize	de.pm 
    /loncom/interface	lonmeta.pm 
  Log:
  Optimized/standarized screen output for meta data:
  - Replaced hardcoded tables and hardcoded styles by pick_box / data_table
  - Replaced hardcoded style for obsolete warning by standard CSS warning
  - Corrected &mt() usage for table headline
  - Replaced <nobr> by LC_nobreak style
  ToDo: Proper pick_box endings
  
  
--bisitz1228934612
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20081210184332.txt"

Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.179 loncom/localize/localize/de.pm:1.180
--- loncom/localize/localize/de.pm:1.179	Wed Dec 10 14:36:40 2008
+++ loncom/localize/localize/de.pm	Wed Dec 10 18:43:27 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.179 2008/12/10 14:36:40 diwert Exp $
+# $Id: de.pm,v 1.180 2008/12/10 18:43:27 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11911,6 +11911,9 @@
    'Num Student'
 => 'Anz. Studenten',
 
+   'Num Students'
+=> 'Anz. Studenten',
+
    'Degree of Difficulty'
 => 'Schwierigkeitsgrad',
 
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.217 loncom/interface/lonmeta.pm:1.218
--- loncom/interface/lonmeta.pm:1.217	Sat Nov 29 20:46:35 2008
+++ loncom/interface/lonmeta.pm	Wed Dec 10 18:43:32 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.217 2008/11/29 20:46:35 schafran Exp $
+# $Id: lonmeta.pm,v 1.218 2008/12/10 18:43:32 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -888,9 +888,9 @@
     my $obsolete=$content{'obsolete'};
     my $obsoletewarning='';
     if (($obsolete) && ($env{'user.adv'})) {
-        $obsoletewarning='<p><font color="red">'.
+        $obsoletewarning='<p><span class="LC_warning">'.
             &mt('This resource has been marked obsolete by the author(s)').
-            '</font></p>';
+            '</span></p>';
     }
     #
     my %lt=&fieldnames();
@@ -927,23 +927,22 @@
 		   'obsoletereplacement');
     }
     foreach my $field (@fields) {
-        $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$field}.
-            '</td><td bgcolor="#CCCCCC">'.
-            &prettyprint($field,$content{$field}).'</td></tr>';
+        $table.=&Apache::lonhtmlcommon::row_title($lt{$field})
+               .&prettyprint($field,$content{$field})
+               .&Apache::lonhtmlcommon::row_closure();
         delete($content{$field});
     }
     #
-    $r->print(<<ENDHEAD);
-<h2>$title</h2>
-<p>
-$disuri<br />
-$obsoletewarning
-$versiondisplay
-</p>
-<table cellspacing="2" border="0">
-$table
-</table>
-ENDHEAD
+    $r->print("<h2>$title</h2>"
+             .'<p>'
+             .$disuri.'<br />'
+             .$obsoletewarning
+             .$versiondisplay
+             .'</p>'
+             .&Apache::lonhtmlcommon::start_pick_box()
+             .$table
+             .&Apache::lonhtmlcommon::end_pick_box()
+    );
     if (!$uploaded && $env{'user.adv'}) {
         &print_dynamic_metadata($r,$uri,\%content);
     }
@@ -970,17 +969,18 @@
         exists($dynmeta{'goto'}) ||
         exists($dynmeta{'course'})) {
         $r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'.
-                  '<table cellspacing="2" border="0">');
+                  &Apache::lonhtmlcommon::start_pick_box());
         foreach ('count',
                  'sequsage','sequsage_list',
                  'comefrom','comefrom_list',
                  'goto','goto_list',
                  'course','course_list') {
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                     .&prettyprint($_,$dynmeta{$_})
+                     .&Apache::lonhtmlcommon::row_closure()
+            );
         }
-        $r->print('</table>');
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
     } else {
         $r->print('<h4>'.&mt('No Access or Usages Statistics are available for this resource.').'</h4>');
     }
@@ -995,18 +995,18 @@
             $r->print('<h4>'.
                       &mt('Overall Assessment Statistical Data').
                       '</h4>'.
-                      '<table cellspacing="2" border="0">');
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint('stdno',$dynmeta{'stdno'}).
-                      '</td>'."</tr>\n");
+                      &Apache::lonhtmlcommon::start_pick_box());
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{'stdno'})
+                     .&prettyprint('stdno',$dynmeta{'stdno'})
+                     .&Apache::lonhtmlcommon::row_closure()
+            );
             foreach ('avetries','difficulty','disc') {
-                $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                          '<td bgcolor="#CCCCCC">'.
-                          &prettyprint($_,sprintf('%5.2f',$dynmeta{$_})).
-                          '</td>'."</tr>\n");
+                $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                         .&prettyprint($_,sprintf('%5.2f',$dynmeta{$_}))
+                         .&Apache::lonhtmlcommon::row_closure()
+                );
             }
-            $r->print('</table>');    
+            $r->print(&Apache::lonhtmlcommon::end_pick_box());
         }
         if (exists($dynmeta{'stats'})) {
             #
@@ -1014,16 +1014,16 @@
             $r->print('<h4>'.
                       &mt('Recent Detailed Assessment Statistical Data').
                       '</h4>');
-            my $table = '<table cellspacing="2" border="0">'.
-                '<tr>'.
-                '<th>'.&mt('Course').'</th>'.
-                '<th>'.&mt('Section(s)').'</th>'.
-                '<th>'.&mt('Num Student').'s</th>'.
-                '<th>'.&mt('Mean Tries').'</th>'.
-                '<th>'.&mt('Degree of Difficulty').'</th>'.
-                '<th>'.&mt('Degree of Discrimination').'</th>'.
-                '<th>'.&mt('Time of computation').'</th>'.
-                '</tr>'.$/;
+            my $table=&Apache::loncommon::start_data_table()
+                     .&Apache::loncommon::start_data_table_header_row()
+                     .'<th>'.&mt('Course').'</th>'
+                     .'<th>'.&mt('Section(s)').'</th>'
+                     .'<th>'.&mt('Num Students').'</th>'
+                     .'<th>'.&mt('Mean Tries').'</th>'
+                     .'<th>'.&mt('Degree of Difficulty').'</th>'
+                     .'<th>'.&mt('Degree of Discrimination').'</th>'
+                     .'<th>'.&mt('Time of computation').'</th>'
+                     .&Apache::loncommon::end_data_table_header_row().$/;
             foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) {
                 my $data = $dynmeta{'stats'}->{$identifier};
                 my $course = $data->{'course'};
@@ -1034,9 +1034,9 @@
                     &Apache::lonnet::logthis('lookup for '.$course.' failed');
                     next;
                 }
-                $table .= '<tr>';
+                $table .= &Apache::loncommon::start_data_table_row();
                 $table .= 
-                    '<td><nobr>'.$courseinfo{'description'}.'</nobr></td>';
+                    '<td><span class="LC_nobreak">'.$courseinfo{'description'}.'</span></td>';
                 $table .= 
                     '<td align="right">'.$data->{'sections'}.'</td>';
                 $table .=
@@ -1051,13 +1051,12 @@
                     $table .= '</td>';
                 }
                 $table .=
-                    '<td><nobr>'.
+                    '<td><span class="LC_nobreak">'.
                     &Apache::lonlocal::locallocaltime($data->{'timestamp'}).
-                    '</nobr></td>';
-                $table .=
-                    '</tr>'.$/;
+                    '</span></td>';
+                $table .= &Apache::loncommon::end_data_table_row().$/;
             }
-            $table .= '</table>'.$/;
+            $table .= &Apache::loncommon::end_data_table().$/;
             $r->print($table);
         } else {
             $r->print(&mt('No new dynamic data found.'));
@@ -1076,13 +1075,14 @@
         exists($dynmeta{'correct'}) || 
         exists($dynmeta{'technical'})){ 
         $r->print('<h4>'.&mt('Evaluation Data').'</h4>'.
-                  '<table cellspacing="2" border="0">');
+                  &Apache::lonhtmlcommon::start_pick_box());
         foreach ('clear','depth','helpful','correct','technical') {
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                     .&prettyprint($_,$dynmeta{$_})
+                     .&Apache::lonhtmlcommon::row_closure()
+            );
         }
-        $r->print('</table>');
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
     } else {
         $r->print('<h4>'.&mt('No Evaluation Data is available for this resource.').'</h4>');
     }
@@ -1110,7 +1110,8 @@
     # All other stuff
     $r->print('<h3>'.
               &mt('Additional Metadata (non-standard, parameters, exports)').
-              '</h3><table border="0" cellspacing="1">');
+              '</h3>');
+    $r->print(&Apache::lonhtmlcommon::start_pick_box());
     foreach (sort(keys(%content))) {
         my $name=$_;
         if ($name!~/\.display$/) {
@@ -1128,14 +1129,16 @@
                                                   $name.'.'.$_).'; ';
                 }
             }
-            $r->print('<tr><td bgcolor="#bbccbb"><font size="-1" color="#556655">'.$display.'</font></td><td bgcolor="#ccddcc"><font size="-1" color="#556655">'.$content{$name});
+            $r->print(&Apache::lonhtmlcommon::row_title($display)
+                     .$content{$name}
+            );
             if ($otherinfo) {
                 $r->print(' ('.$otherinfo.')');
             }
-            $r->print("</font></td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_closure());
         }
     }
-    $r->print("</table>");
+    $r->print(&Apache::lonhtmlcommon::end_pick_box());
     return;
 }
 

--bisitz1228934612--