Added 'Update from Master' functionality for slave domain template.

This commit is contained in:
Ivan Filippov 2016-04-29 11:07:46 -06:00
parent 5842617b31
commit efb9cc1709

View File

@ -24,12 +24,18 @@
<h3 class="box-title">Manage Records for {{ domain.name }}</h3> <h3 class="box-title">Manage Records for {{ domain.name }}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
{% if domain.type != 'Slave' %}
<button type="button" class="btn btn-flat btn-primary pull-left button_add_record" id="{{ domain.name }}"> <button type="button" class="btn btn-flat btn-primary pull-left button_add_record" id="{{ domain.name }}">
Add Record&nbsp;<i class="fa fa-plus"></i> Add Record&nbsp;<i class="fa fa-plus"></i>
</button> </button>
<button type="button" class="btn btn-flat btn-primary pull-right button_apply_changes" id="{{ domain.name }}"> <button type="button" class="btn btn-flat btn-primary pull-right button_apply_changes" id="{{ domain.name }}">
Apply Changes&nbsp;<i class="fa fa-floppy-o"></i> Apply Changes&nbsp;<i class="fa fa-floppy-o"></i>
</button> </button>
{% else %}
<button type="button" class="btn btn-flat btn-primary pull-left button_update_from_master" id="{{ domain.name }}">
Update from Master&nbsp;<i class="fa fa-download"></i>
</button>
{% endif %}
</div> </div>
<div class="box-body"> <div class="box-body">
<table id="tbl_records" class="table table-bordered table-striped"> <table id="tbl_records" class="table table-bordered table-striped">
@ -219,7 +225,12 @@
nEditing = null; nEditing = null;
nNew = false; nNew = false;
}); });
//handle update_from_master button
$(document).on("click", ".button_update_from_master", function (e) {
var domain = $(this).prop('id');
applyChanges({'domain': domain}, '/domain/' + domain + '/update');
});
</script> </script>
{% endblock %} {% endblock %}
{% block modals %} {% block modals %}