use mustache to abstract out html logic in javascript
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{{#orders}}
|
||||
<tr class="{{state}}">
|
||||
<td>{{products_display}}</td>
|
||||
<td class="currency">{{#currency}}{{total_amount}}{{/currency}}</td>
|
||||
</tr>
|
||||
{{/orders}}
|
||||
@@ -0,0 +1 @@
|
||||
<tr><td></td><td class="currency"><strong>{{#currency}}{{total_amount}}{{/currency}}</strong></td></tr>
|
||||
@@ -0,0 +1,29 @@
|
||||
<table id="active-order-table" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-t="models.product"></th>
|
||||
<th>#</th>
|
||||
<th class="currency" data-t="basket.total"></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#products}}
|
||||
<tr>
|
||||
<td>{{name}}</td>
|
||||
<td>{{number}}</td>
|
||||
<td class="currency">{{#currency}}{{product_total}}{{/currency}}</td>
|
||||
</tr>
|
||||
{{/products}}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<button class="btn btn-primary" onClick="Quser.handle_active_list(function(){Quser.order_selected_products()})" data-t="selected_products.order"></button>
|
||||
<button class="btn btn btn-warning" onClick="Quser.clear_selected_products()" data-t="selected_products.clear"></button>
|
||||
</td>
|
||||
<td class="currency"><strong id="active-order-total">{{#currency}}{{total}}{{/currency}}</strong></td>
|
||||
<td></td>
|
||||
<tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -0,0 +1,7 @@
|
||||
<tr><td colspan="2"><h4>{{category}}</h4></td></tr>
|
||||
{{#products}}
|
||||
<tr>
|
||||
<td>{{name}}</td>
|
||||
<td>{{#currency}}{{price}}{{/currency}}</td>
|
||||
</tr>
|
||||
{{/products}}
|
||||
@@ -0,0 +1,13 @@
|
||||
<tr><td colspan="4"><h4>{{category}}</h4></td></tr>
|
||||
{{#products}}
|
||||
<tr>
|
||||
<td>{{name}}</td>
|
||||
<td class="order-count-cell">
|
||||
<span class="btn btn-info btn-mini" onclick="Quser.lower_products_counter('{{_id}}')">-</span>
|
||||
<span id="order-product-count-{{_id}}" class="order-product-count">1</span>
|
||||
<span class="btn btn-info btn-mini" onclick="Quser.increment_products_counter('{{_id}}')">+</span>
|
||||
</td>
|
||||
<td>{{#currency}}{{price}}{{/currency}}</td>
|
||||
<td><button class="btn btn-mini btn-primary" onclick="Quser.add_product_to_order('{{_id}}', this)">Add</button></td>
|
||||
</tr>
|
||||
{{/products}}
|
||||
Reference in New Issue
Block a user