[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

bisitz bisitz@source.lon-capa.org
Fri, 03 Jul 2009 14:52:47 -0000


bisitz		Fri Jul  3 14:52:47 2009 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - Use new Box style for problem template list
    (not so) quick and (not so) dirty solution: way of building categories and two columns should be revisited.
  - Corrected nested tags issue (a / font)
  - Replaced font tag by style
  - XHTML: Replaced "<p><form..." by "<div></form..."
  - Corrected unbalanced tags (added missing <div>)
  - Use info style for info message about what to do
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.313 loncom/homework/lonhomework.pm:1.314
--- loncom/homework/lonhomework.pm:1.313	Tue Jun 30 10:18:47 2009
+++ loncom/homework/lonhomework.pm	Fri Jul  3 14:52:47 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.313 2009/06/30 10:18:47 bisitz Exp $
+# $Id: lonhomework.pm,v 1.314 2009/07/03 14:52:47 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1101,15 +1101,21 @@
     }
     my $count = 0;
     my $currentcategory='';
+    my $first = 1;
     foreach my $file (@files) {
 	next if ($file->[1] !~ /\S/);
         if ($file->[2] ne $currentcategory) {
            $currentcategory=$file->[2];
            if ((!$seconddiv) && ($count >= $midpoint)) {
-               $result .= '</div>'."\n".'<div class="LC_left_float">'."\n";
+               $result .= '</div></div>'."\n".'<div class="LC_left_float">'."\n";
                $seconddiv = 1;
+           } elsif (!$first) {
+               $result.='</div>'."\n";
+           } else {
+               $first = 0;
            }
-           $result.='<h3>'.$currentcategory.'</h3>';
+           $result.= '<div class="LC_Box">'."\n"
+                    .'<h3 class="LC_hcell">'.$currentcategory.'</h3>'."\n";
            $count++;
         }
 	$result .=
@@ -1120,11 +1126,13 @@
         }
         my $filename=$file->[0];
         $filename=~s/^\/home\/httpd\/html//;
-        $result.=' <font size="-2"><a href="'.$filename.'" target="sample">'.&mt('Example').'</font></a><br />'."\n";
+        $result.=' <span class="LC_fontsize_small">'
+                .'<a href="'.$filename.'" target="sample">'.&mt('Example').'</a>'
+                .'</span><br />'."\n";
         $count ++;
     }
     if ($numfiles > 0) {
-        $result .= '</div>'."\n".'<div class="LC_clear_float_footer"></div>'."\n";
+        $result .= '</div></div>'."\n".'<div class="LC_clear_float_footer"></div>'."\n";
     }
     return $result;
 }
@@ -1173,19 +1181,18 @@
        .'<h1>'.&mt("Creating a new $extension resource.")."</h1>
 $errormsg
 ".&mt("The requested file [_1] currently does not exist.",
-      '<span class="LC_filename">'.$shownurl.'</span>')."
-<p>
-<b>
-".&mt("To create a new $extension, select a template from the".
-      " list below. Then click on the \"Create $extension\" button.").'</b>
-</p><form action="'.$url.'" method="post">');
+      '<span class="LC_filename">'.$shownurl.'</span>').'
+<p class="LC_info">
+'.&mt("To create a new $extension, select a template from the".
+      " list below. Then click on the \"Create $extension\" button.").'
+</p><div><form action="'.$url.'" method="post">');
 
 	if (defined($templatelist)) {
 	    $request->print($templatelist);
 	}
 	$request->print('<br /><input type="submit" name="newfile" value="'.
 			&mt("Create $extension").'" />');
-	$request->print("</form></p>".&Apache::loncommon::end_page());
+	$request->print('</form></div>'.&Apache::loncommon::end_page());
     }
     return;
 }