Make BOM tab badge red if the BOM is not validated

This commit is contained in:
Oliver Walters 2019-05-12 13:12:04 +10:00
parent 06deccca1c
commit 9149619f38
3 changed files with 7 additions and 2 deletions

View File

@ -505,7 +505,7 @@ class Part(models.Model):
@transaction.atomic
def validate_bom(self, user):
""" Check the BOM (mark the BOM as validated by the given User.
""" Validate the BOM (mark the BOM as validated by the given User.
- Calculates and stores the hash for the BOM
- Saves the current date and the checking user

View File

@ -12,7 +12,7 @@
{% endif %}
{% if part.buildable %}
<li{% ifequal tab 'bom' %} class="active"{% endifequal %}>
<a href="{% url 'part-bom' part.id %}">BOM<span class="badge">{{ part.bom_count }}</span></a></li>
<a href="{% url 'part-bom' part.id %}">BOM<span class="badge{% if part.is_bom_valid == False %} badge-alert{% endif %}">{{ part.bom_count }}</span></a></li>
<li{% ifequal tab 'build' %} class="active"{% endifequal %}>
<a href="{% url 'part-build' part.id %}">Build<span class='badge'>{{ part.active_builds|length }}</span></a></li>
{% endif %}

View File

@ -14,6 +14,7 @@
color: #ffcc00;
}
/* CSS overrides for treeview */
.expand-icon {
font-size: 11px;
@ -97,6 +98,10 @@
margin-left: 10px;
}
.badge-alert {
background-color: #f33;
}
.part-thumb {
width: 200px;
height: 200px;