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

bisitz bisitz@source.lon-capa.org
Thu, 06 May 2010 16:16:03 -0000


bisitz		Thu May  6 16:16:03 2010 EDT

  Modified files:              
    /loncom/auth	lonlogin.pm 
    /loncom/interface	loncommon.pm 
  Log:
  Bug 6271 - Simplyfied/consistent login page styles
  - Replaced some special styles by standard styles and added special CSS directly to corresponding tags where needed.
  - Removed unnecessary HTML table in login box.
  - Removed upper separator line (seems unnecessary) and use simple <hr> at bottom.
  - Consistent and simplified floating of block elements.
  - Removed nobreak for catalog link and removed box width limit. Now more flexible with enhanced floating.
    "nobreak" not needed since box width (both, upper and lower box) is now controlled by the longest element (independent from used language, wording, browser font and other browser rendering differences). line break on (very) small screens should be ok though.
  - Moved retrival of login box colors from loncommon.pm to lonlogin.pm - the only place where this and the corresponding styles are needed.
  
  
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.136 loncom/auth/lonlogin.pm:1.137
--- loncom/auth/lonlogin.pm:1.136	Wed Mar 31 23:11:48 2010
+++ loncom/auth/lonlogin.pm	Thu May  6 16:15:59 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.136 2010/03/31 23:11:48 raeburn Exp $
+# $Id: lonlogin.pm,v 1.137 2010/05/06 16:15:59 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -264,6 +264,9 @@
 my $vlink=&Apache::loncommon::designparm('login.vlink',$domain);
 my $alink=&Apache::loncommon::designparm('login.alink',$domain);
 my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain);
+my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain);
+my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain);
+my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain);
 my $logo=&Apache::loncommon::designparm('login.logo',$domain);
 my $img=&Apache::loncommon::designparm('login.img',$domain);
 my $domainlogo='<div>'.&Apache::loncommon::domainlogo($domain).'</div>';
@@ -367,7 +370,9 @@
 # ---------------------------------------------------------- Serve rest of page
 
 $r->print(
-	  '<div class="LC_loginpage_container">');
+    '<div class="LC_Box"'
+   .' style="margin:0 auto; padding:10px; width:90%; height: auto; background-color:#FFFFFF;">'
+);
 
 #
 #  If the loadbalancing yielded just http:// because perhaps there's no loadbalancing?
@@ -395,13 +400,17 @@
 if ($shownewuserlink) {
     $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
 }
-my $logintitle;
+my $logintitle =
+    '<h2 class="LC_hcell"'
+   .' style="background:'.$loginbox_header_bgcol.';'
+   .' color:'.$loginbox_header_textcol.'">';
 if ($loginheader eq 'text') {
-    $logintitle ='<h2>'.$lt{'log'}.'</h2>';
+    $logintitle .= $lt{'log'};
 } else {
-    $logintitle = '<img src="'.$login.'" alt="'.
-                  &mt('User Authentication').'" />';
+    $logintitle .= '<img src="'.$login.'"'.
+                   ' alt="'.&mt('User Authentication').'" />';
 }
+$logintitle .= '</h2>';
 
 my $noscript_warning='<noscript><span class="LC_warning"><b>'
                      .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
@@ -433,21 +442,14 @@
 HEADER
     }
     $r->print(<<ENDTOP);
-<div class="LC_loginpage_space">&nbsp;</div>
-<div class="LC_loginpage_floatLeft">
-<div class="LC_loginpage_loginContainer">
+<div style="float:left;">
+<div class="LC_Box" style="background:$loginbox_bg;">
   $logintitle
-   <table border="0" align="left" cellspacing="1" cellpadding="2" width="100%">
-      <tr>
-	   <td>
-		$loginform
-           </td>
-      </tr>
-   </table>   	
-   $noscript_warning
+  $loginform
+  $noscript_warning
 </div>
   
-<div class="LC_loginpage_loginInfo">
+<div class="LC_Box" style="padding-top: 10px;">
   $loginhelp
   $forgotpw
   $contactblock
@@ -455,6 +457,8 @@
   $coursecatalog
 </div>
 </div>
+
+<div>
 ENDTOP
     if ($showmainlogo) {
         $r->print(' <img src="'.$logo.'" alt="" />'."\n");
@@ -462,7 +466,8 @@
 $r->print(<<ENDTOP);
 $announcements
 $domainlogo
-<div class="LC_loginpage_space">&nbsp;</div>
+</div>
+<hr style="clear:both;" />
 ENDTOP
 
 $r->print(<<ENDDOCUMENT);
@@ -642,7 +647,7 @@
 sub coursecatalog_link {
     my ($linkname) = @_;
     return <<"END";
-      <span class="LC_nobreak"><a href="/adm/coursecatalog">$linkname</a></span>
+      <a href="/adm/coursecatalog">$linkname</a>
 END
 }
 
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.966 loncom/interface/loncommon.pm:1.967
--- loncom/interface/loncommon.pm:1.966	Mon May  3 15:03:55 2010
+++ loncom/interface/loncommon.pm	Thu May  6 16:16:02 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.966 2010/05/03 15:03:55 bisitz Exp $
+# $Id: loncommon.pm,v 1.967 2010/05/06 16:16:02 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4791,10 +4791,6 @@
     my $vlink  = &designparm($function.'.vlink', $domain);
     my $link   = &designparm($function.'.link',  $domain);
 
-    my $loginbg = &designparm('login.sidebg',$domain);
-    my $bgcol = &designparm('login.bgcol',$domain);
-    my $textcol = &designparm('login.textcol',$domain);
-
     my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';
     my $mono                 = 'monospace';
     my $data_table_head      = $sidebg;
@@ -6347,52 +6343,6 @@
   overflow:hidden;
 }
 
-.LC_loginpage_container {
-  text-align:left;
-  margin : 0 auto;
-  width:90%;
-  padding: 10px;
-  height: auto;
-  background-color:#FFFFFF;
-  border:1px solid #CCCCCC;
-}
-
-
-.LC_loginpage_loginContainer {
-  float:left;
-  width: 182px;
-  padding: 2px;
-  border:1px solid #CCCCCC;
-  background-color:$loginbg;
-}
-
-.LC_loginpage_loginContainer h2 {
-  margin-top: 0;
-  display:block;
-  background:$bgcol;
-  color:$textcol;
-  padding-left:5px;
-}
-
-.LC_loginpage_loginInfo {
-  float:left;
-  width:182px;
-  border:1px solid #CCCCCC;
-  padding:2px;
-}
-
-.LC_loginpage_space {
-  clear: both;
-  margin-bottom: 20px;
-  border-bottom: 1px solid #CCCCCC;
-}
-
-.LC_loginpage_floatLeft {
-  float: left;
-  width: 200px;
-  margin: 0;
-}
-
 table em {
   font-weight: bold;
   font-style: normal;