Merge pull request #407 from eReuse/feature/4092-erasure-tabs

Feature/4092 erasure tabs
This commit is contained in:
cayop 2022-11-22 12:29:42 +01:00 committed by GitHub
commit 1ab6606cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -88,7 +88,7 @@ DEVICES = {
], ],
"Drives & Storage": [ "Drives & Storage": [
"All DataStorage", "All DataStorage",
"HardDrives", "HardDrive",
"SolidStageDrive", "SolidStageDrive",
], ],
} }

View File

@ -632,6 +632,14 @@ class Device(Thing):
return self.binding.device.devicehub_id return self.binding.device.devicehub_id
return self.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 @property
def get_updated(self): def get_updated(self):
if self.placeholder and self.placeholder.binding: if self.placeholder and self.placeholder.binding:

View File

@ -128,7 +128,7 @@
{% for ac in erasure %} {% for ac in erasure %}
<tr> <tr>
<td> <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-type="{{ ac.device.type }}" data-device-manufacturer="{{ ac.device.manufacturer }}"
data-device-dhid="{{ ac.device.dhid }}" data-device-vname="{{ ac.device.verbose_name }}" data-device-dhid="{{ ac.device.dhid }}" data-device-vname="{{ ac.device.verbose_name }}"
data-action-erasure="{{ ac.id }}" data-action-erasure="{{ ac.id }}"
@ -151,9 +151,9 @@
{% endif %} {% endif %}
{{ ac.device.serial_number.upper() }} {{ ac.device.serial_number.upper() }}
{% endif %} {% endif %}
{% if ac.device.lots | length > 0 %} {% if ac.device.my_partner.lots | length > 0 %}
<h6 class="d-inline"> <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> <span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
{% endfor %} {% endfor %}
</h6> </h6>