navbar, reorganized JSP folders

This commit is contained in:
Mic 2013-01-18 18:32:23 +08:00
parent f06cf8c3fa
commit c4b5a98ac8
15 changed files with 65 additions and 79 deletions

View file

@ -44,7 +44,7 @@ public class VetController {
Vets vets = new Vets(); Vets vets = new Vets();
vets.getVetList().addAll(this.clinicService.findVets()); vets.getVetList().addAll(this.clinicService.findVets());
model.addAttribute("vets", vets); model.addAttribute("vets", vets);
return "vetsList"; return "vets/vetsList";
} }

View file

@ -1,19 +1,18 @@
<html lang="en"> <html lang="en">
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<jsp:include page="header.jsp"/> <jsp:include page="fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/> <jsp:include page="fragments/bodyHeader.jsp"/>
<img src="${banner}" />
<spring:url value="/resources/images/pets.png" var="petsImage"/> <spring:url value="/resources/images/pets.png" var="petsImage"/>
<img src="${petsImage}" /> <img src="${petsImage}" />
<h2>Something happened...</h2> <h2>Something happened...</h2>
<p>${exception.message}</p> <p>${exception.message}</p>
<jsp:include page="footer.jsp"/> <jsp:include page="fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -0,0 +1,16 @@
<%@ 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><a href="<spring:url value="/" htmlEscape="true" />"><i class="icon-home"></i> Home</a></li>
<li><a href="<spring:url value="/owners/find.html" htmlEscape="true" />"><i class="icon-search"></i> Find owner</a></li>
<li><a href="<spring:url value="/vets.html" htmlEscape="true" />"><i class="icon-th-list"></i> Display all veterinarians</a></li>
<li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />"><i class=" icon-question-sign"></i> Tutorial</a></li>
</ul>
</div>
</div>

View file

@ -2,7 +2,7 @@
<table class="footer"> <table class="footer">
<tr> <tr>
<td><a href="<spring:url value="/" htmlEscape="true" />">Home</a></td> <td></td>
<td align="right"><img src="<spring:url value="/resources/images/springsource-logo.png" htmlEscape="true" />" alt="Sponsored by SpringSource"/></td> <td align="right"><img src="<spring:url value="/resources/images/springsource-logo.png" htmlEscape="true" />" alt="Sponsored by SpringSource"/></td>
</tr> </tr>
</table> </table>

View file

@ -7,12 +7,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/> <jsp:include page="../fragments/bodyHeader.jsp"/>
<img src="${banner}" />
<c:choose> <c:choose>
<c:when test="${owner['new']}"><c:set var="method" value="post"/></c:when> <c:when test="${owner['new']}"><c:set var="method" value="post"/></c:when>
<c:otherwise><c:set var="method" value="put"/></c:otherwise> <c:otherwise><c:set var="method" value="put"/></c:otherwise>
@ -71,7 +70,7 @@
</fieldset> </fieldset>
</form:form> </form:form>
</div> </div>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</body> </body>
</html> </html>

View file

@ -5,12 +5,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/> <jsp:include page="../fragments/bodyHeader.jsp"/>
<img src="${banner}" />
<h2>Find Owners</h2> <h2>Find Owners</h2>
@ -31,7 +30,7 @@
<br/> <br/>
<a href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a> <a href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -5,13 +5,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container">
<div class="container"> <jsp:include page="../fragments/bodyHeader.jsp"/>
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img src="${banner}" />
<h2>Owner Information</h2> <h2>Owner Information</h2>
@ -55,24 +53,18 @@
<c:forEach var="pet" items="${owner.pets}"> <c:forEach var="pet" items="${owner.pets}">
<table class="table" style="width:600px;"> <table class="table" style="width:600px;">
<tr> <tr>
<td valign="top"> <td valign="top" style="width: 120px;">
<table> <dl class="dl-horizontal">
<tr> <dt>Name</dt>
<th>Name</th> <dd>${pet.name}</dd>
<td><b>${pet.name}</b></td> <dt>Birth Date</dt>
</tr> <dd><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></dd>
<tr> <dt>Type</dt>
<th>Birth Date</th> <dd>${pet.type.name}</dd>
<td><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></td> </dl>
</tr>
<tr>
<th>Type</th>
<td>${pet.type.name}</td>
</tr>
</table>
</td> </td>
<td valign="top"> <td valign="top">
<table> <table class="table-condensed">
<thead> <thead>
<tr> <tr>
<th>Visit Date</th> <th>Visit Date</th>
@ -118,7 +110,7 @@
</table> </table>
</c:forEach> </c:forEach>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>

View file

@ -6,14 +6,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img src="${banner}" />
<h2>Owners</h2> <h2>Owners</h2>
<table class="table table-striped"> <table class="table table-striped">
@ -45,7 +42,7 @@
</tr> </tr>
</c:forEach> </c:forEach>
</table> </table>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -5,14 +5,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/> <jsp:include page="../fragments/bodyHeader.jsp"/>
<img src="${banner}" />
<c:choose> <c:choose>
<c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when> <c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when>
<c:otherwise><c:set var="method" value="put"/></c:otherwise> <c:otherwise><c:set var="method" value="put"/></c:otherwise>
@ -56,7 +53,7 @@
</form:form> </form:form>
<c:if test="${!pet['new']}"> <c:if test="${!pet['new']}">
</c:if> </c:if>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -6,14 +6,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../header.jsp"/> <jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<jsp:include page="../fragments/bodyHeader.jsp"/>
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img src="${banner}" />
<h2><c:if test="${visit['new']}">New </c:if>Visit:</h2> <h2><c:if test="${visit['new']}">New </c:if>Visit:</h2>
<form:form modelAttribute="visit"> <form:form modelAttribute="visit">
@ -65,7 +62,7 @@
<br/> <br/>
<b>Previous Visits:</b> <b>Previous Visits:</b>
<table width="333"> <table style="width: 333px;">
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Description</th> <th>Description</th>
@ -81,7 +78,7 @@
</table> </table>
</div> </div>
<jsp:include page="../footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</body> </body>
</html> </html>

View file

@ -6,12 +6,11 @@
<html lang="en"> <html lang="en">
<jsp:include page="../fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<jsp:include page="header.jsp"/> <jsp:include page="../fragments/bodyHeader.jsp"/>
<spring:url value="/resources/images/banner-graphic.png" var="banner"/>
<img src="${banner}" />
<h2>Veterinarians</h2> <h2>Veterinarians</h2>
@ -44,7 +43,7 @@
</tr> </tr>
</table> </table>
<jsp:include page="footer.jsp"/> <jsp:include page="../fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -4,23 +4,16 @@
<html lang="en"> <html lang="en">
<jsp:include page="header.jsp"/> <jsp:include page="fragments/headTag.jsp"/>
<body> <body>
<div class="container"> <div class="container">
<spring:url value="/resources/images/banner-graphic.png" var="banner"/> <jsp:include page="fragments/bodyHeader.jsp"/>
<img src="${banner}" /> <h2><fmt:message key="welcome"/></h2>
<img src="<spring:url value="/resources/images/pets.png" htmlEscape="true" />" align="right" style="position:relative;right:30px;"></img> <spring:url value="/resources/images/pets.png" htmlEscape="true" var="petsImage"/>
<h2><fmt:message key="welcome"/></h2> <img src="${petsImage}" />
<ul class="unstyled">
<li><a href="<spring:url value="/owners/find.html" htmlEscape="true" />">Find owner</a></li>
<li><a href="<spring:url value="/vets.html" htmlEscape="true" />">Display all veterinarians</a></li>
<li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />">Tutorial</a></li>
</ul>
<jsp:include page="footer.jsp"/> <jsp:include page="fragments/footer.jsp"/>
</div> </div>
</body> </body>

View file

@ -42,7 +42,7 @@
<bean class="org.springframework.web.accept.PathExtensionContentNegotiationStrategy"> <bean class="org.springframework.web.accept.PathExtensionContentNegotiationStrategy">
<constructor-arg> <constructor-arg>
<map> <map>
<entry key="xml" value="#{vetsList.contentType}"/> <entry key="xml" value="application/vnd.springsource.samples.petclinic+xml"/>
<entry key="atom" value="#{visitsList.contentType}"/> <entry key="atom" value="#{visitsList.contentType}"/>
</map> </map>
</constructor-arg> </constructor-arg>
@ -101,8 +101,7 @@
<bean id="visitsList" class="org.springframework.samples.petclinic.web.VisitsAtomView"/> <bean id="visitsList" class="org.springframework.samples.petclinic.web.VisitsAtomView"/>
<bean id="vetsList" class="org.springframework.web.servlet.view.xml.MarshallingView"> <bean id="vets/vetsList" class="org.springframework.web.servlet.view.xml.MarshallingView">
<property name="contentType" value="application/vnd.springsource.samples.petclinic+xml"/>
<property name="marshaller" ref="marshaller"/> <property name="marshaller" ref="marshaller"/>
</bean> </bean>

View file

@ -11,4 +11,3 @@
input[type="text"] { input[type="text"] {
height: 25px; height: 25px;
} }