forked from gii-is-DP2/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
showing "add owner" button only to admin (it is done by using url access
control -easier than with roles-)
- Loading branch information
1 parent
2e54ddb
commit 6c0790e
Showing
2 changed files
with
41 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<%@ page session="false" trimDirectiveWhitespaces="true" %> | ||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> | ||
<%@ 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" %> | ||
|
||
<petclinic:layout pageName="owners"> | ||
|
||
<h2>Find Owners</h2> | ||
|
||
|
||
<form:form modelAttribute="owner" action="/owners" method="get" class="form-horizontal" | ||
id="search-owner-form"> | ||
<div class="form-group"> | ||
<div class="control-group" id="lastName"> | ||
<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> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button type="submit" class="btn btn-default">Find Owner</button> | ||
</div> | ||
</div> | ||
|
||
</form:form> | ||
|
||
<br/> | ||
<a class="btn btn-default" href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a> | ||
</petclinic:layout> | ||
<%@ page session="false" trimDirectiveWhitespaces="true" %> | ||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> | ||
<%@ 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" %> | ||
<%@ taglib prefix="sec" | ||
uri="http://www.springframework.org/security/tags"%> | ||
<!-- >%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%--> | ||
|
||
<petclinic:layout pageName="owners"> | ||
|
||
<h2>Find Owners</h2> | ||
|
||
|
||
<form:form modelAttribute="owner" action="/owners" method="get" class="form-horizontal" | ||
id="search-owner-form"> | ||
<div class="form-group"> | ||
<div class="control-group" id="lastName"> | ||
<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> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button type="submit" class="btn btn-default">Find Owner</button> | ||
</div> | ||
</div> | ||
|
||
</form:form> | ||
|
||
<br/> | ||
<sec:authorize url="/admin"> | ||
<a class="btn btn-default" href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a> | ||
</sec:authorize> | ||
|
||
</petclinic:layout> |