Skip to content
Snippets Groups Projects
Commit feca50d2 authored by Mic's avatar Mic
Browse files

added jQueryUI

parent 95cb32d8
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,12 @@ ...@@ -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>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<!-- ========================= RESOURCE DEFINITIONS ========================= --> <!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- import the dataSource definition --> <!-- import the dataSource definition -->
<import resource="applicationContext-dataSource.xml"/> <import resource="applicationContext-dataSource.xml"/>
<!-- Configurer that replaces ${...} placeholders with values from a properties file --> <!-- Configurer that replaces ${...} placeholders with values from a properties file -->
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
PersistenceExceptions will be auto-translated due to @Repository. PersistenceExceptions will be auto-translated due to @Repository.
--> -->
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/> <context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/>
</beans> </beans>
<beans profile="spring-data-jpa"> <beans profile="spring-data-jpa">
......
...@@ -14,6 +14,15 @@ ...@@ -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>
...@@ -5,55 +5,38 @@ ...@@ -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> <script>
<c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when> $(function() {
<c:otherwise><c:set var="method" value="put"/></c:otherwise> $( "#birthDate" ).datepicker();
</c:choose> });
</script>
<h2><c:if test="${pet['new']}">New </c:if>Pet</h2> <form:form modelAttribute="pet" class="form-horizontal">
<fieldset>
<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>
<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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment