blob: fb570cd20b92ba3c41e861507e099fb0a614c1ab [file] [log] [blame]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +05301<div class="transactions-content">
2 <ul class="breadcrumb">
3 <li><a href="index">Home</a></li>
4 <li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
5 </ul>
6 <p id="msgprint-alert" class="alert alert-danger"
7 style="display: none;">&nbsp;</p>
8 <div class="list-group transaction-list">
Anand Doshib942cb82015-01-12 12:18:54 +05309 <div class="text-muted progress">{{ _("Loading") }}...</div>
Rushabh Mehta3daa49a2014-10-21 16:16:30 +053010 </div>
11 <div class="text-center">
12 <button class="btn btn-default btn-show-more hide">More</button>
13 </div>
14</div>
15<script>
16var get_transactions = function(btn) {
17 frappe.call({
18 method: "{{ method }}",
19 args: { start: start },
20 btn: btn,
21 callback: function(r) {
22 $list.find(".progress").remove();
23 $show_more.toggleClass("hide", !(r.message && r.message.length===20));
24 if(!(r.message && r.message.length)) {
25 if(!$list.html().trim()) {
26 $list.html("<div class='text-muted'>\
27 {{ empty_list_message }}</div>");
28 }
29 return;
30 }
31
32 start += r.message.length;
33
34 $.each(r.message, function(i, doc) {
35 render(doc);
36 });
37 }
38 })
39};
40
41$(document).ready(function() {
42 window.start = 0;
43 window.$list = $(".transaction-list");
44 window.$list.find(".list-group-item").remove();
45 window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
46
47 get_transactions();
48});
49</script>
50
51<!-- no-sidebar -->