brotherton-erpnext/erpnext/templates/includes/transactions.html
2014-10-21 16:16:30 +05:30

54 lines
1.4 KiB
HTML

<div class="transactions-content">
<ul class="breadcrumb">
<li><a href="index">Home</a></li>
<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
</ul>
<p id="msgprint-alert" class="alert alert-danger"
style="display: none;">&nbsp;</p>
<div class="list-group transaction-list">
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
</div>
</div>
<div class="text-center">
<button class="btn btn-default btn-show-more hide">More</button>
</div>
</div>
<script>
var get_transactions = function(btn) {
frappe.call({
method: "{{ method }}",
args: { start: start },
btn: btn,
callback: function(r) {
$list.find(".progress").remove();
$show_more.toggleClass("hide", !(r.message && r.message.length===20));
if(!(r.message && r.message.length)) {
if(!$list.html().trim()) {
$list.html("<div class='text-muted'>\
{{ empty_list_message }}</div>");
}
return;
}
start += r.message.length;
$.each(r.message, function(i, doc) {
render(doc);
});
}
})
};
$(document).ready(function() {
window.start = 0;
window.$list = $(".transaction-list");
window.$list.find(".list-group-item").remove();
window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
get_transactions();
});
</script>
<!-- no-sidebar -->