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>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>1.9.1</version>
</dependency>
<!-- Rome RSS -->
<dependency>
<groupId>rome</groupId>

View file

@ -15,7 +15,7 @@
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- import the dataSource definition -->
<import resource="applicationContext-dataSource.xml"/>
<import resource="applicationContext-dataSource.xml"/>
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
@ -116,7 +116,7 @@
PersistenceExceptions will be auto-translated due to @Repository.
-->
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/>
</beans>
<beans profile="spring-data-jpa">

View file

@ -14,6 +14,15 @@
<spring:url value="/resources/css/petclinic.css" var="petclinicCss" />
<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>

View file

@ -5,55 +5,38 @@
<html lang="en">
<jsp:include page="../fragments/headTag.jsp"/>
<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">
<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>
<b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName}
<br/>
<form:form modelAttribute="pet" method="${method}" class="form-horizontal">
<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>
<script>
$(function() {
$( "#birthDate" ).datepicker();
});
</script>
<form:form modelAttribute="pet" class="form-horizontal">
<fieldset>
<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">
<form:input path="birthDate" />
<span class="help-inline"><form:errors path="birthDate" /></span>
<form:input path="birthDate" />
</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>
</form:form>
<c:if test="${!pet['new']}">
</c:if>
<jsp:include page="../fragments/footer.jsp"/>
</div>
</body>