Merge pull request #436 from eReuse/bugfix/doc-erasure-fix-hid

fix hide hid of erasure certificate
This commit is contained in:
cayop 2023-03-15 17:50:39 +01:00 committed by GitHub
commit 494a14c7f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 10 deletions

View File

@ -1262,16 +1262,18 @@ class Computer(Device):
@property
def ram_size(self) -> int:
"""The total of RAM memory the computer has."""
return sum(
ram.size or 0 for ram in self.components if isinstance(ram, RamModule)
)
components = self.components
if self.placeholder and self.placeholder.binding:
components = self.placeholder.binding.components
return sum(ram.size or 0 for ram in components if isinstance(ram, RamModule))
@property
def data_storage_size(self) -> int:
"""The total of data storage the computer has."""
return sum(
ds.size or 0 for ds in self.components if isinstance(ds, DataStorage)
)
components = self.components
if self.placeholder and self.placeholder.binding:
components = self.placeholder.binding.components
return sum(ds.size or 0 for ds in components if isinstance(ds, DataStorage))
@property
def processor_model(self) -> str:

View File

@ -23,6 +23,16 @@
padding-top: 0px;
padding-bottom: 5px;
}
#ApplyDeviceLots {
color: #993365;
font-weight: bold;
}
#ApplyDeviceLots.disabled {
color: #adb5bd;
font-weight: normal;
pointer-events: none;
background-color: #fff;
}
.help {
color: #993365;
}

View File

@ -288,10 +288,10 @@
{% for erasure in erasures %}
<tr style="border-bottom: 1px dashed #000;">
<td>
{{ erasure.device.serial_number.upper() }}
{{ erasure.device.serial_number and erasure.device.serial_number.upper() or '' }}
</td>
<td>
{{ erasure.parent.serial_number.upper() }}
{{ erasure.parent.serial_number and erasure.parent.serial_number.upper() or '' }}
</td>
<td>
{{ erasure.get_public_name() }}
@ -320,14 +320,14 @@
<dt>Computer where was erase:</dt>
<dd>Title: {{ erasure.parent.__format__('ts') }}</dd>
<dd>DevicehubID: {{ erasure.parent.dhid }}</dd>
<dd>Hid: {{ erasure.parent.hid }}</dd>
<dd>Hid: {{ erasure.parent.chid }}</dd>
<dd>Tags: {{ erasure.parent.tags }}</dd>
{% if erasure.device.parent %}
<dt>Computer where it resides:</dt>
<dd>Title: {{ erasure.device.parent.__format__('ts') }}</dd>
<dd>DevicehubID: {{ erasure.device.parent.dhid }}</dd>
<dd>Hid: {{ erasure.device.parent.hid }}</dd>
<dd>Hid: {{ erasure.device.parent.chid }}</dd>
<dd>Tags: {{ erasure.device.parent.tags }}</dd>
{% endif %}
{% endif %}
@ -344,6 +344,16 @@
</ol>
</dd>
{% endif %}
{% if erasure.device.proofs %}
<dt>DLT Proofs:</dt>
<dd>
<ol>
{% for proof in erasure.device.proofs %}
<li>{{ proof.type }}: {{ proof.timestamp }}</li>
{% endfor %}
</ol>
</dd>
{% endif %}
</dl>
</div>
{% endfor %}