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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 03 Jul 2007 00:17:43 -0000


This is a MIME encoded message

--albertel1183421863
Content-Type: text/plain

albertel		Mon Jul  2 20:17:43 2007 EDT

  Modified files:              
    /loncom/interface	londocs.pm loncommon.pm 
  Log:
  - switch red to LC_error
  - some mt
  - convert top table into <div> so they wrap nicvely on smaller screens and reduce possibility fo side scrollign
  
  
--albertel1183421863
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20070702201743.txt"

Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.282 loncom/interface/londocs.pm:1.283
--- loncom/interface/londocs.pm:1.282	Mon Jul  2 19:43:36 2007
+++ loncom/interface/londocs.pm	Mon Jul  2 20:17:42 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.282 2007/07/02 23:43:36 albertel Exp $
+# $Id: londocs.pm,v 1.283 2007/07/03 00:17:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -122,16 +122,17 @@
     my ($home,$other,%outhash)=&authorhosts();
     my $type = &Apache::loncommon::course_type();
     if ($home+$other==0) { return ''; }
-    my $output='</td><td bgcolor="#DDDDCC">';
     if ($home) {
-	return '</td><td bgcolor="#DDDDCC">'.
+	return '<div>'.
 	    '<input type="submit" name="dumpcourse" value="'.
 	    &mt('Dump '.$type.' DOCS to Construction Space').'" />'.
-	    &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs');
+	    &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').
+	    '</div>';
     } else {
-	return'</td><td bgcolor="#DDDDCC">'.
+	return '<div>'.
      &mt('Dump '.$type.
-	 ' DOCS to Construction Space: available on other servers');
+	 ' DOCS to Construction Space: available on other servers').
+	 '</div>';
     }
 }
 
@@ -199,9 +200,9 @@
 		$fail=1;
 	    }
 	    if ($fail) {
-		$r->print('<font color="red">fail</font>');
+		$r->print('<span class="LC_error">'.&mt('fail').'</span>');
 	    } else {
-		$r->print('<font color="green">ok</font>');
+		$r->print('<span class="LC_success">'.&mt('ok').'</span>');
 	    }
 	}
     } else {
@@ -257,10 +258,10 @@
 
 sub exportbutton {
     my $type = &Apache::loncommon::course_type();
-    return '</td><td bgcolor="#DDDDCC">'.
+    return '<div>'.
             '<input type="submit" name="exportcourse" value="'.
             &mt('Export '.$type.' to IMS').'" />'.
-    &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
+    &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'</div>';
 }
 
 sub exportcourse {
@@ -1255,7 +1256,7 @@
     my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain)=&breadcrumbs($folder);
     $r->print($breadcrumbtrail);
     if ($fatal) {
-	   $r->print('<p><font color="red">'.$errtext.'</font></p>');
+	   $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
     } else {
 # ------------------------------------------------------------ Process commands
 
@@ -1296,7 +1297,7 @@
 # store the changed version
 		($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
 		if ($fatal) {
-		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		    $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		    return;
 		}
 	    }
@@ -1336,7 +1337,7 @@
 # store the changed version
 		($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
 		if ($fatal) {
-		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		    $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		    return;
 		}
 	    }
@@ -1370,7 +1371,7 @@
 # Store the result
 		($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
 		if ($fatal) {
-		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		    $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		    return;
 		}
 
@@ -1427,7 +1428,7 @@
 		($errtext,$fatal)=&storemap($coursenum,$coursedom,
 					    $folder.'.'.$container);
 		if ($fatal) {
-		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		    $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		    return;
 		}
             }
@@ -1447,7 +1448,7 @@
 		($errtext,$fatal)=&group_import($coursenum, $coursedom, $folder,
 					       $container,'londocs',@imports);
 		if ($fatal) {
-		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		    $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		    return;
 		}
             }
@@ -1464,11 +1465,12 @@
   	          ($errtext,$fatal)=&storemap($coursenum,$coursedom,
 					   $folder.'.'.$container);
 	          if ($fatal) {
-		      $r->print('<p><font color="red">'.$errtext.'</font></p>');
+		      $r->print('<p><span class="LC_error">'.$errtext.'</span></p>');
 		      return;
 	          }
                } else {
-                   $r->print('<p><font color="red">'.&mt('No map selected.').'</font></p>');
+		    $r->print('<p><span class="LC_error">'.&mt('No map selected.').'</span></p>');
+
                }
            }
            &log_differences($plain);
@@ -1569,7 +1571,7 @@
         ($errtext,$fatal)=&storemap($coursenum,$coursedom,
 				    $folder.'.'.$container);
         if ($fatal) {
-            $$upload_output .= '<p><font color="red">'.$errtext.'</font></p>';
+            $$upload_output .= '<p><span class="LC_error">'.$errtext.'</span></p>';
             return 'failed';
         } else {
             if ($parseaction eq 'parse') {
@@ -2011,17 +2013,17 @@
                  if (($errorcount) ||
                      ($warningcount)) {
 		     if ($errorcount) {
-                        $r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'.
+                        $r->print('<img src="/adm/lonMisc/bomb.gif" /><span class="LC_error">'.
 			  $errorcount.' '.
-				  &mt('error(s)').'</b></font> ');
+				  &mt('error(s)').'</span> ');
                      }
 		     if ($warningcount) {
-                        $r->print('<font color="blue">'.
+                        $r->print('<span class="LC_warning">'.
 			  $warningcount.' '.
-				  &mt('warning(s)').'</font>');
+				  &mt('warning(s)').'</span>');
                      }
                  } else {
-                     $r->print('<font color="green">'.&mt('ok').'</font>');
+                     $r->print('<span class="LC_success">'.&mt('ok').'</span>');
                  }
                  $r->rflush();
              }
@@ -2033,15 +2035,15 @@
                  }
              }
           } elsif ($result eq 'unavailable') {
-             $r->print('<font color="red"><b>'.&mt('connection down').'</b></font>');
+             $r->print('<span class="LC_error">'.&mt('connection down').'</span>');
           } elsif ($result eq 'not_found') {
 	      unless ($url=~/\$/) {
-		  $r->print('<font color="red"><b>'.&mt('not found').'</b></font>');
+		  $r->print('<span class="LC_error">'.&mt('not found').'</b></font>');
 	      } else {
-		  $r->print('<font color="yellow"><b>'.&mt('unable to verify variable URL').'</b></font>');
+		  $r->print('<span class="LC_unknown">'.&mt('unable to verify variable URL').'</span>');
 	      }
           } else {
-             $r->print('<font color="red"><b>'.&mt('access denied').'</b></font>');
+             $r->print('<span class="LC_error">'.&mt('access denied').'</span>');
           }
       }
    }
@@ -2083,9 +2085,9 @@
    foreach (keys %hash) {
        if ($hash{$_}=~/\.(page|sequence)$/) {
 	   if (($_=~/^src_/) && ($alreadyseen{&unescape($hash{$_})})) {
-	       $r->print('<hr /><font color="red">'.
+	       $r->print('<hr /><span class="LC_error">'.
 			 &mt('The following sequence or page is included more than once in your '.$type.': ').
-			 &unescape($hash{$_}).'</font><br />'.
+			 &unescape($hash{$_}).'</span><br />'.
 			 &mt('Note that grading records for problems included in this sequence or folder will overlap.<hr />'));
 	   }
        }
@@ -2165,7 +2167,7 @@
 			  $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {		
 	    $r->print('<h1>'.&mt('Your Version Settings have been Saved').'</h1>');
 	} else {
-	    $r->print('<h1><font color="red">'.&mt('An Error Occured while Attempting to Save your Version Settings').'</font></h1>');
+	    $r->print('<h1><span class="LC_error">'.&mt('An Error Occured while Attempting to Save your Version Settings').'</span></h1>');
 	}
 	&mark_hash_old();
     }
@@ -2396,11 +2398,11 @@
 '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'."\n". 
 '<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'.
 '<input type="hidden" name="orgurl" value="'.$url.
-'" /><input type="hidden" name="selectrole" value="1" /><h3><font color="red">'.
+'" /><input type="hidden" name="selectrole" value="1" /><h3><span class="LC_warning">'.
 &mt($message,' <input type="hidden" name="'.
     $env{'request.role'}.'" value="1" /><input type="button" value="'.
     &mt('re-initializing '.$course_type).'" onClick="reinit(this.form)" />').
-$help{'Caching'}.'</font></h3></form>'."\n\n");
+$help{'Caching'}.'</span></h3></form>'."\n\n");
 }
 
 # =========================================== Breadcrumbs for special functions
@@ -2682,31 +2684,37 @@
 
        $r->print(<<ENDCOURSEVERIFY);
 <form name="renameform" method="post" action="/adm/coursedocs">
-<input type="hidden" name="title" />
-<input type="hidden" name="cmd" />
-<input type="hidden" name="markcopy" />
-<input type="hidden" name="copyfolder" />
-$containertag
+  <input type="hidden" name="title" />
+  <input type="hidden" name="cmd" />
+  <input type="hidden" name="markcopy" />
+  <input type="hidden" name="copyfolder" />
+  $containertag
 </form>
 <form name="simpleedit" method="post" action="/adm/coursedocs">
-<input type="hidden" name="importdetail" value="" />
-$uploadtag
+  <input type="hidden" name="importdetail" value="" />
+  $uploadtag
 </form>
 <form action="/adm/coursedocs" method="post" name="courseverify">
-<table bgcolor="#AAAAAA" width="100%" cellspacing="4" cellpadding="4">
-<tr><td bgcolor="#DDDDCC">
-<input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}
-</td><td bgcolor="#DDDDCC">
-    <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}
-$dumpbut
-$exportbut
-</td><td bgcolor="#DDDDCC">
-    <input type="submit" name="listsymbs" value="$lt{'ls'}" />
-</td><td bgcolor="#DDDDCC">
-    <input type="hidden" name="folder" value="$env{'form.folder'}" />
-    <input type="submit" name="docslog" value="$lt{'sl'}" />
-</td></tr></table>
+  <div class="LC_docs_course_commands">
+
+      <div>
+        <input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}
+      </div>
+      <div>
+        <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}
+      </div>
+        $dumpbut
+        $exportbut
+      <div>
+        <input type="submit" name="listsymbs" value="$lt{'ls'}" />
+      </div>
+      <div>
+        <input type="hidden" name="folder" value="$env{'form.folder'}" />
+        <input type="submit" name="docslog" value="$lt{'sl'}" />
+      </div>
+  </div>
 </form>
+<div style="clear: both; height: 0px;">&nbsp;</div>
 ENDCOURSEVERIFY
        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
 		     &mt('Editing the Table of Contents for your '.$type)));
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.542 loncom/interface/loncommon.pm:1.543
--- loncom/interface/loncommon.pm:1.542	Mon Jul  2 11:37:15 2007
+++ loncom/interface/loncommon.pm	Mon Jul  2 20:17:42 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.542 2007/07/02 15:37:15 raeburn Exp $
+# $Id: loncommon.pm,v 1.543 2007/07/03 00:17:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -524,7 +524,8 @@
     if (field.length > 0) {
         for (i = 0; i < field.length; i++) {
             field[i].checked = false ;
-        }     } else {
+        }
+    } else {
         field.checked = false ;
     }
 }
@@ -3746,6 +3747,10 @@
 .LC_diff_added {
   color: green;
 }
+.LC_unknown {
+  color: yellow;
+}
+
 .LC_icon {
   border: 0px;
 }
@@ -3753,6 +3758,11 @@
   border: 0px;
   height: 22px;
 }
+.LC_docs_spacer {
+  width: 25px;
+  height: 1px;
+  border: 0px;
+}
 
 .LC_internal_info {
   color: #999;
@@ -4425,6 +4435,14 @@
     white-space: nowrap;
 }
 
+.LC_docs_course_commands div{
+     float: left;
+     border: 4px solid #AAAAAA;
+     padding: 4px;
+     background: #DDDDCC;
+}
+
+
 END
 }
 

--albertel1183421863--