177 lines
10 KiB
Plaintext
177 lines
10 KiB
Plaintext
<%@page import="fr.geoffrey.medical_training_tracker.dao.bean.Animal"%>
|
|
<%@page import="java.util.List"%>
|
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
|
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
|
<%@ page isELIgnored="false" %>
|
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/delete/progression" var="animalDeleteProgressionURL" />
|
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/add/progression" var="animalAddProgressionURL" />
|
|
|
|
<%@ include file="base/language.jsp" %>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="${language}">
|
|
<head>
|
|
<%@ include file="base/header.jsp" %>
|
|
<style type="text/css">
|
|
fieldset {
|
|
margin: auto;
|
|
width: 600px;
|
|
margin-top: 30px;
|
|
margin-bottom: 10px;
|
|
padding: 20px;
|
|
text-align: left;
|
|
border: 2px solid #aaa;
|
|
}
|
|
fieldset a {
|
|
width: 150px;
|
|
margin-bottom: 10px;
|
|
float: right;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<%@ include file="base/navbar.jsp" %>
|
|
<center><h1>
|
|
<fmt:message key="animal_behavior.title">
|
|
<fmt:param value="${MODEL_MAP_ANIMAL.getName()}" />
|
|
</fmt:message>
|
|
</h1></center>
|
|
<h3>
|
|
<fmt:message key="animal_behavior.subtitle">
|
|
<fmt:param value="${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getName()}" />
|
|
</fmt:message>
|
|
</h3>
|
|
<p>${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getDescription()}</p>
|
|
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th><fmt:message key="animal_behavior.table.care"></fmt:message></th>
|
|
<th><fmt:message key="animal_behavior.table.executed_by_me"></fmt:message></th>
|
|
<th><fmt:message key="animal_behavior.table.executed_by_someone_else"></fmt:message></th>
|
|
<th><fmt:message key="animal_behavior.table.executed_by_veterinary"></fmt:message></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<c:forEach items="${MODEL_MAP_ANIMAL.getProgressionList()}" var="progression">
|
|
<tr>
|
|
<td><a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/care/${progression.getCare().getId()}">${progression.getCare().getName()}</a></td>
|
|
<td class="
|
|
<c:if test="${progression.getProgressionByMe() == 'TRAINED'}">success</c:if>
|
|
<c:if test="${progression.getProgressionByMe() == 'CURRENTLY_TRAINING'}">info</c:if>
|
|
<c:if test="${progression.getProgressionByMe() == 'NOT_TRAINED'}">active</c:if>
|
|
">
|
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
|
<fmt:message key="progression.value.${progression.getProgressionByMe()}"></fmt:message>
|
|
</a>
|
|
</td>
|
|
<td class="
|
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</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()}">
|
|
<fmt:message key="progression.value.${progression.getProgressionBySomeoneElse()}"></fmt:message>
|
|
</a>
|
|
</td>
|
|
<td class="
|
|
<c:if test="${progression.getProgressionByVeterinary() == 'TRAINED'}">success</c:if>
|
|
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
|
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
|
">
|
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_veterinary/${progression.getProgressionByVeterinary()}">
|
|
<fmt:message key="progression.value.${progression.getProgressionByVeterinary()}"></fmt:message>
|
|
</a>
|
|
</td>
|
|
<td>
|
|
<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>
|
|
<input id="form_page" name="page" value="consent_behavior" hidden />
|
|
<label class="sr-only" for="form_consent_behavior_id">Consent behavior ID</label>
|
|
<input id="form_consent_behavior_id" name="redirect_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
|
<button class="btn btn-danger" type="submit" data-toggle="tooltip" data-placement="bottom" title="<fmt:message key="animal_behavior.button.delete.tooltip"></fmt:message>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr/>
|
|
<h4><fmt:message key="animal_behavior.add_care"></fmt:message></h4>
|
|
<c:if test="${MODEL_MAP_LIST_REMAINING_CARES.size() == 0}" >
|
|
<p><fmt:message key="animal_behavior.add_care.empty_list"></fmt:message></p>
|
|
</c:if>
|
|
<c:if test="${MODEL_MAP_LIST_REMAINING_CARES.size() != 0}" >
|
|
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
|
<label class="sr-only" for="form_page">Page</label>
|
|
<input id="form_page" name="page" value="consent_behavior" hidden />
|
|
<label class="sr-only" for="form_consent_behavior_id">Consent Behavior ID</label>
|
|
<input id="form_consent_behavior_id" name="consent_behavior_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
|
<label class="sr-only" for="form_care_id">Care ID</label>
|
|
<select id="form_care_id" class="form-control" name="care_id">
|
|
<c:forEach items="${MODEL_MAP_LIST_REMAINING_CARES}" var="care">
|
|
<option value="${care.getId()}">${care.getName()}</option>
|
|
</c:forEach>
|
|
</select>
|
|
<input id="form_care_id" name="care_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
|
<button class="btn btn-success" type="submit" data-toggle="tooltip" data-placement="bottom" title="<fmt:message key="animal_behavior.button.add.tooltip"></fmt:message>"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
|
|
</form>
|
|
</c:if>
|
|
|
|
<%@ include file="base/footer.jsp" %>
|
|
</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>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$('[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>
|
|
</html>
|