Compare commits
2 Commits
21272c53b2
...
572a7b2282
| Author | SHA1 | Date |
|---|---|---|
|
|
572a7b2282 | |
|
|
de6a42d69a |
|
|
@ -22,6 +22,7 @@ public class AnimalController {
|
|||
public static final String MODEL_MAP_ANIMAL = "MODEL_MAP_ANIMAL";
|
||||
public static final String MODEL_MAP_ANIMAL_CARE_ID = "MODEL_MAP_ANIMAL_CARE_ID";
|
||||
public static final String MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID = "MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID";
|
||||
public static final String MODEL_MAP_PROGRESSION = "MODEL_MAP_PROGRESSION";
|
||||
|
||||
@Autowired
|
||||
IServiceAnimal serviceAnimal;
|
||||
|
|
@ -269,4 +270,33 @@ public class AnimalController {
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@RequestMapping(value = IndexController.URL_ANIMAL_PROGRESSION_BY_ME, method = RequestMethod.GET)
|
||||
public String doGetAnimalProgressionByMe(final ModelMap pModel, HttpSession httpSession,
|
||||
@PathVariable(value = "animal_id") final int animalId,
|
||||
@PathVariable(value = "progression_value") final String progressionByMeValue) {
|
||||
String ret;
|
||||
|
||||
if (LoginController.isUserAlreadyAuth(httpSession)) {
|
||||
Authentication authentication = (Authentication) httpSession.getAttribute(IndexController.SESSION_ATTRIBUTE_AUTHENTICATION);
|
||||
Object oUserDetails = authentication.getPrincipal();
|
||||
if (oUserDetails instanceof UserDetails) {
|
||||
UserDetails userDetails = (UserDetails) oUserDetails;
|
||||
|
||||
Animal animal = serviceAnimal.getAnimalProgressionByMe(userDetails.getUsername(), animalId, progressionByMeValue);
|
||||
pModel.addAttribute(MODEL_MAP_ANIMAL, animal);
|
||||
|
||||
List<Animal> animals = serviceAnimal.getAnimals(userDetails.getUsername());
|
||||
pModel.addAttribute(MODEL_MAP_ANIMAL_LIST, animals);
|
||||
|
||||
pModel.addAttribute(MODEL_MAP_PROGRESSION, progressionByMeValue);
|
||||
}
|
||||
|
||||
ret = IndexController.PAGE_ANIMAL_PROGRESSION;
|
||||
} else {
|
||||
ret = IndexController.URL_REDIRECT + IndexController.URL_LOGIN;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ public class IndexController {
|
|||
public static final String URL_ANIMAL_CARES_AND_BEHAVIORS_LIST = "/animal/{animal_id}/cares_and_behaviors";
|
||||
public static final String URL_ANIMAL_CARE = "/animal/{animal_id}/care/{care_id}";
|
||||
public static final String URL_ANIMAL_BEHAVIOR = "/animal/{animal_id}/consent_behavior/{consent_behavior_id}";
|
||||
public static final String URL_ANIMAL_PROGRESSION_BY_ME = "/animal/{animal_id}/progression_by_me/{progression_value}";
|
||||
public static final String URL_ANIMAL_PROGRESSIONS_LIST = "/animal/{animal_id}/progressions";
|
||||
|
||||
// Add URL
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ public interface IProgressionDao extends CommonDao {
|
|||
public void deleteAllAnimalConsentBehaviorProgression(int animalId, String owner, int consentBehaviorId);
|
||||
|
||||
public void fillAnimalProgressionByCare(Animal animal, int careId);
|
||||
|
||||
public void fillAnimalProgressionByConsentBehavior(Animal animal, int consentBehaviorId);
|
||||
public void fillAnimalProgressionByMe(Animal animal, String progressionByMe);
|
||||
public void fillAnimalProgressionBySomeoneElse(Animal animal, String progressionBySomeoneElse);
|
||||
public void fillAnimalProgressionByVeterinary(Animal animal, String progressionByVeterinary);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,6 +254,98 @@ public class ProgressionDao extends PostgresSqlDao implements IProgressionDao {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillAnimalProgressionByMe(Animal animal, String progressionByMe) {
|
||||
Connection conn = null;
|
||||
PreparedStatement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
conn = mDataSource.getConnection();
|
||||
statement = conn.prepareStatement("select "
|
||||
+ AnimalDao.TABLE_NAME+".id as animal_id, "+AnimalDao.TABLE_NAME+".name as animal_name, "+AnimalDao.TABLE_NAME+".owner as animal_owner, "
|
||||
+ TABLE_NAME+".id as progression_id, "+TABLE_NAME+".progression_by_me as prog_by_me, "+TABLE_NAME+".progression_by_someone_else as prog_by_someone_else, "+TABLE_NAME+".progression_by_veterinary as prog_by_vet, "
|
||||
+ TABLE_NAME+".care as care_id, "+TABLE_NAME+".consent_behavior as consent_behavior_id, "
|
||||
+ CareDao.TABLE_NAME+".name as care_name, "+CareDao.TABLE_NAME+".description as care_desc, "
|
||||
+ ConsentBehaviorDao.TABLE_NAME+".name as consent_behavior_name, "+ConsentBehaviorDao.TABLE_NAME+".description as consent_behavior_desc "
|
||||
+ "from "+TABLE_NAME+" "
|
||||
+ "left join "+AnimalDao.TABLE_NAME+" on "+TABLE_NAME+".animal = "+AnimalDao.TABLE_NAME+".id "
|
||||
+ "left join "+CareDao.TABLE_NAME+" on "+TABLE_NAME+".care = "+CareDao.TABLE_NAME+".id "
|
||||
+ "left join "+ConsentBehaviorDao.TABLE_NAME+" on "+TABLE_NAME+".consent_behavior = "+ConsentBehaviorDao.TABLE_NAME+".id "
|
||||
+ "where "+AnimalDao.TABLE_NAME+".owner = ? and "+AnimalDao.TABLE_NAME+".id = ? and "+TABLE_NAME+".progression_by_me = ?;");
|
||||
statement.setString(1, animal.getOwner());
|
||||
statement.setInt(2, animal.getId());
|
||||
statement.setString(3, progressionByMe);
|
||||
System.out.println(IndexController.LOG_TAG + " SQL -> " + statement.toString());
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
if (resultSet != null) {
|
||||
while (resultSet.next()) {
|
||||
Progression progression = new Progression();
|
||||
progression.setId(resultSet.getInt("progression_id"));
|
||||
progression.setProgressionByMe(resultSet.getString("prog_by_me"));
|
||||
progression.setProgressionBySomeoneElse(resultSet.getString("prog_by_someone_else"));
|
||||
progression.setProgressionByVeterinary(resultSet.getString("prog_by_vet"));
|
||||
|
||||
int careId = resultSet.getInt("care_id");
|
||||
if (!animal.containsCareKey(careId)) {
|
||||
Care care = new Care();
|
||||
care.setId(careId);
|
||||
care.setName(resultSet.getString("care_name"));
|
||||
care.setDescription(resultSet.getString("care_desc"));
|
||||
animal.addCare(care);
|
||||
}
|
||||
progression.setCare(animal.getCareById(careId));
|
||||
|
||||
int consentBehaviorId = resultSet.getInt("consent_behavior_id");
|
||||
if (!animal.containsConsentBehaviorKey(consentBehaviorId)) {
|
||||
ConsentBehavior consentBehavior = new ConsentBehavior();
|
||||
consentBehavior.setId(consentBehaviorId);
|
||||
consentBehavior.setName(resultSet.getString("consent_behavior_name"));
|
||||
consentBehavior.setDescription(resultSet.getString("consent_behavior_desc"));
|
||||
animal.addConsentBehavior(consentBehavior);
|
||||
}
|
||||
progression.setConsentBehavior(animal.getConsentBehaviorById(consentBehaviorId));
|
||||
|
||||
animal.addProgression(progression);
|
||||
}
|
||||
resultSet.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(IndexController.LOG_TAG + " SQLException -> fillAnimalProgressionByMe() - " + ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
} finally {
|
||||
if (resultSet != null) {
|
||||
try {
|
||||
resultSet.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(IndexController.LOG_TAG + " Failed close ResultSet -> fillAnimalProgressionByMe()");
|
||||
}
|
||||
}
|
||||
if (statement != null) {
|
||||
try {
|
||||
statement.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(IndexController.LOG_TAG + " Failed close statement -> fillAnimalProgressionByMe()");
|
||||
}
|
||||
}
|
||||
if (conn != null) {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(IndexController.LOG_TAG + " Failed close connection -> fillAnimalProgressionByMe()");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillAnimalProgressionBySomeoneElse(Animal animal, String progressionBySomeoneElse) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillAnimalProgressionByVeterinary(Animal animal, String progressionByVeterinary) {
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="Delete methods">
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ package fr.geoffrey.medical_training_tracker.dao.bean;
|
|||
*/
|
||||
public class Progression {
|
||||
|
||||
private static final String PROGRESSION_VALUE_NOT_TRAINED = "NOT_TRAINED";
|
||||
private static final String PROGRESSION_VALUE_CURRENTLY_TRAINING = "CURRENTLY_TRAINING";
|
||||
private static final String PROGRESSION_VALUE_TRAINED = "TRAINED";
|
||||
public static final String PROGRESSION_VALUE_NOT_TRAINED = "NOT_TRAINED";
|
||||
public static final String PROGRESSION_VALUE_CURRENTLY_TRAINING = "CURRENTLY_TRAINING";
|
||||
public static final String PROGRESSION_VALUE_TRAINED = "TRAINED";
|
||||
|
||||
private int id;
|
||||
private ConsentBehavior consentBehavior;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ public interface IServiceAnimal {
|
|||
public Animal getAnimalProgression(String owner, int animalId);
|
||||
public Animal getAnimalCareProgression(String owner, int animalId, int careId);
|
||||
public Animal getAnimalConsentBehaviorProgression(String owner, int animalId, int consentBehaviorId);
|
||||
public Animal getAnimalProgressionByMe(String username, int animalId, String progressionValue);
|
||||
|
||||
public void addAnimal(String name, String owner);
|
||||
public void addCare(int animalId, String name, String description);
|
||||
|
|
@ -19,4 +20,5 @@ public interface IServiceAnimal {
|
|||
public void deleteAnimalCare(int animalId, String owner, int careId);
|
||||
public void deleteAnimalConsentBehavior(int animalId, String owner, int consentBehaviorId);
|
||||
public void deleteAnimalProgression(int animalId, String owner, int progressionId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,4 +106,13 @@ public class ServiceAnimal implements IServiceAnimal {
|
|||
}
|
||||
return animal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Animal getAnimalProgressionByMe(String username, int animalId, String progressionValue) {
|
||||
Animal animal = animalDao.getAnimal(username, animalId);
|
||||
if (animal != null) {
|
||||
progressionDao.fillAnimalProgressionByMe(animal, progressionValue);
|
||||
}
|
||||
return animal;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
navbar.language = Language
|
||||
navbar.signin = Sign in
|
||||
navbar.signup = Sign up
|
||||
navbar.logout = Logout
|
||||
navbar.my_animals = My animals
|
||||
navbar.cares_and_behaviors = Care and Behaviors
|
||||
|
||||
footer.license = Application under {0} license
|
||||
footer.source_code = Source code
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
navbar.language = Language
|
||||
navbar.signin = Sign in
|
||||
navbar.signup = Sign up
|
||||
navbar.logout = Logout
|
||||
navbar.my_animals = My animals
|
||||
navbar.cares_and_behaviors = Care and Behaviors
|
||||
|
||||
footer.source_code=Source code
|
||||
footer.license=Application under {0} license
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
navbar.language = Langue
|
||||
navbar.signin = Connexion
|
||||
navbar.signup = Cr\u00e9er un compte
|
||||
navbar.logout = D\u00e9connexion
|
||||
navbar.my_animals = Mes animaux
|
||||
navbar.cares_and_behaviors = Soins et Comportements
|
||||
|
||||
footer.source_code=Code source
|
||||
footer.license=Application sous licence {0}
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
<%@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"%>
|
||||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ page isELIgnored="false" %>
|
||||
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
<%@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"%>
|
||||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ page isELIgnored="false" %>
|
||||
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -50,7 +51,11 @@
|
|||
<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>
|
||||
">${progression.getProgressionByMe()}</td>
|
||||
">
|
||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
||||
${progression.getProgressionByMe()}
|
||||
</a>
|
||||
</td>
|
||||
<td class="
|
||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/add/consent_behavior" var="animalAddConsentBehaviorURL" />
|
||||
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/delete/consent_behavior" var="animalDeleteConsentBehaviorURL" />
|
||||
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
<%@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"%>
|
||||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ page isELIgnored="false" %>
|
||||
<spring:url value="/animal/delete" var="animalDeleteURL" />
|
||||
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="base/header.jsp" %>
|
||||
|
|
@ -35,13 +36,18 @@
|
|||
<h4>List de vos animaux</h4>
|
||||
<div class="list-group">
|
||||
<c:forEach items="${MODEL_MAP_ANIMAL_LIST}" var="animal">
|
||||
<div class="list-group-item">
|
||||
<a class="list-group-item" href="${animalURL}/${animal.getId()}/cares_and_behaviors">
|
||||
${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>
|
||||
<!--<a class="btn btn-sm btn-danger pull-right" href="${animalDeleteURL}/${animal.getId()}" data-toggle="tooltip" data-placement="bottom" title="Suppression"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>-->
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
<%@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" %>
|
||||
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
|
||||
<html>
|
||||
<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>Feuille de ${MODEL_MAP_ANIMAL.getName()}</h1></center>
|
||||
<h4>Progression par moi ${MODEL_MAP_PROGRESSION}</h4>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Soin</th>
|
||||
<th>Comportement de consentement</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><a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/consent_behavior/${progression.getConsentBehavior().getId()}">${progression.getConsentBehavior().getName()}</a></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="base/footer.jsp" %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -18,6 +18,9 @@
|
|||
<!--<footer style="text-align: center;">-->
|
||||
<footer style="text-align: center;">
|
||||
<p style="font-size: 0.8em;"><img src="${logoPNG}" alt="Logo Koario" style="max-height: 20px;" /> Medical Training Tracker</p>
|
||||
<p style="font-size: 0.8em;">Application sous licence <a href="https://git.kingpenguin.tk/chteufleur/MedicalTrainingTracker/src/branch/master/LICENSE">MIT</a></p>
|
||||
<p><a href="https://git.kingpenguin.tk/chteufleur/MedicalTrainingTracker" style="font-size: 0.8em;">Code source</a></p>
|
||||
<p style="font-size: 0.8em;">
|
||||
<fmt:message key="footer.license">
|
||||
<fmt:param value="<a href=\"https://git.kingpenguin.tk/chteufleur/MedicalTrainingTracker/src/branch/master/LICENSE\">MIT</a>" />
|
||||
</fmt:message>
|
||||
<p><a href="https://git.kingpenguin.tk/chteufleur/MedicalTrainingTracker" style="font-size: 0.8em;"><fmt:message key="footer.source_code"></fmt:message></a></p>
|
||||
</footer>
|
||||
|
|
@ -2,9 +2,6 @@
|
|||
<spring:url value="/static/bootstrap/css/starter-template.css" var="bootstrapStarterTemplateCSS" />
|
||||
<spring:url value="/static/img/favicon.png" var="favicon" />
|
||||
|
||||
|
||||
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
|
||||
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
|
||||
<fmt:setLocale value="${language}" />
|
||||
<fmt:setBundle basename="messages" />
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@page import="org.springframework.security.core.Authentication"%>
|
||||
<%@page import="fr.geoffrey.medical_training_tracker.controller.IndexController"%>
|
||||
<%@ page isELIgnored="false" %>
|
||||
|
||||
<spring:url value="/static/img/logo.png" var="logoPNG" />
|
||||
<spring:url value="/" var="indexURL" />
|
||||
<spring:url value="/animal" var="animalURL" />
|
||||
|
|
@ -24,34 +26,35 @@
|
|||
<a class="navbar-brand" href="${indexURL}"><div><img src="${logoPNG}" alt="Logo" style="max-height: 30px;"/> Medical Training Tracker</div></a>
|
||||
</div>
|
||||
<div id="navbar" class="collapse navbar-collapse">
|
||||
<!-- <ul class="nav navbar-nav">
|
||||
<% if (authentication != null) { %>
|
||||
<c:forEach items="${MODEL_MAP_ANIMAL_LIST}" var="animal">
|
||||
<li <c:if test="${MODEL_MAP_ANIMAL.getId() == animal.getId()}">class="active"</c:if> ><a href="${animalURL}/${animal.getId()}">${animal.getName()}</a></li>
|
||||
</c:forEach>
|
||||
<% }%>
|
||||
</ul>-->
|
||||
<ul class="nav navbar-nav">
|
||||
<% if (authentication != null) { %>
|
||||
<c:forEach items="${MODEL_MAP_ANIMAL_LIST}" var="animal">
|
||||
<li class="dropdown" <c:if test="${MODEL_MAP_ANIMAL.getId() == animal.getId()}">class="active"</c:if> >
|
||||
<li><a href="${animalURL}/${animal.getId()}/cares_and_behaviors">${animal.getName()}</a></li>
|
||||
<!-- <li class="dropdown <c:if test="${MODEL_MAP_ANIMAL.getId() == animal.getId()}">active</c:if>" >
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">${animal.getName()} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="${animalURL}/${animal.getId()}/cares_and_behaviors">Soins et Comportements</a></li>
|
||||
<li><a href="${animalURL}/${animal.getId()}/cares_and_behaviors"><fmt:message key="navbar.cares_and_behaviors"></fmt:message></a></li>
|
||||
<li><a href="${animalURL}/${animal.getId()}/progressions">Progressions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</li>-->
|
||||
</c:forEach>
|
||||
<% }%>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<% if (authentication == null) { %>
|
||||
<li><a href="${loginURL}">Login</a></li>
|
||||
<li><a href="${registerURL}">Crée un compte</a></li>
|
||||
<li><a href="${loginURL}"><fmt:message key="navbar.signin"></fmt:message></a></li>
|
||||
<li><a href="${registerURL}"><fmt:message key="navbar.signup"></fmt:message></a></li>
|
||||
<% } else { %>
|
||||
<li><a href="${animalURL}">Mes animaux</a></li>
|
||||
<li><a href="${deconnexionURL}">Déconnexion</a></li>
|
||||
<li><a href="${animalURL}"><fmt:message key="navbar.my_animals"></fmt:message></a></li>
|
||||
<li><a href="${deconnexionURL}"><fmt:message key="navbar.logout"></fmt:message></a></li>
|
||||
<% }%>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><fmt:message key="navbar.language"></fmt:message> (${language})<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="?language=en">English</a></li>
|
||||
<li><a href="?language=fr">Français</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
<%@ 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" %>
|
||||
|
||||
<html>
|
||||
<%@ include file="base/language.jsp" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="${language}">
|
||||
<head>
|
||||
<%@ include file="base/header.jsp" %>
|
||||
<style type="text/css">
|
||||
|
|
|
|||
Loading…
Reference in New Issue