53 lines
1.3 KiB
HTML
53 lines
1.3 KiB
HTML
{% block title %} {{ "My Addresses" }} {% endblock %}
|
|
|
|
{% block header %}<h2>My Addresses</h2>{% endblock %}
|
|
|
|
{% block breadcrumbs %}{% include "templates/includes/breadcrumbs.html" %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="addresses-content">
|
|
<p><a class="btn btn-default" href="address"><i class="icon-plus"> New Address</i></a></p>
|
|
<hr>
|
|
<div id="address-list">
|
|
<div class="progress progress-striped active">
|
|
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
;(function() {
|
|
var fetch_addresses = function() {
|
|
frappe.call({
|
|
method: "shopping_cart.templates.pages.addresses.get_addresses",
|
|
callback: function(r) {
|
|
$("#address-list .progress").remove();
|
|
var $list = $("#address-list");
|
|
|
|
if(!(r.message && r.message.length)) {
|
|
$list.html("<div class='alert'>No Addresses Found</div>");
|
|
return;
|
|
}
|
|
|
|
$.each(r.message, function(i, address) {
|
|
address.url_name = encodeURIComponent(address.name);
|
|
$(repl('<div> \
|
|
<p><a href="address?name=%(url_name)s">%(name)s</a></p> \
|
|
<p>%(display)s</p> \
|
|
<hr> \
|
|
</div>', address)).appendTo($list);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
fetch_addresses();
|
|
});
|
|
})();
|
|
</script>
|
|
|
|
<!-- no-sidebar -->
|
|
{% endblock %}
|
|
|