Compare commits
2
Commits
ff1a883170
...
1980453cab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1980453cab | ||
|
|
c0115aebf9 |
@@ -81,7 +81,7 @@ Battery Tracker gives you a single source of truth:
|
||||
| Database | SQLite (dev) / MariaDB (prod) |
|
||||
| WSGI server | Waitress |
|
||||
| Process manager | systemd user service |
|
||||
| Tests | pytest (145 tests) |
|
||||
| Tests | pytest (255 tests, 99% coverage) |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@ class Device(Base):
|
||||
def is_subcomponent(self):
|
||||
return self.parent_id is not None
|
||||
|
||||
def can_have_subcomponents(self):
|
||||
return self.parent_id is None and self.battery_slots == 0
|
||||
|
||||
def effective_installed_count(self):
|
||||
if self.has_children():
|
||||
return sum(c.installed_count() for c in self.children)
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if device.children or not device.is_subcomponent() %}
|
||||
{% if device.children or device.can_have_subcomponents() %}
|
||||
<div class="card">
|
||||
{% if device.children %}
|
||||
<h2>Sub-components</h2>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user