Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 1 | <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;"> </p> |
| 8 | <div class="list-group transaction-list"> |
Anand Doshi | b942cb8 | 2015-01-12 12:18:54 +0530 | [diff] [blame] | 9 | <div class="text-muted progress">{{ _("Loading") }}...</div> |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 10 | </div> |
| 11 | <div class="text-center"> |
| 12 | <button class="btn btn-default btn-show-more hide">More</button> |
| 13 | </div> |
| 14 | </div> |
| 15 | <script> |
| 16 | var 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 --> |