做读者档案、联系方式、借阅资格功能
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><c:out value="${formTitle}" /> - MZH Library</title>
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="/WEB-INF/jsp/common/header.jspf" %>
|
||||
<main class="page-shell">
|
||||
<section class="form-panel" aria-labelledby="reader-form-title">
|
||||
<p class="eyebrow">Reader Management</p>
|
||||
<h1 id="reader-form-title"><c:out value="${formTitle}" /></h1>
|
||||
|
||||
<c:if test="${not empty errorMessage}">
|
||||
<div class="message message-error" role="alert">
|
||||
<c:out value="${errorMessage}" />
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:set var="hasFormValues" value="${not empty formValues}" />
|
||||
<c:set var="identifierValue" value="${hasFormValues ? formValues.identifier : reader.identifier}" />
|
||||
<c:set var="userIdValue" value="${hasFormValues ? formValues.userId : reader.userId}" />
|
||||
<c:set var="fullNameValue" value="${hasFormValues ? formValues.fullName : reader.fullName}" />
|
||||
<c:set var="phoneValue" value="${hasFormValues ? formValues.phone : reader.phone}" />
|
||||
<c:set var="emailValue" value="${hasFormValues ? formValues.email : reader.email}" />
|
||||
<c:set var="statusValue" value="${hasFormValues ? formValues.status : reader.status.code}" />
|
||||
<c:set var="maxBorrowCountValue" value="${hasFormValues ? formValues.maxBorrowCount : reader.maxBorrowCount}" />
|
||||
|
||||
<form class="reader-form" action="${pageContext.request.contextPath}${formAction}" method="post" novalidate>
|
||||
<c:if test="${reader.id > 0}">
|
||||
<input type="hidden" name="id" value="${reader.id}">
|
||||
</c:if>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label for="identifier">Reader ID</label>
|
||||
<input id="identifier" name="identifier" type="text" value="${fn:escapeXml(identifierValue)}" required>
|
||||
<c:if test="${not empty errors.identifier}">
|
||||
<span class="field-error"><c:out value="${errors.identifier}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="fullName">Full name</label>
|
||||
<input id="fullName" name="fullName" type="text" value="${fn:escapeXml(fullNameValue)}" required>
|
||||
<c:if test="${not empty errors.fullName}">
|
||||
<span class="field-error"><c:out value="${errors.fullName}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="phone">Phone</label>
|
||||
<input id="phone" name="phone" type="tel" value="${fn:escapeXml(phoneValue)}">
|
||||
<c:if test="${not empty errors.phone}">
|
||||
<span class="field-error"><c:out value="${errors.phone}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="email">Email</label>
|
||||
<input id="email" name="email" type="email" value="${fn:escapeXml(emailValue)}">
|
||||
<c:if test="${not empty errors.email}">
|
||||
<span class="field-error"><c:out value="${errors.email}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="userId">Linked account ID</label>
|
||||
<input id="userId" name="userId" type="number" min="1" value="${fn:escapeXml(userIdValue)}">
|
||||
<c:if test="${not empty errors.userId}">
|
||||
<span class="field-error"><c:out value="${errors.userId}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="maxBorrowCount">Max borrow count</label>
|
||||
<input id="maxBorrowCount" name="maxBorrowCount" type="number" min="1" max="50"
|
||||
value="${fn:escapeXml(maxBorrowCountValue)}" required>
|
||||
<c:if test="${not empty errors.maxBorrowCount}">
|
||||
<span class="field-error"><c:out value="${errors.maxBorrowCount}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="status">Status</label>
|
||||
<select id="status" name="status" required>
|
||||
<option value="">Select status</option>
|
||||
<c:forEach var="status" items="${statuses}">
|
||||
<option value="${status.code}" <c:if test="${statusValue == status.code}">selected</c:if>>
|
||||
<c:out value="${status.displayName}" />
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<c:if test="${not empty errors.status}">
|
||||
<span class="field-error"><c:out value="${errors.status}" /></span>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button class="button button-primary" type="submit">Save</button>
|
||||
<a class="button button-secondary" href="${pageContext.request.contextPath}/readers">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user