blob: 65651ca5c58f3c372d9834aeb023d248a8ba9e40 [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 -%}
4<div class="col-md-12">
5 <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>
9 <div class="list-group transaction-list">
10 <div class="progress progress-striped active">
11 <div class="progress-bar progress-bar-info" style="width: 100%;"></div>
12 </div>
13 </div>
14 <div class="text-center">
15 <button class="btn btn-default btn-show-more hide">More</button>
16 </div>
17</div>
18{%- endblock %}
19
20{% block javascript -%}
Anand Doshi330dae92013-09-10 13:46:15 +053021<script>
Anand Doshi6c8ef772013-08-30 18:23:50 +053022$(document).ready(function() {
23 window.start = 0;
24 window.$list = $(".transaction-list");
25 window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
26
27 get_transactions();
28});
29
30var get_transactions = function(btn) {
31 wn.call({
32 method: "{{ method }}",
33 args: { start: start },
34 btn: btn,
35 callback: function(r) {
36 $list.find(".progress").remove();
37 $show_more.toggleClass("hide", !(r.message && r.message.length===20));
38
39 if(!(r.message && r.message.length)) {
40 console.log("empty");
41 if(!$list.html().trim()) {
42 $list.html("<div class='alert alert-warning'>\
43 {{ empty_list_message }}</div>");
44 }
45 return;
46 }
47
48 start += r.message.length;
49
50 $.each(r.message, function(i, doc) {
51 render(doc);
52 });
53 }
54 })
55};
Anand Doshi330dae92013-09-10 13:46:15 +053056</script>
Anand Doshi6c8ef772013-08-30 18:23:50 +053057
Anand Doshi330dae92013-09-10 13:46:15 +053058<!-- // var render = function(doc) { }; -->
Anand Doshi6c8ef772013-08-30 18:23:50 +053059{% endblock %}