2014-10-21 10:46:30 +00:00
|
|
|
{% 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">
|
2015-04-24 17:21:50 +00:00
|
|
|
<p><a class="btn btn-default" href="/address"><i class="icon-plus"> New Address</i></a></p>
|
2014-10-21 10:46:30 +00:00
|
|
|
<hr>
|
|
|
|
<div id="address-list">
|
2015-01-12 06:48:54 +00:00
|
|
|
<div class="text-muted progress">{{ _("Loading") }}...</div>
|
2014-10-21 10:46:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
;(function() {
|
|
|
|
var fetch_addresses = function() {
|
|
|
|
frappe.call({
|
2014-10-22 10:26:38 +00:00
|
|
|
method: "erpnext.templates.pages.addresses.get_addresses",
|
2014-10-21 10:46:30 +00:00
|
|
|
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> \
|
2015-04-24 17:21:50 +00:00
|
|
|
<p><a href="/address?name=%(url_name)s">%(name)s</a></p> \
|
2014-10-21 10:46:30 +00:00
|
|
|
<p>%(display)s</p> \
|
|
|
|
<hr> \
|
|
|
|
</div>', address)).appendTo($list);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
fetch_addresses();
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<!-- no-sidebar -->
|
|
|
|
{% endblock %}
|
|
|
|
|