62 lines
1.5 KiB
HTML
62 lines
1.5 KiB
HTML
|
{% extends "html/page.html" %}
|
||
|
|
||
|
{% set title="My Orders" %}
|
||
|
|
||
|
{% block content %}
|
||
|
<div class="span12">
|
||
|
<ul class="breadcrumb">
|
||
|
<li><a href="index">Home</a> <span class="divider">/</span></li>
|
||
|
<li><a href="account">My Account</a> <span class="divider">/</span></li>
|
||
|
<li class="active">My Orders</li>
|
||
|
</ul>
|
||
|
<h3><i class="icon-list"></i> My Orders</h3>
|
||
|
<hr>
|
||
|
<div id="order-list" style="font-size: 13px;">
|
||
|
<div class="progress progress-striped active">
|
||
|
<div class="bar" style="width: 100%;"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<script>
|
||
|
$(document).ready(function() {
|
||
|
var order_start = 0;
|
||
|
|
||
|
wn.call({
|
||
|
method: "selling.doctype.sales_order.sales_order.get_orders",
|
||
|
args: {
|
||
|
start: order_start
|
||
|
},
|
||
|
callback: function(r) {
|
||
|
$("#order-list .progress").remove();
|
||
|
var $list = $("#order-list");
|
||
|
|
||
|
if(!(r.message && r.message.length)) {
|
||
|
$list.html("<div class='alert'>No Orders Yet</div>");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$.each(r.message, function(i, order) {
|
||
|
|
||
|
// parent
|
||
|
var $order = $(repl('<div class="row">\
|
||
|
<div class="span4"><a href="order?id=%(name)s">%(name)s</a></span3>\
|
||
|
</div>', order)).appendTo($list);
|
||
|
|
||
|
// items
|
||
|
$.each(order.items || [], function(i, item) {
|
||
|
var $item = $(repl('<div class="span8">\
|
||
|
<div class="row">\
|
||
|
<div class="span4">%(item_name)s</div>\
|
||
|
<div class="span2">%(export_rate)s</div>\
|
||
|
<div class="span2">%(status)s</div>\
|
||
|
</div>\
|
||
|
</div>', item)).appendTo($order);
|
||
|
});
|
||
|
|
||
|
$("<hr>").appendTo($list);
|
||
|
});
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
</script>
|
||
|
{% endblock %}
|