Skip to content

Commit

Permalink
Bugfix: Emtpy tray handling
Browse files Browse the repository at this point in the history
Improvement: Do not try to show any tray info; show "Empty" instead.

This avoids a crash when 'tray_color' is 'None', and also makes things
a little clearer.
  • Loading branch information
mvicomoya committed Jan 14, 2025
1 parent 96a8527 commit 34b20b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/fragments/tray.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@
<div class="card-body">
<!-- Tray Sub-Brand and Type -->
<div class="small text-muted mb-2">
{% if tray_data.tray_type %}
{{ tray_data.tray_type }}
{% if tray_data.tray_sub_brands %}
<br/>
{{ tray_data.tray_sub_brands }}
{% endif %}
{% else %}
Empty
{% endif %}
</div>

{% if tray_data.tray_type %}
<!-- Badge with Dynamic Colors -->
<span class="badge d-inline-block p-2"
style="background-color: #{{ tray_data.tray_color }};
Expand All @@ -36,6 +41,7 @@
<span class="fw-bold">{{ tray_data.remain }}%</span>
{% endif %}
</div>
{% endif %}
</div>
<div class="card-footer">
{% if pick_tray %}
Expand Down

0 comments on commit 34b20b0

Please sign in to comment.