Skip to content

Commit

Permalink
Fixed #429: fixed unit displayed in package browser
Browse files Browse the repository at this point in the history
- All content units are binary ones
- All media units are powers of 10
  • Loading branch information
rgaudin committed Jun 25, 2024
1 parent 7ed3d81 commit b594fd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manager/manager/templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h3>{% blocktrans %}Media Sizes{% endblocktrans %}</h3>
{% for media in medias %}
<tr><th><a href="{% url "admin:manager_media_change" media.id %}">{{ media.name }}</a></th>
<td>{{ media.verbose_kind }}</td>
<td>{{ media.bytes|human_size }}</a></td>
<td>{{ media.bytes|human_size:False }}</a></td>
<td>{{ media.units_coef }}</td>
</tr>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions manager/manager/templates/configuration_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h4 class="alert alert-success">{% blocktrans %}Selected Packages{% endblocktran
<thead><tr><th>{% blocktrans %}Name{% endblocktrans %}</th><th>{% blocktrans %}Size{% endblocktrans %}</th></tr></thead>
<tbody>
{% for book in form.content_zims.value|books_from_json %}
<tr id="selected-zim-row-{{ book.ident }}"><td><a href="#" class="remove-zim" data-book-ident="{{ book.ident }}"><i data-container="body" data-toggle="popover" data-placement="top" data-trigger="hover" data-content="{{ book.ident }}" class="fas fa-minus-circle primary"></i></a> <strong>{{ book.title }}</strong>{% if books.tags %} {% for tag in book.tags %}<span class="badge badge-pill badge-secondary package-tag">{{ tag }}</span>{% endfor %}{% endif %}<p><em>{{ book.description }}</em></p></td><td>{{ book.size|human_size }}</td>
<tr id="selected-zim-row-{{ book.ident }}"><td><a href="#" class="remove-zim" data-book-ident="{{ book.ident }}"><i data-container="body" data-toggle="popover" data-placement="top" data-trigger="hover" data-content="{{ book.ident }}" class="fas fa-minus-circle primary"></i></a> <strong>{{ book.title }}</strong>{% if books.tags %} {% for tag in book.tags %}<span class="badge badge-pill badge-secondary package-tag">{{ tag }}</span>{% endfor %}{% endif %}<p><em>{{ book.description }}</em></p></td><td>{{ book.size|human_size:True }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down Expand Up @@ -305,7 +305,7 @@ <h4 class="alert alert-success">{% blocktrans %}Selected Packages{% endblocktran

function humanSize(sizeInBytes) {
var i = -1;
var units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var units = ['kiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
do {
sizeInBytes /= 1024;
i++;
Expand Down
2 changes: 1 addition & 1 deletion manager/manager/templates/configuration_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3>{% blocktrans with user_org=user.profile.organization %}{{ user_org }}'s con
<tbody>
{% for configuration in configurations %}
<tr><th><a href="{% url 'configuration_edit' configuration.id %}">{{ configuration }}</a>{% if configuration.retrieve_missing_zims %} <span title="{% blocktrans %}At least one ZIM is not available anymore{% endblocktrans %}">⚠️</span>{% endif %}</th>
<td>{{ configuration.size|human_size }}</td>
<td>{{ configuration.size|human_size:True }}</td>
<td>{{ configuration.min_media }}</td>
<td>{{ configuration.updated_by.name }}</td>
<td>{{ configuration.updated_on }}</td>
Expand Down

0 comments on commit b594fd8

Please sign in to comment.