Work event item frontend

This commit is contained in:
Tom Price
2014-12-05 00:16:47 +00:00
parent 3a816dfe63
commit f9ff2459ca
3 changed files with 100 additions and 87 deletions

View File

@@ -1,11 +1,9 @@
<tr id="item-{{item.pk}}" data-url="{% url 'api_secure' item.pk %}" data-pk="{{item.pk}}" class="item_row">
<tr id="item-{{item.pk}}" data-pk="{{item.pk}}" class="item_row">
<td>
<span class="name">{{ item.name }}</span>
{% if item.description %}
<div class="description">
<em>{{item.description|linebreaksbr}}</em>
</div>
{% endif %}
<div>
<em class="description">{{item.description|linebreaksbr}}</em>
</div>
</td>
<td>£&nbsp;<span class="cost">{{item.cost|floatformat:2}}</span></td>
<td class="quantity">{{item.quantity}}</td>

View File

@@ -17,7 +17,7 @@
{% endif %}
</tr>
</thead>
<tbody>
<tbody id="item-table-body">
{% for item in object.items.all %}
{% include 'RIGS/item_row.html' %}
{% endfor %}
@@ -26,17 +26,41 @@
<tr>
<td rowspan="3" colspan="2"></td>
<td>Sum Total</td>
<td colspan="2">£ <span id="sumtotal">{{object.sum_total}}</span></td>
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
</tr>
<tr>
<td id="vat-rate" data-rate="{{object.vat_rate.rate}}">VAT @
{{object.vat_rate.as_percent|floatformat}}%</td>
<td colspan="2">£ <span id="vat">{{object.vat|floatformat:2}}</span></td>
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
<td colspan="2">£ <span id="vat">{{object.vat|default:0|floatformat:2}}</span></td>
</tr>
<tr>
<td>Total</td>
<td colspan="2">£ <span id="total">{{object.total|floatformat:2}}</span></td>
<td colspan="2">£ <span id="total">{{object.total|default:0|floatformat:2}}</span></td>
</tr>
</tfoot>
</table>
</div>
<table class="hidden invisible">
<tr id="new-item-row" class="item_row">
<td>
<span class="name"></span>
<div class="description">
<em></em>
</div>
</td>
<td>£&nbsp;<span class="cost"></span></td>
<td class="quantity"></td>
<td>£&nbsp;<span class="sub-total"></span></td>
{% if edit %}
<td class="vert-align text-right">
<button type="button" class="item-edit btn btn-xs btn-default"
data-toggle="modal" data-target="#itemModal">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="item-delete btn btn-xs btn-danger">
<span class="glyphicon glyphicon-remove"></span>
</button>
</td>
{% endif %}
</tr>
</table>