Add confirmation popup on delete care or behavior.
This commit is contained in:
parent
1def73b90a
commit
2c178ec205
|
|
@ -55,31 +55,32 @@
|
||||||
<c:if test="${progression.getProgressionByMe() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionByMe() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByMe() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionByMe()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionByMe()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="
|
<td class="
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_someone_else/${progression.getProgressionBySomeoneElse()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_someone_else/${progression.getProgressionBySomeoneElse()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionBySomeoneElse()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionBySomeoneElse()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="
|
<td class="
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_veterinary/${progression.getProgressionByVeterinary()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_veterinary/${progression.getProgressionByVeterinary()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionByVeterinary()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionByVeterinary()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
||||||
|
<input value="${progression.getCare().getName()}" hidden />
|
||||||
<label class="sr-only" for="form_page">Page</label>
|
<label class="sr-only" for="form_page">Page</label>
|
||||||
<input id="form_page" name="page" value="consent_behavior" hidden />
|
<input id="form_page" name="page" value="consent_behavior" hidden />
|
||||||
<label class="sr-only" for="form_consent_behavior_id">Consent behavior ID</label>
|
<label class="sr-only" for="form_consent_behavior_id">Consent behavior ID</label>
|
||||||
|
|
@ -91,7 +92,7 @@
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<h4>Ajouter un soins pour ce comportement de consentement</h4>
|
<h4>Ajouter un soins pour ce comportement de consentement</h4>
|
||||||
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
||||||
|
|
@ -111,11 +112,53 @@
|
||||||
|
|
||||||
<%@ include file="base/footer.jsp" %>
|
<%@ include file="base/footer.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="modal_delete_animal_progression" class="modal fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 id="modal_delete_animal_progression_title" class="modal-title"></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p id="modal_delete_animal_progression_body"><fmt:message key="animal_cares_and_behaviors.delete.modal_body.care"></fmt:message></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<form id="modal_delete_animal_progression_validate_delete" class="pull-right" action="" method="POST">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal"><fmt:message key="modal_button.cancel"></fmt:message></button>
|
||||||
|
<button type="submit" class="btn btn-danger"><fmt:message key="modal_button.delete"></fmt:message></button>
|
||||||
|
<input id="form_page" name="page" value="consent_behavior" hidden />
|
||||||
|
<input id="form_consent_behavior_id" name="redirect_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
|
$("form").submit(function (event) {
|
||||||
|
if ($(this).attr('id') !== 'modal_delete_animal_progression_validate_delete') {
|
||||||
|
var formUrl = $(this).attr('action');
|
||||||
|
if (formUrl.startsWith('${animalDeleteProgressionURL}')) {
|
||||||
|
// Only for deleting care or behavior forms
|
||||||
|
var behaviorName = $(this).find('input')[0].value;
|
||||||
|
$('#modal_delete_animal_progression_title').text(behaviorName);
|
||||||
|
$('#modal_delete_animal_progression_validate_delete').attr('action', formUrl);
|
||||||
|
$('#modal_delete_animal_progression').modal({
|
||||||
|
show: true
|
||||||
|
});
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -58,28 +58,29 @@
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionByMe()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionByMe()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="
|
<td class="
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_someone_else/${progression.getProgressionBySomeoneElse()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_someone_else/${progression.getProgressionBySomeoneElse()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionBySomeoneElse()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionBySomeoneElse()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="
|
<td class="
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_veterinary/${progression.getProgressionByVeterinary()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_veterinary/${progression.getProgressionByVeterinary()}">
|
||||||
<fmt:message key="progression.value.${progression.getProgressionByVeterinary()}"></fmt:message>
|
<fmt:message key="progression.value.${progression.getProgressionByVeterinary()}"></fmt:message>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
||||||
|
<input value="${progression.getConsentBehavior().getName()}" hidden />
|
||||||
<label class="sr-only" for="form_page">Page</label>
|
<label class="sr-only" for="form_page">Page</label>
|
||||||
<input id="form_page" name="page" value="care" hidden />
|
<input id="form_page" name="page" value="care" hidden />
|
||||||
<label class="sr-only" for="form_care_id">Care ID</label>
|
<label class="sr-only" for="form_care_id">Care ID</label>
|
||||||
|
|
@ -91,7 +92,7 @@
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<h4>Ajouter un comportement de consentement pour ce soin</h4>
|
<h4>Ajouter un comportement de consentement pour ce soin</h4>
|
||||||
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
||||||
|
|
@ -110,11 +111,53 @@
|
||||||
|
|
||||||
<%@ include file="base/footer.jsp" %>
|
<%@ include file="base/footer.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="modal_delete_animal_progression" class="modal fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 id="modal_delete_animal_progression_title" class="modal-title"></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p id="modal_delete_animal_progression_body"><fmt:message key="animal_cares_and_behaviors.delete.modal_body.behavior"></fmt:message></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<form id="modal_delete_animal_progression_validate_delete" class="pull-right" action="" method="POST">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal"><fmt:message key="modal_button.cancel"></fmt:message></button>
|
||||||
|
<button type="submit" class="btn btn-danger"><fmt:message key="modal_button.delete"></fmt:message></button>
|
||||||
|
<input id="form_page" name="page" value="care" hidden />
|
||||||
|
<input id="form_care_id" name="redirect_id" value="${MODEL_MAP_ANIMAL_CARE_ID}" hidden />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
|
$("form").submit(function (event) {
|
||||||
|
if ($(this).attr('id') !== 'modal_delete_animal_progression_validate_delete') {
|
||||||
|
var formUrl = $(this).attr('action');
|
||||||
|
if (formUrl.startsWith('${animalDeleteProgressionURL}')) {
|
||||||
|
// Only for deleting care or behavior forms
|
||||||
|
var careName = $(this).find('input')[0].value;
|
||||||
|
$('#modal_delete_animal_progression_title').text(careName);
|
||||||
|
$('#modal_delete_animal_progression_validate_delete').attr('action', formUrl);
|
||||||
|
$('#modal_delete_animal_progression').modal({
|
||||||
|
show: true
|
||||||
|
});
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue