mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Some cable list work
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
{% extends 'base_assets.html' %}
|
{% extends 'base_assets.html' %}
|
||||||
{% load paginator from filters %}
|
|
||||||
{% load button from filters %}
|
{% load button from filters %}
|
||||||
{% load ids_from_objects from asset_tags %}
|
{% load ids_from_objects from asset_tags %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
@@ -124,7 +123,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col px-0">
|
<div class="col px-0">
|
||||||
{% load button from filters %}
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
@@ -145,22 +143,10 @@
|
|||||||
<td class="assetDesc"><span class="text-truncate d-inline-block align-middle">{{ item.description }}</span></td>
|
<td class="assetDesc"><span class="text-truncate d-inline-block align-middle">{{ item.description }}</span></td>
|
||||||
<td class="assetCategory align-middle">{{ item.category }}</td>
|
<td class="assetCategory align-middle">{{ item.category }}</td>
|
||||||
<td class="assetStatus align-middle">{{ item.status }}</td>
|
<td class="assetStatus align-middle">{{ item.status }}</td>
|
||||||
<td>{{ item.length }}m</td>
|
<td style="background-color:{% if item.length == 20.0 %}#304486{% elif item.length == 10.0 %}green{%elif item.length == 5.0 %}red{% endif %} !important;">{{ item.length }}m</td>
|
||||||
<td>{{ item.cable_type }}</td>
|
<td>{{ item.cable_type }}</td>
|
||||||
<td class="d-none d-sm-table-cell">
|
<td class="d-none d-sm-table-cell">
|
||||||
{% if audit %}
|
{% include 'partials/asset_list_buttons.html' %}
|
||||||
<a type="button" class="btn btn-info btn-sm modal-href" href="{% url 'asset_audit' item.asset_id %}"><i class="fas fa-certificate"></i> Audit</a>
|
|
||||||
{% else %}
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
{% button 'view' url='asset_detail' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% if perms.assets.change_asset %}
|
|
||||||
{% button 'edit' url='asset_update' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% endif %}
|
|
||||||
{% if perms.assets.add_asset %}
|
|
||||||
{% button 'duplicate' url='asset_duplicate' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
@@ -173,5 +159,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% paginator %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
14
assets/templates/partials/asset_list_buttons.html
Normal file
14
assets/templates/partials/asset_list_buttons.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{% load button from filters %}
|
||||||
|
{% if audit %}
|
||||||
|
<a type="button" class="btn btn-info btn-sm modal-href" href="{% url 'asset_audit' item.asset_id %}"><i class="fas fa-certificate"></i> Audit</a>
|
||||||
|
{% else %}
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
{% button 'view' url='asset_detail' pk=item.asset_id clazz="btn-sm" %}
|
||||||
|
{% if perms.assets.change_asset %}
|
||||||
|
{% button 'edit' url='asset_update' pk=item.asset_id clazz="btn-sm" %}
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.assets.add_asset %}
|
||||||
|
{% button 'duplicate' url='asset_duplicate' pk=item.asset_id clazz="btn-sm" %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
@@ -18,19 +18,7 @@
|
|||||||
<td class="assetCategory align-middle">{{ item.category }}</td>
|
<td class="assetCategory align-middle">{{ item.category }}</td>
|
||||||
<td class="assetStatus align-middle">{{ item.status }}</td>
|
<td class="assetStatus align-middle">{{ item.status }}</td>
|
||||||
<td class="d-none d-sm-table-cell">
|
<td class="d-none d-sm-table-cell">
|
||||||
{% if audit %}
|
{% include 'partials/asset_list_buttons.html' %}
|
||||||
<a type="button" class="btn btn-info btn-sm modal-href" href="{% url 'asset_audit' item.asset_id %}"><i class="fas fa-certificate"></i> Audit</a>
|
|
||||||
{% else %}
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
{% button 'view' url='asset_detail' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% if perms.assets.change_asset %}
|
|
||||||
{% button 'edit' url='asset_update' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% endif %}
|
|
||||||
{% if perms.assets.add_asset %}
|
|
||||||
{% button 'duplicate' url='asset_duplicate' pk=item.asset_id clazz="btn-sm" %}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ class AssetList(LoginRequiredMixin, generic.ListView):
|
|||||||
|
|
||||||
class CableList(AssetList):
|
class CableList(AssetList):
|
||||||
template_name = 'cable_list.html'
|
template_name = 'cable_list.html'
|
||||||
|
paginator = None
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = super().get_queryset().filter(is_cable=True)
|
queryset = super().get_queryset().filter(is_cable=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user