[LON-CAPA-cvs] cvs: loncom /localize/localize de.pm zh.pm /publisher londiff.pm
bisitz
bisitz@source.lon-capa.org
Thu, 14 May 2009 12:02:25 -0000
bisitz Thu May 14 12:02:25 2009 EDT
Modified files:
/loncom/publisher londiff.pm
/loncom/localize/localize de.pm zh.pm
Log:
Various optimizations:
- Don't use <h1> for info text
- Don't display navigation bar in pop up window (Added parameter no_nav_bar to start_page call)
- Co-Author username display:
- Consistent username:domain output
- Now also display plainname and not only username
- Use warning style (as it is done elsewhere, too, in these cases)
- Added info text when no diffs are found
Index: loncom/publisher/londiff.pm
diff -u loncom/publisher/londiff.pm:1.25 loncom/publisher/londiff.pm:1.26
--- loncom/publisher/londiff.pm:1.25 Thu Nov 20 14:37:30 2008
+++ loncom/publisher/londiff.pm Thu May 14 12:02:14 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to show differences between file versions
#
-# $Id: londiff.pm,v 1.25 2008/11/20 14:37:30 jms Exp $
+# $Id: londiff.pm,v 1.26 2009/05/14 12:02:14 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -107,15 +107,19 @@
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- $r->print(&Apache::loncommon::start_page('Resource Differences'));
-
+ $r->print(&Apache::loncommon::start_page('Resource Differences',undef,
+ {'no_nav_bar' => 1, }));
- $r->print('<h1>'.($env{'form.filetwo'}?'':&mt('Compare versions of')).
- ' <tt>'.$efn.'</tt></h1>');
+ $r->print(($env{'form.filetwo'}?'':&mt('Compare versions of')).
+ ' <span class="LC_filename">'.$efn.'</span>');
if (($cuname ne $env{'user.name'}) || ($cudom ne $env{'user.domain'})) {
- $r->print('<h3><span class="LC_diff_coauthor">Co-Author: '.$cuname.' at '.$cudom.
- '</span></h3>');
+ $r->print('<p><span class="LC_warning">'
+ .&mt('Co-Author: [_1]'
+ ,&Apache::loncommon::plainname($cuname,$cudom)
+ .' ('.$cuname.':'.$cudom.')')
+ .'</span></p>'
+ );
}
@@ -176,28 +180,27 @@
# Run diff
my $diffs = diff(\@f1, \@f2);
-
-# Start page output
- my $chunk;
- my $line;
-
- $r->print('<pre>');
-
- foreach $chunk (@$diffs) {
-
- foreach $line (@$chunk) {
- my ($sign, $lineno, $text) = @$line;
- $text=&HTML::Entities::encode($text,'<>&"');
- $lineno=substr($lineno.' ',0,7);
- $r->print('<span class="'.(($sign eq '+')?'LC_diff_added'
- :'LC_diff_removed').'">'.
- $sign.' '.$lineno.' '.$text."</span>\n");
- }
- $r->print("</pre><hr /><pre>\n");
- }
- $r->print('</pre>');
-
+ if (@$diffs) {
+ # Start page output
+ my $chunk;
+ my $line;
+ $r->print('<pre>');
+ foreach $chunk (@$diffs) {
+ foreach $line (@$chunk) {
+ my ($sign, $lineno, $text) = @$line;
+ $text=&HTML::Entities::encode($text,'<>&"');
+ $lineno=substr($lineno.' ',0,7);
+ $r->print('<span class="'.(($sign eq '+')?'LC_diff_added'
+ :'LC_diff_removed').'">'.
+ $sign.' '.$lineno.' '.$text."</span>\n");
+ }
+ $r->print("</pre><hr /><pre>\n");
+ }
+ $r->print('</pre>');
+ } else {
+ $r->print('<p class="LC_info">'.&mt('No differences found').'</p>');
+ }
} else {
$r->print('<h1><span class="LC_warning">'.&mt('Binary File').'</span></h1>');
}
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.294 loncom/localize/localize/de.pm:1.295
--- loncom/localize/localize/de.pm:1.294 Tue May 12 15:20:29 2009
+++ loncom/localize/localize/de.pm Thu May 14 12:02:24 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.294 2009/05/12 15:20:29 bisitz Exp $
+# $Id: de.pm,v 1.295 2009/05/14 12:02:24 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -267,8 +267,8 @@
'Co-Author'
=> 'Co-Autor',
- 'Co-Author [_1]:[_2]'
-=> 'Co-Autor [_1]:[_2]',
+ 'Co-Author: [_1]'
+=> 'Co-Autor: [_1]',
'Communication and Messages'
=> 'Kommunikation und Nachrichten',
@@ -3609,6 +3609,9 @@
'Compare versions of'
=> 'Vergleiche Versionen von',
+ 'No differences found'
+=> 'Keine Unterschiede gefunden',
+
'Completely new course'
=> 'Komplett neuer Kurs',
Index: loncom/localize/localize/zh.pm
diff -u loncom/localize/localize/zh.pm:1.50 loncom/localize/localize/zh.pm:1.51
--- loncom/localize/localize/zh.pm:1.50 Thu May 7 12:42:17 2009
+++ loncom/localize/localize/zh.pm Thu May 14 12:02:24 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Chinese Simplified Localization Lexicon
#
-# $Id: zh.pm,v 1.50 2009/05/07 12:42:17 bisitz Exp $
+# $Id: zh.pm,v 1.51 2009/05/14 12:02:24 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -258,8 +258,8 @@
'Co-Author'
=> '合著者',
- 'Co-Author [_1]:[_2]'
-=> '合著者 [_1]:[_2]',
+ 'Co-Author: [_1]'
+=> '合著者 [_1]',
'Communication and Messages'
=> '通信与信息',
@@ -3641,6 +3641,9 @@
'Compare versions of'
=> 'Vergleiche Versionen von',
+ 'No differences found'
+=> 'Keine Unterschiede gefunden',
+
'Completely new course'
=> 'Komplett neuer Kurs',