{% extends "app/website/templates/html/page.html" %} {% block content %}
{% endblock %} {% block javascript %} global_number_format = "{{ global_number_format }}"; currency = "{{ currency }}"; wn.currency_symbols = {{ currency_symbols }}; $(document).ready(function() { var start = 0; var $list = $(".transaction-list"); var $show_more = $(".btn-show-more").on("click", function() { get_transactions(this); }); var get_transactions = function(btn) { wn.call({ method: "{{ method }}", args: { start: start }, btn: btn, callback: function(r) { $list.find(".progress").remove(); $show_more.toggle(!(r.message && r.message.length===20)); if(!(r.message && r.message.length)) { console.log("empty"); if(!$list.html().trim()) { $list.html("
\ {{ empty_list_message }}
"); } return; } start += r.message.length; $.each(r.message, function(i, doc) { render(doc); }); } }) }; var render = function(doc) { doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency); var $row = $(repl('\
\
\
%(name)s
\
%(items)s...
\
\
%(grand_total_export)s
\
%(creation)s
\
\
', doc)).appendTo($list); }; get_transactions(); }); {% endblock %}