Merge pull request #407 from eReuse/feature/4092-erasure-tabs
Feature/4092 erasure tabs
This commit is contained in:
commit
1ab6606cf0
|
@ -88,7 +88,7 @@ DEVICES = {
|
|||
],
|
||||
"Drives & Storage": [
|
||||
"All DataStorage",
|
||||
"HardDrives",
|
||||
"HardDrive",
|
||||
"SolidStageDrive",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -632,6 +632,14 @@ class Device(Thing):
|
|||
return self.binding.device.devicehub_id
|
||||
return self.devicehub_id
|
||||
|
||||
@property
|
||||
def my_partner(self):
|
||||
if self.placeholder and self.placeholder.binding:
|
||||
return self.placeholder.binding
|
||||
if self.binding:
|
||||
return self.binding.device
|
||||
return self
|
||||
|
||||
@property
|
||||
def get_updated(self):
|
||||
if self.placeholder and self.placeholder.binding:
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
{% for ac in erasure %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" class="deviceSelect" data="{{ ac.device.id }}"
|
||||
<input type="checkbox" class="deviceSelect" data="{{ ac.device.my_partner.id }}"
|
||||
data-device-type="{{ ac.device.type }}" data-device-manufacturer="{{ ac.device.manufacturer }}"
|
||||
data-device-dhid="{{ ac.device.dhid }}" data-device-vname="{{ ac.device.verbose_name }}"
|
||||
data-action-erasure="{{ ac.id }}"
|
||||
|
@ -151,9 +151,9 @@
|
|||
{% endif %}
|
||||
{{ ac.device.serial_number.upper() }}
|
||||
{% endif %}
|
||||
{% if ac.device.lots | length > 0 %}
|
||||
{% if ac.device.my_partner.lots | length > 0 %}
|
||||
<h6 class="d-inline">
|
||||
{% for lot in ac.device.get_lots_for_template() %}
|
||||
{% for lot in ac.device.my_partner.get_lots_for_template() %}
|
||||
<span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
|
||||
{% endfor %}
|
||||
</h6>
|
||||
|
|
Reference in a new issue