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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 20 Nov 2006 18:54:55 -0000


banghart		Mon Nov 20 13:54:55 2006 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Improve appearance for adding portfolio metadata
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.186 loncom/interface/lonmeta.pm:1.187
--- loncom/interface/lonmeta.pm:1.186	Fri Nov  3 20:50:31 2006
+++ loncom/interface/lonmeta.pm	Mon Nov 20 13:54:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.186 2006/11/04 01:50:31 banghart Exp $
+# $Id: lonmeta.pm,v 1.187 2006/11/20 18:54:55 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1269,7 +1269,11 @@
                 $lt{$field_name} = $$added_metadata_fields{$field_name};
             }
         }
+        $output.='<table>';
+        my $row_alt = 1;
         foreach my $field_name (@fields) {
+            # $row_alt = ($row_alt) ? 0 : 1;
+            my $row_class = ($row_alt) ? ' class="LC_metadata_light" ' : ' class="LC_metadata_dark" ';
             if (defined($env{'form.new_'.$field_name})) {
                 $Apache::lonpublisher::metadatafields{$field_name}=
                     join(',',&Apache::loncommon::get_env_multiple('form.new_'.$field_name));
@@ -1280,22 +1284,24 @@
                 if ((($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
                     ($field_name eq 'courserestricted'))&&
                     (!($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/deleted/))){
-                    $output.=("\n".'<p>'.$lt{$field_name}.': '.
+                    
+                    $output.=("\n".'<tr '.$row_class.'><td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
                               &prettyinput($field_name,
 				   $Apache::lonpublisher::metadatafields{$field_name},
 				                    'new_'.$field_name,'defaultmeta',
 				                    undef,undef,undef,undef,
-				                    $Apache::lonpublisher::metadatafields{'courserestricted'}).'</p>'."\n");
+				                    $Apache::lonpublisher::metadatafields{'courserestricted'}).'</td></tr>'."\n");
                  }
             } else {
 
-                    $output.=('<p>'.$lt{$field_name}.': '.
+                    $output.=('<tr'.$row_class.'><td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
 			      &prettyinput($field_name,
 					   $Apache::lonpublisher::metadatafields{$field_name},
-					   'new_'.$field_name,'defaultmeta').'</p>');
+					   'new_'.$field_name,'defaultmeta').'</td></tr>');
                
             }
         }
+        $output.='</table>';
 	if ($env{'form.store'}) {
 	    my $mfh;
 	    my $formname='store';