Add status colors to job menu

master
Pete Ley 3 weeks ago
parent 142e0ebe8c
commit 1934d1ffa8

@ -318,6 +318,17 @@ class Job(models.Model):
return q.filter(takeoff__blocks__has_any_keys=filter_appids)
return q
def status_color(self):
if self.stairs_in_design():
return 'blue'
if self.stairs_in_fab():
return 'red'
if self.stairs_at_engineering():
return 'green'
if self.stairs_at_submittal():
return 'orange'
return 'initial'
class Meta:
ordering = ['-number']

@ -399,6 +399,7 @@
<li class="nav-link p-1"
style="--bs-nav-link-margin-x: 3px">
<a class="btn btn-sm btn-outline-secondary {% if j == job %}active{% endif %}"
style="--bs-btn-border-color: {{ j.status_color }};"
href="{% url 'jobs:job_detail' pk=j.pk %}">
{{ j.number }}
</a>

Loading…
Cancel
Save