diff --git a/app/templates/domain.html b/app/templates/domain.html index 68c9e15..d7e4ebc 100644 --- a/app/templates/domain.html +++ b/app/templates/domain.html @@ -68,14 +68,14 @@ {% if domain.type != 'Slave' %} {% if record.is_allowed_edit() %} - + {% else %} {% endif %} {% if record.is_allowed_delete() %} - + {% endif %} {% else %} @@ -201,6 +201,13 @@ // handle apply changes button $(document.body).on("click",".button_apply_changes", function() { + if (nNew || nEditing) { + var modal = $("#modal_error"); + modal.find('.modal-body p').text("Previous record not saved. Please save it before applying the changes."); + modal.modal('show'); + return; + } + var modal = $("#modal_apply_changes"); var table = $("#tbl_records").DataTable(); var domain = $(this).prop('id'); diff --git a/app/templates/template_edit.html b/app/templates/template_edit.html index 5983a34..bba6f67 100644 --- a/app/templates/template_edit.html +++ b/app/templates/template_edit.html @@ -48,7 +48,7 @@ {% for record in records %} - + {{ record.name }} @@ -65,12 +65,12 @@ {{ record.data }} - - @@ -187,6 +187,13 @@ // handle apply changes button $(document.body).on("click",".button_apply_changes", function() { + if (nNew || nEditing) { + var modal = $("#modal_error"); + modal.find('.modal-body p').text("Previous record not saved. Please save it before applying the changes."); + modal.modal('show'); + return; + } + var modal = $("#modal_apply_changes"); var table = $("#tbl_records").DataTable(); var template = $(this).prop('id');