Whee broken HEAD

This commit is contained in:
2021-07-05 23:24:13 +01:00
parent a3729fa930
commit dff5ac2308
18 changed files with 177 additions and 233 deletions

View File

@@ -0,0 +1,58 @@
<div class="modal fade" id="itemModal" role="dialog" aria-labelledby="itemModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4>{{ object.name|default:"New Event" }}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="item-form">
<div class="modal-body">
<div class="form-group form-row">
<label for="item_name" class="col-sm-2 col-form-label">Item Name</label>
<div class="col-sm-10">
<input type="text" placeholder="Item Name" class="form-control" required maxlength="255"
id="item_name"/>
</div>
</div>
<div class="form-group form-row">
<label for="item_description" class="col-sm-2 col-form-label">Description</label>
<div class="col-sm-10">
<textarea type="text" placeholder="Description" class="form-control"
id="item_description" rows="8"></textarea>
</div>
</div>
<div class="form-row">
<div class="col-sm-6">
<div class="form-group form-row">
<label for="item_quantity" class="col-sm-4 col-form-label">Quantity</label>
<div class="col-sm-8">
<input type="number" placeholder="Quantity" class="form-control" required
min="1" id="item_quantity"/>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group form-row">
<label for="item_cost" class="col-sm-4 col-form-label">Cost</label>
<div class="col-sm-8">
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">£</span></div>
<input type="number" placeholder="Cost" class="form-control" required
min="-99999999.99" max="99999999.99" step="0.01"
id="item_cost"/>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,81 @@
<div class="table-responsive">
<table class="table table-hover" id="item-table" {% if edit %}data-orderurl="{#% url 'item_order' %#}"{% endif %}>
<thead>
<tr>
<th scope="col">Item</th>
{% if perms.RIGS.view_event %}
<th scope="col">Price</th>
{% endif %}
<th scope="col">Quantity</th>
{% if perms.RIGS.view_event %}
<th scope="col">Sub-total</th>
{% endif %}
{% if edit %}
<th scope="col" class="text-right align-self-start">
<button type="button" class="btn btn-success btn-sm item-add"
data-toggle="modal"
data-target="#itemModal">
<i class="fas fa-plus"></i> Add Item
</button>
</th>
{% endif %}
</tr>
</thead>
<tbody id="item-table-body">
{% for item in object.items.all %}
{% include 'item_row.html' %}
{% endfor %}
</tbody>
{% if auth or perms.RIGS.view_event %}
<tfoot>
<tr>
<td rowspan="3" colspan="2"></td>
<td>Total (ex. VAT)</td>
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
</tr>
<tr>
{% if not object.pk %}
<td id="vat-rate" data-rate="{{currentVAT.rate}}">VAT @
{{currentVAT.as_percent|floatformat}}% (TBC)</td>
{% else %}
<td id="vat-rate" data-rate="{{object.vat_rate.rate}}">VAT @
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
{% endif %}
<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|default:0|floatformat:2}}</span></td>
</tr>
</tfoot>
{% endif %}
</table>
</div>
<table class="hidden invisible">
<tr id="new-item-row" class="item_row">
<td>
<span class="name"></span>
<div class="item-description">
<em class="description"></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">
<div class="btn-group" role="group" aria-label="Action buttons">
<button type="button" class="item-edit btn btn-sm btn-warning"
data-pk="{{item.pk}}"
data-toggle="modal" data-target="#itemModal">
<span class="fas fa-edit"></span>
</button>
<button type="button" class="item-delete btn btn-sm btn-danger"
data-pk="{{item.pk}}">
<span class="fas fa-times-circle"></span>
</button>
</div>
</td>
{% endif %}
</tr>
</table>