blob: 6148f18fcae701b440a90ce2a5c19f9f73ea6538 [file] [log] [blame]
Anand Doshi330dae92013-09-10 13:46:15 +05301{% extends base_template %}
Anand Doshi6c8ef772013-08-30 18:23:50 +05302
3{% block content -%}
Anand Doshi0c8fd342013-11-21 14:55:45 +05304<div class="container content">
Anand Doshi6c8ef772013-08-30 18:23:50 +05305 <ul class="breadcrumb">
6 <li><a href="index">Home</a></li>
Anand Doshi6c8ef772013-08-30 18:23:50 +05307 <li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
8 </ul>
Anand Doshifb109ad2013-09-11 18:58:20 +05309 <p id="msgprint-alert" class="alert alert-danger"
10 style="display: none;">&nbsp;</p>
Anand Doshi6c8ef772013-08-30 18:23:50 +053011 <div class="list-group transaction-list">
12 <div class="progress progress-striped active">
13 <div class="progress-bar progress-bar-info" style="width: 100%;"></div>
14 </div>
15 </div>
16 <div class="text-center">
17 <button class="btn btn-default btn-show-more hide">More</button>
18 </div>
19</div>
20{%- endblock %}
21
22{% block javascript -%}
Anand Doshi330dae92013-09-10 13:46:15 +053023<script>
Anand Doshi6c8ef772013-08-30 18:23:50 +053024$(document).ready(function() {
25 window.start = 0;
26 window.$list = $(".transaction-list");
27 window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
28
29 get_transactions();
30});
31
32var get_transactions = function(btn) {
33 wn.call({
34 method: "{{ method }}",
35 args: { start: start },
36 btn: btn,
37 callback: function(r) {
38 $list.find(".progress").remove();
39 $show_more.toggleClass("hide", !(r.message && r.message.length===20));
Anand Doshi6c8ef772013-08-30 18:23:50 +053040 if(!(r.message && r.message.length)) {
41 console.log("empty");
42 if(!$list.html().trim()) {
43 $list.html("<div class='alert alert-warning'>\
44 {{ empty_list_message }}</div>");
45 }
46 return;
47 }
48
49 start += r.message.length;
50
51 $.each(r.message, function(i, doc) {
52 render(doc);
53 });
54 }
55 })
56};
Anand Doshi330dae92013-09-10 13:46:15 +053057</script>
Anand Doshi6c8ef772013-08-30 18:23:50 +053058
Anand Doshi330dae92013-09-10 13:46:15 +053059<!-- // var render = function(doc) { }; -->
Anand Doshi6c8ef772013-08-30 18:23:50 +053060{% endblock %}