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

bisitz bisitz at source.lon-capa.org
Fri Nov 9 13:56:50 EST 2012


bisitz		Fri Nov  9 18:56:50 2012 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  Improve Portfolio Metadata page layout:
  - confirm_success for creation of meta data file
  - Explicit "Change" link for course association
  - Change and Cancel button right next to each other like on other pages
  - LC_filename style for file names
  
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.247 loncom/interface/lonmeta.pm:1.248
--- loncom/interface/lonmeta.pm:1.247	Mon Oct 29 17:38:56 2012
+++ loncom/interface/lonmeta.pm	Fri Nov  9 18:56:50 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.247 2012/10/29 17:38:56 raeburn Exp $
+# $Id: lonmeta.pm,v 1.248 2012/11/09 18:56:50 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -351,7 +351,7 @@
     if ($group) {
         $group_input = '<input type="hidden" name="group" value="'.$group.'" />';
     } 
-    $r->print('<br /><br /><form method="post" action="'.$port_path.'">'.
+    $r->print(' <form method="post" action="'.$port_path.'">'.
               '<input type="hidden" name="currentpath" value="'.$path.'" />'.
 	      $group_input.
 	      '<input type="submit" name="cancel" value="'.&mt('Cancel').'" />'.
@@ -1365,7 +1365,9 @@
     } else {
 
         # Display Metadata, not Bombs
-        my $displayfile=&mt('Metadata for [_1]',$disuri);
+        my $displayfile =
+            &mt('Metadata for [_1]'
+               ,'<span class="LC_filename"'.$disuri.'</span>');
         if ($disuri=~/\/default$/) {
             my $dir=$disuri;
             $dir=~s/default$//;
@@ -1376,7 +1378,11 @@
         %Apache::lonpublisher::metadatakeys=();
         my $result=&Apache::lonnet::getfile($fn);
         if ($result == -1){
-	    $r->print(&mt('Creating new file [_1]'),$meta_uri);
+            my $message = &Apache::lonhtmlcommon::confirm_success(
+                &mt('Creating new file [_1]'
+                   ,'<span class="LC_filename"'.$meta_uri.'</span>'));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         } else {
             &Apache::lonpublisher::metaeval($result);
         }
@@ -1463,21 +1469,29 @@
 	    if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
 
                 if ($file_type eq 'portfolio') {
-		    $r->print(&mt('Associated with course [_1]',
-		        '<strong><a href="'.$uri.'?changecourse=true">'.
-		        $env{$Apache::lonpublisher::metadatafields{'courserestricted'}.
-		        ".description"}.
-			      '</a></strong>').'<br />');
+                    $r->print(
+                        &mt('Associated with course [_1]'
+                           ,'<strong>'
+                           .$env{$Apache::lonpublisher::metadatafields{'courserestricted'}
+                           .".description"}.'</strong>')
+                       .' <a href="'.$uri.'?changecourse=true">'
+                       .&mt('Change')
+                       .'</a>'.'<br />'
+                    );
+
                 } else {
                     $r->print(&mt('Associated with course [_1]',
                         '<strong>'.
   $env{$Apache::lonpublisher::metadatafields{'courserestricted'}.
                         ".description"}.'</strong>').'<br />');
                 }
-	    } else {
-		$r->print('<a href="'.$uri.'?changecourse=true">'.&mt('This resource is not associated with a course.').'</a><br />');
-	    }
-	}
+            } else {
+                $r->print(
+                    &mt('This resource is not associated with a course.')
+                  .' <a href="'.$uri.'?changecourse=true">'.&mt('Change').'</a><br />'
+                );
+            }
+        }
 	if (@added_order) {
 	    foreach my $field_name (@added_order) {
                 push(@fields,$field_name);




More information about the LON-CAPA-cvs mailing list