Skip to content
Snippets Groups Projects
Commit 7dcf82af authored by Antoine Rey's avatar Antoine Rey
Browse files

Fix #78 Migrate to Bootstrap 3.x

parent 482eeb1c
No related branches found
No related tags found
No related merge requests found
Showing
with 303 additions and 196 deletions
language: java
jdk: oraclejdk8
script: mvn package
\ No newline at end of file
{
"name": "spring-petclinic",
"authors": [
"ihabritane.faycal@gmail.com"
],
"dependencies": {
"bootstrap": "~2.3.0",
"jquery": "~2.0.3",
"bootstrap": "3.3.6",
"jquery": "~2.0.3",
"jquery-ui": "~1.10.3"
}
}
......@@ -402,11 +402,12 @@
<profiles>
<profile>
<id>bower-install</id>
<build>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
......
......@@ -25,7 +25,7 @@
<mvc:annotation-driven conversion-service="conversionService"/>
<!-- all resources inside folder src/main/webapp/resources are mapped so they can be refered to inside JSP files
(see staticFiles.jsp for more details) -->
(see htmlHeader.jsp for more details) -->
<mvc:resources mapping="/resources/**" location="/resources/"/>
<mvc:resources mapping="/vendors/**" location="/vendors/"/>
......
......@@ -3,13 +3,15 @@
<%@ page session="false" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="fragments/staticFiles.jsp"/>
<jsp:include page="fragments/htmlHeader.jsp"/>
<body>
<<petclinic:bodyHeader menuName="error"/>
<div class="container">
<jsp:include page="fragments/bodyHeader.jsp"/>
<spring:url value="/resources/images/pets.png" var="petsImage"/>
<img src="${petsImage}"/>
......@@ -22,11 +24,8 @@
${stackTrace}
</c:forEach>
-->
<jsp:include page="fragments/footer.jsp"/>
</div>
<jsp:include page="fragments/footer.jsp"/>
</body>
</html>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img src="${banner}"/>
<div class="navbar" style="width: 601px;">
<div class="navbar-inner">
<ul class="nav">
<li style="width: 120px;"><a href="<spring:url value="/" htmlEscape="true" />"><i class="icon-home"></i>
Home</a></li>
<li style="width: 150px;"><a href="<spring:url value="/owners/find.html" htmlEscape="true" />"><i
class="icon-search"></i> Find owners</a></li>
<li style="width: 160px;"><a href="<spring:url value="/vets.html" htmlEscape="true" />"><i
class="icon-th-list"></i> Veterinarians</a></li>
<li style="width: 110px;"><a href="<spring:url value="/oups.html" htmlEscape="true" />"
title="trigger a RuntimeException to see how it is handled"><i
class="icon-warning-sign"></i> Error</a></li>
</ul>
</div>
</div>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<table class="footer">
<tr>
<td width="70%"></td>
<td align="right"><img src="<spring:url value="/resources/images/spring-pivotal-logo.png" htmlEscape="true" />"
alt="Sponsored by Pivotal"/></td>
</tr>
</table>
<div class="container">
<div class="row">
<div class="col-12 text-center"><img src="<spring:url value="/resources/images/spring-pivotal-logo.png" htmlEscape="true" />"
alt="Sponsored by Pivotal"/></div>
</div>
</div>
<%-- Placed at the end of the document so the pages load faster --%>
<spring:url value="/vendors/jquery/jquery.min.js" var="jQuery"/>
<script src="${jQuery}"></script>
<%-- jquery-ui.js file is really big so we only load what we need instead of loading everything --%>
<spring:url value="/vendors/jquery-ui/ui/jquery.ui.core.js" var="jQueryUiCore"/>
<script src="${jQueryUiCore}"></script>
<spring:url value="/vendors/jquery-ui/ui/jquery.ui.datepicker.js" var="jQueryUiDatePicker"/>
<script src="${jQueryUiDatePicker}"></script>
<%-- Bootstrap --%>
<spring:url value="/vendors/bootstrap/dist/js/bootstrap.min.js" var="bootstrapJs"/>
<script src="${bootstrapJs}"></script>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%--
PetClinic :: a Spring Framework demonstration
--%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --%>
<spring:url value="/resources/images/favicon.png" var="favicon"/>
<link rel="shortcut icon" type="image/x-icon" href="${favicon}">
<title>PetClinic :: a Spring Framework demonstration</title>
<%-- Bootstrap CSS --%>
<spring:url value="/vendors/bootstrap/dist/css/bootstrap.min.css" var="bootstrapCss"/>
<link href="${bootstrapCss}" rel="stylesheet">
<spring:url value="/vendors/bootstrap/dist/css/bootstrap-theme.min.css" var="bootstrapThemeCss"/>
<link href="${bootstrapThemeCss}" rel="stylesheet">
<%-- Custom styles for Petclinic --%>
<spring:url value="/resources/css/petclinic.css" var="petclinicCss"/>
<link href="${petclinicCss}" rel="stylesheet"/>
<%-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --%>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Only datepicker is used -->
<spring:url value="/vendors/jquery-ui/themes/base/minified/jquery-ui.min.css" var="jQueryUiCss"/>
<link href="${jQueryUiCss}" rel="stylesheet"/>
<spring:url value="/vendors/jquery-ui/themes/base/minified/jquery.ui.theme.min.css" var="jQueryUiThemeCss"/>
<link href="${jQueryUiThemeCss}" rel="stylesheet"/>
<spring:url value="/vendors/jquery-ui/themes/base/minified/jquery.ui.datepicker.min.css" var="jQueryUiDatePickerCss"/>
<link href="${jQueryUiDatePickerCss}" rel="stylesheet"/>
</head>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!--
PetClinic :: a Spring Framework demonstration
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>PetClinic :: a Spring Framework demonstration</title>
<spring:url value="/vendors/bootstrap/docs/assets/css/bootstrap.css" var="bootstrapCss"/>
<link href="${bootstrapCss}" rel="stylesheet"/>
<spring:url value="/resources/css/petclinic.css" var="petclinicCss"/>
<link href="${petclinicCss}" rel="stylesheet"/>
<spring:url value="/vendors/jquery/jquery.js" var="jQuery"/>
<script src="${jQuery}"></script>
<!-- jquery-ui.js file is really big so we only load what we need instead of loading everything -->
<spring:url value="/vendors/jquery-ui/ui/jquery.ui.core.js" var="jQueryUiCore"/>
<script src="${jQueryUiCore}"></script>
<spring:url value="/vendors/jquery-ui/ui/jquery.ui.datepicker.js" var="jQueryUiDatePicker"/>
<script src="${jQueryUiDatePicker}"></script>
<!-- jquery-ui.css file is not that big so we can afford to load it -->
<spring:url value="/vendors/jquery-ui/themes/base/jquery.ui.base.css" var="jQueryUiCss"/>
<link href="${jQueryUiCss}" rel="stylesheet"/>
</head>
......@@ -11,31 +11,33 @@
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="owners"/>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>
<c:if test="${owner['new']}">New </c:if> Owner
</h2>
<form:form modelAttribute="owner" class="form-horizontal" id="add-owner-form">
<petclinic:inputField label="First Name" name="firstName"/>
<petclinic:inputField label="Last Name" name="lastName"/>
<petclinic:inputField label="Address" name="address"/>
<petclinic:inputField label="City" name="city"/>
<petclinic:inputField label="Telephone" name="telephone"/>
<div class="form-actions">
<c:choose>
<c:when test="${owner['new']}">
<button type="submit">Add Owner</button>
</c:when>
<c:otherwise>
<button type="submit">Update Owner</button>
</c:otherwise>
</c:choose>
<div class="form-group has-feedback">
<petclinic:inputField label="First Name" name="firstName"/>
<petclinic:inputField label="Last Name" name="lastName"/>
<petclinic:inputField label="Address" name="address"/>
<petclinic:inputField label="City" name="city"/>
<petclinic:inputField label="Telephone" name="telephone"/>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<c:choose>
<c:when test="${owner['new']}">
<button class="btn btn-primary" type="submit">Add Owner</button>
</c:when>
<c:otherwise>
<button class="btn btn-primary" type="submit">Update Owner</button>
</c:otherwise>
</c:choose>
</div>
</div>
</form:form>
</div>
......
......@@ -5,38 +5,43 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="owners"/>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>Find Owners</h2>
<spring:url value="/owners.html" var="formUrl"/>
<form:form modelAttribute="owner" action="${fn:escapeXml(formUrl)}" method="get" class="form-horizontal"
id="search-owner-form">
<fieldset>
<div class="form-group">
<div class="control-group" id="lastName">
<label class="control-label">Last name </label>
<form:input path="lastName" size="30" maxlength="80"/>
<span class="help-inline"><form:errors path="*"/></span>
<label class="col-sm-2 control-label">Last name </label>
<div class="col-sm-10">
<form:input class="form-control" path="lastName" size="30" maxlength="80"/>
<span class="help-inline"><form:errors path="*"/></span>
</div>
</div>
<div class="form-actions">
<button type="submit">Find Owner</button>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Find Owner</button>
</div>
</fieldset>
</div>
</form:form>
<br/>
<a href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a>
<jsp:include page="../fragments/footer.jsp"/>
<a class="btn btn-default" href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a>
</div>
<jsp:include page="../fragments/footer.jsp"/>
</body>
</html>
......@@ -6,18 +6,20 @@
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="owners"/>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>Owner Information</h2>
<table class="table table-striped" style="width:600px;">
<table class="table table-striped">
<tr>
<th>Name</th>
<td><b><c:out value="${owner.firstName} ${owner.lastName}"/></b></td>
......@@ -34,26 +36,26 @@
<th>Telephone</th>
<td><c:out value="${owner.telephone}"/></td>
</tr>
<tr>
<td>
<spring:url value="{ownerId}/edit.html" var="editUrl">
<spring:param name="ownerId" value="${owner.id}"/>
</spring:url>
<a href="${fn:escapeXml(editUrl)}" class="btn btn-info">Edit Owner</a></td>
<td>
<spring:url value="{ownerId}/pets/new.html" var="addUrl">
<spring:param name="ownerId" value="${owner.id}"/>
</spring:url>
<a href="${fn:escapeXml(addUrl)}" class="btn btn-success">Add New Pet</a></td>
</tr>
</table>
<spring:url value="{ownerId}/edit.html" var="editUrl">
<spring:param name="ownerId" value="${owner.id}"/>
</spring:url>
<a href="${fn:escapeXml(editUrl)}" class="btn btn-default">Edit Owner</a>
<spring:url value="{ownerId}/pets/new.html" var="addUrl">
<spring:param name="ownerId" value="${owner.id}"/>
</spring:url>
<a href="${fn:escapeXml(addUrl)}" class="btn btn-primary">Add New Pet</a>
<h2>Pets and Visits</h2>
<c:forEach var="pet" items="${owner.pets}">
<table class="table" style="width:600px;">
<table class="table table-striped">
<c:forEach var="pet" items="${owner.pets}">
<tr>
<td valign="top" style="width: 120px;">
<td valign="top">
<dl class="dl-horizontal">
<dt>Name</dt>
<dd><c:out value="${pet.name}"/></dd>
......@@ -96,13 +98,14 @@
</table>
</td>
</tr>
</table>
</c:forEach>
<jsp:include page="../fragments/footer.jsp"/>
</c:forEach>
</table>
</div>
<jsp:include page="../fragments/footer.jsp"/>
</body>
</html>
......@@ -6,17 +6,18 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="owners"/>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>Owners</h2>
<datatables:table id="owners" data="${selections}" row="owner" theme="bootstrap2"
<datatables:table id="owners" data="${selections}" row="owner"
cssClass="table table-striped" pageable="false" info="false" export="pdf">
<datatables:column title="Name" cssStyle="width: 150px;" display="html">
<spring:url value="/owners/{ownerId}.html" var="ownerUrl">
......@@ -37,10 +38,9 @@
</datatables:column>
<datatables:export type="pdf" cssClass="btn" cssStyle="height: 25px;"/>
</datatables:table>
<jsp:include page="../fragments/footer.jsp"/>
</div>
<jsp:include page="../fragments/footer.jsp"/>
</body>
</html>
......@@ -9,50 +9,54 @@
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="owners"/>
<script>
$(function () {
$("#birthDate").datepicker({dateFormat: 'yy/mm/dd'});
});
</script>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2>
<c:if test="${pet['new']}">New </c:if>
Pet
<c:if test="${pet['new']}">New </c:if> Pet
</h2>
<form:form modelAttribute="pet"
class="form-horizontal">
<input type="hidden" name="id" value="${pet.id}"/>
<div class="control-group" id="owner">
<label class="control-label">Owner </label>
<c:out value="${pet.owner.firstName} ${pet.owner.lastName}"/>
<div class="form-group has-feedback">
<div class="form-group">
<label class="col-sm-2 control-label">Owner</label>
<div class="col-sm-10">
<c:out value="${pet.owner.firstName} ${pet.owner.lastName}"/>
</div>
</div>
<petclinic:inputField label="Name" name="name"/>
<petclinic:inputField label="Birth Date" name="birthDate"/>
<div class="control-group">
<petclinic:selectField name="type" label="Type " names="${types}" size="5"/>
</div>
</div>
<petclinic:inputField label="Name" name="name"/>
<petclinic:inputField label="Birth Date" name="birthDate"/>
<div class="control-group">
<petclinic:selectField name="type" label="Type " names="${types}" size="5"/>
</div>
<div class="form-actions">
<c:choose>
<c:when test="${pet['new']}">
<button type="submit">Add Pet</button>
</c:when>
<c:otherwise>
<button type="submit">Update Pet</button>
</c:otherwise>
</c:choose>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<c:choose>
<c:when test="${pet['new']}">
<button class="btn btn-primary" type="submit">Add Pet</button>
</c:when>
<c:otherwise>
<button class="btn btn-primary" type="submit">Update Pet</button>
</c:otherwise>
</c:choose>
</div>
</div>
</form:form>
<c:if test="${!pet['new']}">
</c:if>
<jsp:include page="../fragments/footer.jsp"/>
</div>
<jsp:include page="../fragments/footer.jsp"/>
<script>
$(function () {
$("#birthDate").datepicker({dateFormat: 'yy/mm/dd'});
});
</script>
</body>
</html>
......@@ -11,17 +11,12 @@
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<script>
$(function () {
$("#date").datepicker({dateFormat: 'yy/mm/dd'});
});
</script>
<petclinic:bodyHeader menuName="owners"/>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<h2><c:if test="${visit['new']}">New </c:if>Visit</h2>
<b>Pet</b>
......@@ -42,20 +37,23 @@
</tr>
</table>
<form:form modelAttribute="visit">
<petclinic:inputField label="date" name="date"/>
<petclinic:inputField label="description" name="description"/>
<form:form modelAttribute="visit" class="form-horizontal">
<div class="form-group has-feedback">
<petclinic:inputField label="Date" name="date"/>
<petclinic:inputField label="Description" name="description"/>
</div>
<div class="form-actions">
<input type="hidden" name="petId" value="${visit.pet.id}"/>
<button type="submit">Add Visit</button>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="petId" value="${visit.pet.id}"/>
<button class="btn btn-primary" type="submit">Add Visit</button>
</div>
</div>
</form:form>
<br/>
<b>Previous Visits</b>
<table style="width: 333px;">
<table class="table table-striped">
<tr>
<th>Date</th>
<th>Description</th>
......@@ -72,6 +70,11 @@
</div>
<jsp:include page="../fragments/footer.jsp"/>
<script>
$(function () {
$("#date").datepicker({dateFormat: 'yy/mm/dd'});
});
</script>
</body>
</html>
......@@ -5,22 +5,22 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="../fragments/staticFiles.jsp"/>
<jsp:include page="../fragments/htmlHeader.jsp"/>
<body>
<div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<petclinic:bodyHeader menuName="vets"/>
<h2>Veterinarians</h2>
<datatables:table id="vets" data="${vets.vetList}" row="vet" theme="bootstrap2" cssClass="table table-striped"
<datatables:table id="vets" data="${vets.vetList}" row="vet" cssClass="table table-striped"
pageable="false" info="false">
<datatables:column title="Name">
<c:out value="${vet.firstName} ${vet.lastName}"></c:out>
<c:out value="${vet.firstName} ${vet.lastName}"/>
</datatables:column>
<datatables:column title="Specialties">
<c:forEach var="specialty" items="${vet.specialties}">
......
......@@ -3,22 +3,26 @@
<%@ page session="false" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<html lang="en">
<jsp:include page="fragments/staticFiles.jsp"/>
<jsp:include page="fragments/htmlHeader.jsp"/>
<body>
<petclinic:bodyHeader menuName="home"/>
<div class="container">
<jsp:include page="fragments/bodyHeader.jsp"/>
<h2><fmt:message key="welcome"/></h2>
<spring:url value="/resources/images/pets.png" htmlEscape="true" var="petsImage"/>
<img src="${petsImage}"/>
<jsp:include page="fragments/footer.jsp"/>
<div class="row">
<div class="col-md-12">
<spring:url value="/resources/images/pets.png" htmlEscape="true" var="petsImage"/>
<img class="img-responsive" src="${petsImage}"/>
</div>
</div>
</div>
<jsp:include page="fragments/footer.jsp"/>
</body>
</html>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
<%@ attribute name="menuName" required="true" rtexprvalue="true"
description="Name of the active menu: home, owners, vets or error" %>
<div class="container">
<div class="row">
<div class="col-md-12">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img class="img-responsive" src="${banner}"/>
</div>
</div>
</div>
<div class="container">
<petclinic:menu name="${menuName}"/>
</div>
......@@ -7,13 +7,20 @@
description="Label appears in red color if input is considered as invalid after submission" %>
<spring:bind path="${name}">
<c:set var="cssGroup" value="control-group ${status.error ? 'error' : '' }"/>
<c:set var="cssGroup" value="form-group ${status.error ? 'has-error' : '' }"/>
<c:set var="valid" value="${not status.error and not empty status.actualValue}"/>
<div class="${cssGroup}">
<label class="control-label">${label}</label>
<label class="col-sm-2 control-label">${label}</label>
<div class="controls">
<form:input path="${name}"/>
<span class="help-inline">${status.errorMessage}</span>
<div class="col-sm-10">
<form:input class="form-control" path="${name}"/>
<c:if test="${valid}">
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</c:if>
<c:if test="${status.error}">
<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
<span class="help-inline">${status.errorMessage}</span>
</c:if>
</div>
</div>
</spring:bind>
\ No newline at end of file
</spring:bind>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core_1_1" %>
<%@ attribute name="name" required="true" rtexprvalue="true"
description="Name of the active menu: home, owners, vets or error" %>
<%-- Static navbar --%>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><os-p>Toggle navigation</os-p></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<c:choose>
<c:when test="${name eq 'home'}">
<c:set var="cssMenu" value="active"/>
</c:when>
<c:otherwise>
<c:set var="cssMenu" value=""/>
</c:otherwise>
</c:choose>
<li class="${cssMenu}"><a href="<spring:url value="/" htmlEscape="true" />"><span class="glyphicon glyphicon-home" aria-hidden="true"></span><span> Home</span></a></li>
<c:choose>
<c:when test="${name eq 'owners'}">
<c:set var="cssMenu" value="active"/>
</c:when>
<c:otherwise>
<c:set var="cssMenu" value=""/>
</c:otherwise>
</c:choose>
<li class="${cssMenu}"><a href="<spring:url value="/owners/find.html" htmlEscape="true" />"><span class="glyphicon glyphicon-search" aria-hidden="true"></span><span> Find owners</span></a></li>
<c:choose>
<c:when test="${name eq 'vets'}">
<c:set var="cssMenu" value="active"/>
</c:when>
<c:otherwise>
<c:set var="cssMenu" value=""/>
</c:otherwise>
</c:choose>
<li class="${cssMenu}"><a href="<spring:url value="/vets.html" htmlEscape="true" />"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span><span> Veterinarians</span></a></li>
<c:choose>
<c:when test="${name eq 'error'}">
<c:set var="cssMenu" value="active"/>
</c:when>
<c:otherwise>
<c:set var="cssMenu" value=""/>
</c:otherwise>
</c:choose>
<li class="${cssMenu}"><a href="<spring:url value="/oups.html" htmlEscape="true" />"
title="trigger a RuntimeException to see how it is handled"><span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span><span> Error</span></a></li>
</ul>
</div> <%--/.nav-collapse --%>
</div> <%--/.container-fluid --%>
</nav>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment