[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Sun Aug 7 20:57:37 EDT 2016


raeburn		Mon Aug  8 00:57:37 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - For 2.11
    - Backport 1.372
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358.2.4 loncom/interface/lonhtmlcommon.pm:1.358.2.5
--- loncom/interface/lonhtmlcommon.pm:1.358.2.4	Thu Aug  4 21:26:35 2016
+++ loncom/interface/lonhtmlcommon.pm	Mon Aug  8 00:57:36 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358.2.4 2016/08/04 21:26:35 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.5 2016/08/08 00:57:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2467,9 +2467,9 @@
 #
 
 sub display_usage {
-    my ($current_disk_usage,$disk_quota) = @_;
-    my $usage = $current_disk_usage/1000;
-    my $quota = $disk_quota/1000;
+    my ($current_disk_usage,$disk_quota,$context) = @_;
+    my $usage = $current_disk_usage/1024;
+    my $quota = $disk_quota/1024;
     my $percent;
     if ($disk_quota == 0) {
         $percent = 100.0;
@@ -2493,9 +2493,13 @@
     if ($prog_width > 100) {
         $prog_width = 100;
     }
+    my $display = 'block';
+    if ($context eq 'authoring') {
+        $display = 'inline';
+    }
     return '
-  <div id="meter1" align="left" '.$cssclass.'>'.&mt('Currently using [_1] of the [_2] available.',$usage.' MB <span style="font-weight:bold;">('.$percent.'%)</span>',$quota.' MB')."\n".
-'   <div id="meter2" style="display:block; margin-top:5px; margin-bottom:5px; margin-left:0px; margin-right:0px; width:400px; border:1px solid #000000; height:10px;">'."\n".
+  <div id="meter1" align="left" style="display:'.$display.'" '.$cssclass.'>'.&mt('Currently using [_1] of the [_2] available.',$usage.' MB <span style="font-weight:bold;">('.$percent.'%)</span>',$quota.' MB')."\n".
+'   <div id="meter2" style="display:block; margin-top:3px; margin-bottom:3px; margin-left:0px; margin-right:0px; width:400px; border:1px solid #000000; height:10px;">'."\n".
 '    <div id="meter3" style="display:block; background-color:'.$color.'; width:'.$prog_width.'%; height:10px; color:#000000; margin:0px;"></div>'."\n".
 '   </div>'."\n".
 '  </div>';




More information about the LON-CAPA-cvs mailing list