Edgewall Software

Ticket #8448: attachment-size-display.patch

File attachment-size-display.patch, 811 bytes (added by sebastian@…, 3 years ago)

Patch against Trac 0.11.4

  • trac/templates/attachment.html

    old new  
    1818        <form id="attachment" method="post" enctype="multipart/form-data" action=""> 
    1919          <div class="field"> 
    2020            <label>File<py:if test="max_size >= 0"> (size limit 
    21                   ${pretty_size(max_size, format='%d')})</py:if>:<br /> 
     21                  ${pretty_size(max_size)})</py:if>:<br /> 
    2222              <input type="file" name="attachment" /></label> 
    2323          </div> 
    2424          <fieldset> 
  • trac/util/text.py

    old new  
    213213    if size is None: 
    214214        return '' 
    215215 
    216     jump = 512 
     216    jump = 1024 
    217217    if size < jump: 
    218218        return '%d bytes' % size 
    219219