OSDN Git Service

add auto unit
[karesansui/karesansui.git] / karesansui / templates / default / hostby1updaterby1 / hostby1updaterby1.part
index ff548de..28dcfb9 100644 (file)
@@ -1,6 +1,10 @@
 <%doc>Copyright (C) 2009-2010 HDE, Inc.</%doc>
 <%inherit file="../include/common.part" />
+
 <%!
+from karesansui.lib.template import view_autounit, view_megaunit
+from karesansui.lib.const import DEFAULT_DECIMAL_POINT
+
 def time_format(text):
     import time
     import types
@@ -83,9 +87,9 @@ def time_format(text):
             <td>
                 <table cellspacing="0" class="border detail-sub-contents">
                     <tr>
-                        <th>${_('Size')}</th>
+                        <th>${_('Size')}&nbsp;(B)</th>
                         <td class="detail-separator"><img src="${ctx.homepath}/static/images/table-space.gif" alt="" /></td>
-                        <td><pre>${pkg['size'] | h}</pre></td>
+                        <td><span>${pkg['size'] | h}</span><span class="dark-text autounit">(${view_autounit(pkg['size'], decimal_point=DEFAULT_DECIMAL_POINT, print_unit=True)})</span></td>
                     </tr>
                     <tr>
                         <th>${_('Build Host')}</th>