Make a common "item" element for templates
This commit is contained in:
12
templates/common/item.html
Normal file
12
templates/common/item.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="inventory-item-{{item.material}}">
|
||||
{% if quantity > 0 %}
|
||||
<div class="quantity">{{quantity}}</div>
|
||||
{% endif %}
|
||||
<div class="name">{{item.name}}</div>
|
||||
{% if item.damage %}
|
||||
<div class="damage">
|
||||
<div class="current"
|
||||
style="width:{{item.damagePct}}%"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
@@ -12,18 +12,9 @@
|
||||
<tr>
|
||||
{% endif %}
|
||||
<td>
|
||||
<div class="inventory-item-{{slot.item}}">
|
||||
{% if slot.quantity > 0 %}
|
||||
<div class="quantity">{{slot.quantity}}</div> <div
|
||||
class="name">{{slot.name}}</div>
|
||||
{% if slot.damage %}
|
||||
<div class="damage">
|
||||
<div class="current"
|
||||
style="width:{{slot.damagePct}}%"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if slot.item %}
|
||||
{% include 'common/item.html' with quantity=slot.quantity item=slot.item %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user