Changeset 4865


Ignore:
Timestamp:
Mar 31, 2009, 9:31:04 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1284: Viev and download icons for file should show file size

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/Base.java

    r4728 r4865  
    15991599      String downloadIcon = "download";
    16001600      String separator = " | ";
     1601      String bytes = Values.formatBytes(file.getSize(), 1);
    16011602      if (root != null)
    16021603      {
     
    16061607      }
    16071608      link += " [<a href=\"javascript:Main.viewFile('" + ID + "', " + file.getId() + ")\"" +
    1608         " title=\"View the contents of this file\">" + viewIcon + "</a>" +
     1609        " title=\"View the contents of this file (" + bytes + ")\">" + viewIcon + "</a>" +
    16091610        separator +
    16101611        "<a href=\"javascript:Main.downloadFile('" + ID + "', " + file.getId() + ")\"" + "" +
    1611         " title=\"Download the contents of this file\">" + downloadIcon + "</a>]";
     1612        " title=\"Download the contents of this file (" + bytes + ")\">" + downloadIcon + "</a>]";
    16121613    }
    16131614    return link;
  • trunk/www/filemanager/files/list_files.jsp

    r4669 r4865  
    787787              String tagPath = HTML.encodeTags(path);
    788788              String icon = item.isCompressed() ? "file_compressed.gif" : "file.gif";
     789              String fileSize = Values.formatBytes(item.getSize(), numDecimals);
    789790              index++;
    790791              numListed++;
     
    835836                  onclick="fileOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)"
    836837                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
    837                 <tbl:cell column="size"><%=Values.formatBytes(item.getSize(), numDecimals)%></tbl:cell>
    838                 <tbl:cell column="compressedSize"><%=Values.formatBytes(item.getCompressedSize(), numDecimals)%></tbl:cell>
     838                <tbl:cell column="size"><span title="<%=item.getSize()%> bytes"><%=fileSize%></span></tbl:cell>
     839                <tbl:cell column="compressedSize"><span title="<%=item.getCompressedSize()%> bytes"><%=Values.formatBytes(item.getCompressedSize(), numDecimals)%></span></tbl:cell>
    839840                <tbl:cell column="compressed"><%=item.isCompressed() ? "yes" : "no"%></tbl:cell>
    840841                <tbl:cell column="writeProtected"><%=item.isWriteProtected() ? "yes" : "no"%></tbl:cell>
     
    865866                  {
    866867                    %>
    867                     <a href="javascript:Main.viewFile('<%=ID%>', <%=itemId%>)"><base:icon image="view.gif" tooltip="View the contents of this file" /></a>
    868                     <a href="javascript:Main.downloadFile('<%=ID%>', <%=itemId%>)"><base:icon image="download.gif" tooltip="Download the contents of this file" /></a>
     868                    <a href="javascript:Main.viewFile('<%=ID%>', <%=itemId%>)"><base:icon image="view.gif" tooltip="<%="View the contents of this file (" + fileSize + ")"%>" /></a>
     869                    <a href="javascript:Main.downloadFile('<%=ID%>', <%=itemId%>)"><base:icon image="download.gif" tooltip="<%="Download the contents of this file (" + fileSize + ")"%>" /></a>
    869870                    <%
    870871                  }
  • trunk/www/filemanager/files/view_file.jsp

    r4587 r4865  
    7676  String path = file.getPath().toString();
    7777  String urlPath = HTML.urlEncode(path);
     78  String bytes = Values.formatBytes(file.getSize(), 2);
    7879 
    7980  final boolean writePermission = file.hasPermission(Permission.WRITE);
     
    302303        {
    303304          %>
    304           [<a href="javascript:Main.viewFile('<%=ID%>', <%=itemId%>)"><base:icon image="view.gif" tooltip="View the contents of this file" /></a>
    305           <a href="javascript:Main.downloadFile('<%=ID%>', <%=itemId%>)"><base:icon image="download.gif" tooltip="Download the contents of this file" /></a>
     305          [<a href="javascript:Main.viewFile('<%=ID%>', <%=itemId%>)"><base:icon image="view.gif" tooltip="<%="View the contents of this file (" + bytes + ")"%>" /></a>
     306          <a href="javascript:Main.downloadFile('<%=ID%>', <%=itemId%>)"><base:icon image="download.gif" tooltip="<%="Download the contents of this file (" + bytes + ")"%>" /></a>
    306307          <%
    307308          if (file.hasPermission(Permission.WRITE) && !file.isWriteProtected())
     
    363364      <tr>
    364365        <td class="prompt">Size</td>
    365         <td><%=Values.formatBytes(file.getSize())%></td>
     366        <td title="<%=file.getSize()%> bytes"><%=bytes%></td>
    366367      </tr>
    367368      <%
     
    371372        <tr>
    372373          <td class="prompt">Compressed Size</td>
    373           <td><%=Values.formatBytes(file.getCompressedSize())%></td>
     374          <td title="<%=file.getCompressedSize()%> bytes"><%=Values.formatBytes(file.getCompressedSize())%></td>
    374375        </tr>
    375376        <%
Note: See TracChangeset for help on using the changeset viewer.