added jQueryUI

This commit is contained in:
Mic 2013-01-22 09:29:49 +01:00
parent 95cb32d86d
commit feca50d272
4 changed files with 40 additions and 42 deletions

View file

@ -156,6 +156,12 @@
<version>2.2.1</version> <version>2.2.1</version>
</dependency> </dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>1.9.1</version>
</dependency>
<!-- Rome RSS --> <!-- Rome RSS -->
<dependency> <dependency>
<groupId>rome</groupId> <groupId>rome</groupId>

View file

@ -14,6 +14,15 @@
<spring:url value="/resources/css/petclinic.css" var="petclinicCss" /> <spring:url value="/resources/css/petclinic.css" var="petclinicCss" />
<link href="${petclinicCss}" rel="stylesheet"/> <link href="${petclinicCss}" rel="stylesheet"/>
<spring:url value="/webjars/jquery/1.8.2/jquery.js" var="jQuery" />
<script src="${jQuery}"></script>
<spring:url value="/webjars/jquery-ui/1.9.1/js/jquery-ui-1.9.1.custom.js" var="jQueryUi" />
<script src="${jQueryUi}"></script>
<spring:url value="/webjars/jquery-ui/1.9.1/css/smoothness/jquery-ui-1.9.1.custom.css" var="jQueryUiCss" />
<link href="${jQueryUiCss}" rel="stylesheet"></link>
</head> </head>

View file

@ -5,55 +5,38 @@
<html lang="en"> <html lang="en">
<jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<head>
<spring:url value="/webjars/jquery/1.8.2/jquery.js" var="jQuery" />
<script src="${jQuery}"></script>
<spring:url value="/webjars/jquery-ui/1.9.1/js/jquery-ui-1.9.1.custom.js" var="jQueryUi" />
<script src="${jQueryUi}"></script>
<spring:url value="/webjars/jquery-ui/1.9.1/css/smoothness/jquery-ui-1.9.1.custom.css" var="jQueryUiCss" />
<link href="${jQueryUiCss}" rel="stylesheet"></link>
</head>
<div class="container"> <div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<c:choose>
<c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when>
<c:otherwise><c:set var="method" value="put"/></c:otherwise>
</c:choose>
<h2><c:if test="${pet['new']}">New </c:if>Pet</h2> <script>
$(function() {
<b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName} $( "#birthDate" ).datepicker();
<br/> });
<form:form modelAttribute="pet" method="${method}" class="form-horizontal"> </script>
<form:form modelAttribute="pet" class="form-horizontal">
<fieldset> <fieldset>
<div class="control-group" id="name">
<label class="control-label">Name </label>
<div class="controls">
<form:input path="name" />
<span class="help-inline"><form:errors path="name" /></span>
</div>
</div>
<div class="control-group" id="birthDate"> <div class="control-group" id="birthDate">
<label class="control-label">Birth Date (yyyy-MM-dd)</label> <label class="control-label">Birth Date</label>
<div class="controls"> <div class="controls">
<form:input path="birthDate" /> <form:input path="birthDate" />
<span class="help-inline"><form:errors path="birthDate" /></span>
</div> </div>
</div> </div>
<div class="control-group" id="type">
<label class="control-label">Type </label>
<form:select path="type" items="${types}"/>
</div>
<div class="form-actions">
<c:choose>
<c:when test="${owner['new']}">
<button type="submit">Add Pet</button>
</c:when>
<c:otherwise>
<button type="submit">Update Pet</button>
</c:otherwise>
</c:choose>
</div>
</fieldset> </fieldset>
</form:form> </form:form>
<c:if test="${!pet['new']}">
</c:if>
<jsp:include page="../fragments/footer.jsp"/>
</div> </div>
</body> </body>