Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/directory-display.html
{% comment %} | {% comment %} | ||||
Copyright (C) 2017-2018 The Software Heritage developers | Copyright (C) 2017-2018 The Software Heritage developers | ||||
See the AUTHORS file at the top-level directory of this distribution | See the AUTHORS file at the top-level directory of this distribution | ||||
License: GNU Affero General Public License version 3, or any later version | License: GNU Affero General Public License version 3, or any later version | ||||
See top-level LICENSE file for more information | See top-level LICENSE file for more information | ||||
{% endcomment %} | {% endcomment %} | ||||
{% if snapshot_context and snapshot_context.is_empty %} | {% if snapshot_context and snapshot_context.is_empty %} | ||||
{% include "includes/empty-snapshot.html" %} | {% include "includes/empty-snapshot.html" %} | ||||
{% elif dirs|length > 0 or files|length > 0 %} | {% elif dirs|length > 0 or files|length > 0 %} | ||||
<div class="table-responsive"> | <div class="table-responsive d-none d-md-block"> | ||||
<table class="table swh-table swh-directory-table"> | <table class="table swh-table swh-directory-table"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th>File</th> | <th>File</th> | ||||
<th>Mode</th> | <th>Mode</th> | ||||
<th>Size</th> | <th>Size</th> | ||||
anlambert: We should hide the `Size` column too on small screens | |||||
Done Inline Actionswith the new commit hiding on xs screens. kalpitk: with the new commit hiding on xs screens. | |||||
</tr> | </tr> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
{% for d in dirs %} | {% for d in dirs %} | ||||
<tr class="swh-directory-entry swh-tr-hover-highlight"> | <tr class="swh-directory-entry swh-tr-hover-highlight"> | ||||
<td class="swh-directory"> | <td class="swh-directory"> | ||||
<i class="{{ swh_object_icons.directory }} fa-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.directory }} fa-fw" aria-hidden="true"></i> | ||||
<a href="{{ d.url | safe }}"> | <a href="{{ d.url | safe }}"> | ||||
Show All 21 Lines | <table class="table swh-table swh-directory-table"> | ||||
<td> | <td> | ||||
{{ f.length }} | {{ f.length }} | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
{% endfor %} | {% endfor %} | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
<div class="d-block d-md-none"> | |||||
{% for d in dirs %} | |||||
<a href="{{ d.url | safe }}" class="div-item"> | |||||
<i class="{{ swh_object_icons.content }} fa-fw" aria-hidden="true"></i> | |||||
{{ d.name }} | |||||
</a> | |||||
{% endfor %} | |||||
{% for f in files %} | |||||
<a href="{{ f.url | safe }}" class="div-item"> | |||||
<i class="{{ swh_object_icons.content }} fa-fw" aria-hidden="true"></i> | |||||
{{ f.name }} | |||||
</a> | |||||
{% endfor %} | |||||
</div> | |||||
anlambertUnsubmitted Not Done Inline ActionsI would prefer the approach of hiding the mode and size columns according to the screen size instead of duplicating some template code here. Plus the icon for directories is not the right one and the icon colors are not the same for small screens. anlambert: I would prefer the approach of hiding the mode and size columns according to the screen size… | |||||
<hr class="mt-0 mb-2"> | <hr class="mt-0 mb-2"> | ||||
{% elif dirs|length == 0 and files|length == 0 %} | {% elif dirs|length == 0 and files|length == 0 %} | ||||
<i>Directory is empty</i> | <i>Directory is empty</i> | ||||
{% endif %} | {% endif %} | ||||
No newline at end of file | No newline at end of file |
We should hide the Size column too on small screens