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 @property
def ram_size(self) -> int: def ram_size(self) -> int:
"""The total of RAM memory the computer has.""" """The total of RAM memory the computer has."""
return sum( components = self.components
ram.size or 0 for ram in self.components if isinstance(ram, RamModule) 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 @property
def data_storage_size(self) -> int: def data_storage_size(self) -> int:
"""The total of data storage the computer has.""" """The total of data storage the computer has."""
return sum( components = self.components
ds.size or 0 for ds in self.components if isinstance(ds, DataStorage) 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 @property
def processor_model(self) -> str: def processor_model(self) -> str:

View File

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

View File

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