Asset list table improvements

This commit is contained in:
2020-04-06 02:43:12 +01:00
parent 4c40226bcf
commit 7aa19cc7ab
8 changed files with 179 additions and 181 deletions

View File

@@ -0,0 +1,36 @@
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">Asset ID</th>
<th scope="col" class="w-25">Description</th>
<th scope="col">Category</th>
<th scope="col">Status</th>
<th scope="col" class="d-none d-sm-table-cell">Quick Links</th>
</tr>
</thead>
<tbody id="asset_table_body">
{% for item in object_list %}
<tr class="{{ item.status.display_class|default:'' }} assetRow">
<th scope="row"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
<td class="assetDesc w-25 text-truncate">{{ item.description }}</td>
<td class="assetCategory">{{ item.category }}</td>
<td class="assetStatus">{{ item.status }}</td>
<td class="d-none d-sm-table-cell">
<div class="btn-group" role="group">
<a type="button" class="btn btn-primary btn-sm" href="{% url 'asset_detail' item.asset_id %}"><i class="fas fa-eye fa-fw"></i><span class="d-none d-sm-inline"> View</span></a>
{% if perms.assets.change_asset %}
<a type="button" class="btn btn-warning btn-sm" href="{% url 'asset_update' item.asset_id %}"><i class="fas fa-edit fa-fw"></i><span class="d-none d-sm-inline"> Edit</span></a>
<a type="button" class="btn btn-secondary btn-sm" href="{% url 'asset_duplicate' item.asset_id %}"><i class="fas fa-clone fa-fw"></i><span class="d-none d-sm-inline"> Duplicate</span></a>
{% endif %}
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6">Nothing found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -1,22 +0,0 @@
{% for item in object_list %}
<tr class="{{ item.status.display_class|default:'' }} assetRow">
<th scope="row"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
<td class="assetDesc w-25">{{ item.description }}</td>
<td class="assetCategory">{{ item.category }}</td>
<td class="assetStatus">{{ item.status }}</td>
<td class="d-none d-sm-block">
<div class="btn-group d-flex" role="group">
<a type="button" class="btn btn-primary btn-sm flex-nowrap" href="{% url 'asset_detail' item.asset_id %}"><span class="fas fa-eye fa-fw text-nowrap"></span><span class="d-none d-md-block text-nowrap"> View</span></a>
{% if perms.assets.change_asset %}
<a type="button" style="display: inline !important; white-space: no-wrap !important;" class="btn btn-warning btn-sm text-nowrap flex-nowrap" href="{% url 'asset_update' item.asset_id %}"><span class="fas fa-edit fa-fw" style="display: inline !important;"></span><span class="d-none d-md-block"> Edit</span></a>
<a type="button" class="btn btn-secondary btn-sm text-nowrap" href="{% url 'asset_duplicate' item.asset_id %}"><span class="fas fa-clone fa-fw"></span><span class="d-none d-md-block"> Duplicate</span></a>
{% endif %}
</div>
</td>
</tr>
{% empty %}
<tr>
<td></td>
<td colspan="5">Nothing found</td>
</tr>
{% endfor %}