~edwargix/git.sr.ht

ec48c95d1e38c1226043b80c9002900c3addb0e6 — Drew DeVault 6 years ago 261725e
Show size in bytes on hover
2 files changed, 13 insertions(+), 6 deletions(-)

M gitsrht/templates/blob.html
M gitsrht/templates/tree.html
M gitsrht/templates/blob.html => gitsrht/templates/blob.html +9 -4
@@ 19,8 19,10 @@
        </span>
      </span>
      <span class="text-muted" style="margin-left: 1rem">
        {{humanize.naturalsize(blob.size,
          binary=True).replace("Byte", "byte")}}
        <span title="{{ blob.size }} bytes">
          {{humanize.naturalsize(blob.size,
            binary=True).replace("Byte", "byte")}}
        </span>
      </span>
      <span class="text-muted" style="margin-left: 1rem">
        <a href="{{url_for("repo.raw_blob", owner=repo.owner.canonical_name,


@@ 55,8 57,11 @@
    {% else %}
    <div class="col-md-12">
      <p>
        {{humanize.naturalsize(blob.size,
          binary=True).replace("Byte", "byte")}} binary file not shown.
        <span title="{{ blob.size }} bytes">
          {{humanize.naturalsize(blob.size,
            binary=True).replace("Byte", "byte")}}
        </span>
        binary file not shown.
      </p>
      <p>
        <a href="{{url_for("repo.raw_blob", owner=repo.owner.canonical_name,

M gitsrht/templates/tree.html => gitsrht/templates/tree.html +4 -2
@@ 65,8 65,10 @@
      </div>
      <div class="size">
        {% if entry.type == "blob" %}
        {{humanize.naturalsize(entry.blob.size,
          binary=True).replace("Byte", "byte")}}
        <span title="{{ entry.blob.size }} bytes">
          {{humanize.naturalsize(entry.blob.size,
            binary=True).replace("Byte", "byte")}}
        </span>
        {% endif %}
      </div>
      {% endfor %}