187 lines
11 KiB
Plaintext
187 lines
11 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/delete" var="animalDeleteURL" />
|
||
<spring:url value="/change_password" var="changePasswordURL" />
|
||
|
||
<%@ 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_list.title"></fmt:message></h1></center>
|
||
<div class="row">
|
||
<div class="col-lg-5">
|
||
<h4><fmt:message key="animal_list.animal_list.title"></fmt:message></h4>
|
||
<div class="list-group">
|
||
<c:forEach items="${MODEL_MAP_ANIMAL_LIST}" var="animal">
|
||
<a class="list-group-item" href="${animalURL}/${animal.getId()}/cares_and_behaviors">
|
||
${animal.getName()}
|
||
<form class="pull-right" action="${animalDeleteURL}/${animal.getId()}" method="POST">
|
||
<input value="${animal.getName()}" hidden />
|
||
<button class="btn btn-xs btn-danger" type="submit" data-toggle="tooltip" data-placement="bottom" title="<fmt:message key="animal_list.animal.delete.tooltip"></fmt:message>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||
</form>
|
||
|
||
<form class="pull-right" action="${animalURL}/${animal.getId()}/edit" method="GET">
|
||
<input value="${animal.getName()}" hidden />
|
||
<button class="btn btn-xs btn-default" type="submit" data-toggle="tooltip" data-placement="bottom" title="<fmt:message key="animal_list.animal.edit.tooltip"></fmt:message>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>
|
||
</form>
|
||
</a>
|
||
<!-- <div class="list-group-item">
|
||
${animal.getName()}
|
||
<form class="pull-right" action="${animalDeleteURL}/${animal.getId()}" method="POST">
|
||
<button class="btn btn-sm btn-danger" type="submit" data-toggle="tooltip" data-placement="bottom" title="Suppression"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||
</form>
|
||
</div>-->
|
||
</c:forEach>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<h4><fmt:message key="animal_list.animal.add.title"></fmt:message></h4>
|
||
<form id="addAnimalForm" class="form-inline" action="${animalURL}" method="POST">
|
||
<div class="form-group">
|
||
<label for="form_animal_name"><fmt:message key="animal_list.animal.add.label"></fmt:message></label>
|
||
<input type="text" id="form_animal_name" name="name" class="form-control" placeholder="<fmt:message key="animal_list.animal.add.placeholder"></fmt:message>" required />
|
||
</div>
|
||
<button class="btn btn btn-success" type="submit" data-toggle="tooltip" data-placement="bottom" title="<fmt:message key="animal_list.animal.add.tooltip"></fmt:message>"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
|
||
</form>
|
||
</div>
|
||
<div class="col-lg-2">
|
||
</div>
|
||
<div class="col-lg-5">
|
||
<h4><fmt:message key="animal_list.change_password.title"></fmt:message></h4>
|
||
<form id="changePasswordForm" action="${changePasswordURL}" method="POST">
|
||
<div class="form-group">
|
||
<label for="old_password"><fmt:message key="animal_list.change_password.old_password.label"></fmt:message></label>
|
||
<input type="password" id="old_password" name="old_password" class="form-control" placeholder="<fmt:message key="animal_list.change_password.old_password.placeholder"></fmt:message>" required/>
|
||
<label for="password"><fmt:message key="animal_list.change_password.new_password.label"></fmt:message></label>
|
||
<input type="password" id="password" name="password" class="form-control" placeholder="<fmt:message key="animal_list.change_password.new_password.placeholder"></fmt:message>" required/>
|
||
<label for="password_check"><fmt:message key="animal_list.change_password.new_password_check.label"></fmt:message></label>
|
||
<input type="password" id="password_check" name="password_check" class="form-control" placeholder="<fmt:message key="animal_list.change_password.new_password_check.placeholder"></fmt:message>" required/>
|
||
</div>
|
||
<button class="btn btn btn-primary" type="submit"><fmt:message key="animal_list.change_password.submit"></fmt:message></button>
|
||
</form>
|
||
<c:if test="${MODEL_MAP_CHANGE_PASSWORD_ERROR_MESSAGE == 'true'}">
|
||
<div class="list-group">
|
||
<h5 class="list-group-item list-group-item-danger" style="border-radius: 5px;">Erreur lors de la mise <20> jour du mot de passe</h5>
|
||
</div>
|
||
</c:if>
|
||
<c:if test="${MODEL_MAP_CHANGE_PASSWORD_SUCCESS_MESSAGE == 'true'}">
|
||
<div class="list-group">
|
||
<h5 class="list-group-item list-group-item-success" style="border-radius: 5px;">Mot de passe mit <20> jour avec succ<63>s</h5>
|
||
</div>
|
||
</c:if>
|
||
</div>
|
||
</div>
|
||
|
||
<%@ include file="base/footer.jsp" %>
|
||
</div>
|
||
|
||
|
||
<div id="modal_delete_animal" 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_title" class="modal-title">Animal name</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<p id="modal_delete_animal_body"><fmt:message key="animal_list.delete.modal_body"></fmt:message></p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<form id="modal_delete_animal_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>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div id="modal_edit_animal" 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_edit_animal_title" class="modal-title"><fmt:message key="animal_list.edit_animal.modal.title"></fmt:message></h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form id="modal_edit_animal_form" action="" method="POST">
|
||
<label for="modal_edit_animal_form_name"><fmt:message key="animal_list.edit_animal.modal.label"></fmt:message></label>
|
||
<input type="text" id="modal_edit_animal_form_name" name="name" class="form-control" placeholder="<fmt:message key="animal_list.edit_animal.modal.placeholder"></fmt:message>" required/>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal"><fmt:message key="modal_button.cancel"></fmt:message></button>
|
||
<button form="modal_edit_animal_form" type="submit" class="btn btn-primary"><fmt:message key="modal_button.edit"></fmt:message></button>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</body>
|
||
|
||
<script type="text/javascript">
|
||
$(document).ready(function () {
|
||
$('[data-toggle="tooltip"]').tooltip();
|
||
|
||
$("form").submit(function (event) {
|
||
var formUrl = $(this).attr('action');
|
||
if (formUrl.startsWith('${animalDeleteURL}')) {
|
||
if ($(this).attr('id') !== 'modal_delete_animal_validate_delete') {
|
||
// Only for deleting animal forms
|
||
var animalName = $(this).find('input')[0].value;
|
||
$('#modal_delete_animal_title').text(animalName);
|
||
$('#modal_delete_animal_validate_delete').attr('action', formUrl);
|
||
$('#modal_delete_animal').modal({
|
||
show: true
|
||
});
|
||
event.preventDefault();
|
||
}
|
||
|
||
} else if (formUrl.match(new RegExp('${animalURL}/[0-9]+/edit', 'g'))) {
|
||
if ($(this).attr('id') !== 'modal_edit_animal_form') {
|
||
// Only for editing animal form
|
||
var animalName = $(this).find('input')[0].value;
|
||
$('#modal_edit_animal_form').attr('action', formUrl);
|
||
$('#modal_edit_animal_form_name').val(animalName);
|
||
$('#modal_edit_animal').modal({
|
||
show: true
|
||
});
|
||
event.preventDefault();
|
||
}
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
</html>
|