You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
5.6 KiB
115 lines
5.6 KiB
|
6 days ago
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="zh-CN">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>${empty editUser ? '新增用户' : '编辑用户'} - 学生信息管理系统</title>
|
||
|
|
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="container">
|
||
|
|
<nav class="navbar">
|
||
|
|
<div class="nav-brand">
|
||
|
|
<a href="${pageContext.request.contextPath}/">学生信息管理系统</a>
|
||
|
|
</div>
|
||
|
|
<div class="nav-links">
|
||
|
|
<a href="${pageContext.request.contextPath}/admin/user?action=list">用户管理</a>
|
||
|
|
<a href="${pageContext.request.contextPath}/student?action=list">学生管理</a>
|
||
|
|
<a href="${pageContext.request.contextPath}/profile">个人中心</a>
|
||
|
|
<a href="${pageContext.request.contextPath}/logout">退出登录</a>
|
||
|
|
</div>
|
||
|
|
</nav>
|
||
|
|
|
||
|
|
<div class="page-header">
|
||
|
|
<h2>${empty editUser ? '新增用户' : '编辑用户'}</h2>
|
||
|
|
<div class="header-actions">
|
||
|
|
<a href="${pageContext.request.contextPath}/admin/user?action=list" class="btn btn-secondary">返回列表</a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<c:if test="${not empty error}">
|
||
|
|
<div class="alert alert-error">${error}</div>
|
||
|
|
</c:if>
|
||
|
|
|
||
|
|
<div class="form-container">
|
||
|
|
<form action="${pageContext.request.contextPath}/admin/user"
|
||
|
|
method="post" class="data-form">
|
||
|
|
<input type="hidden" name="action" value="${empty editUser ? 'save' : 'update'}">
|
||
|
|
<c:if test="${not empty editUser}">
|
||
|
|
<input type="hidden" name="id" value="${editUser.id}">
|
||
|
|
</c:if>
|
||
|
|
|
||
|
|
<div class="form-row">
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="username">用户名 <span class="required">*</span></label>
|
||
|
|
<input type="text" id="username" name="username" class="form-control"
|
||
|
|
value="${editUser.username}" required maxlength="50"
|
||
|
|
${not empty editUser ? 'readonly' : ''}>
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="password">
|
||
|
|
密码
|
||
|
|
<c:if test="${not empty editUser}">
|
||
|
|
<span style="font-weight:400;color:#999;font-size:12px;">(留空不修改)</span>
|
||
|
|
</c:if>
|
||
|
|
<c:if test="${empty editUser}"><span class="required">*</span></c:if>
|
||
|
|
</label>
|
||
|
|
<input type="text" id="password" name="password" class="form-control"
|
||
|
|
placeholder="${empty editUser ? '设置密码' : '留空则不修改'}"
|
||
|
|
${empty editUser ? 'required' : ''}>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-row">
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="realName">真实姓名</label>
|
||
|
|
<input type="text" id="realName" name="realName" class="form-control"
|
||
|
|
value="${editUser.realName}" maxlength="50">
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="role">角色</label>
|
||
|
|
<select id="role" name="role" class="form-control">
|
||
|
|
<option value="user" ${editUser.role == 'user' ? 'selected' : ''}>一般用户</option>
|
||
|
|
<option value="admin" ${editUser.role == 'admin' ? 'selected' : ''}>管理员</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-row">
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="email">电子邮箱</label>
|
||
|
|
<input type="email" id="email" name="email" class="form-control"
|
||
|
|
value="${editUser.email}" maxlength="100">
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="phone">联系电话</label>
|
||
|
|
<input type="text" id="phone" name="phone" class="form-control"
|
||
|
|
value="${editUser.phone}" maxlength="20">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<c:if test="${not empty editUser}">
|
||
|
|
<div class="form-row">
|
||
|
|
<div class="form-group">
|
||
|
|
<label for="status">状态</label>
|
||
|
|
<select id="status" name="status" class="form-control">
|
||
|
|
<option value="正常" ${editUser.status == '正常' ? 'selected' : ''}>正常</option>
|
||
|
|
<option value="禁用" ${editUser.status == '禁用' ? 'selected' : ''}>禁用</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div class="form-group"></div>
|
||
|
|
</div>
|
||
|
|
</c:if>
|
||
|
|
|
||
|
|
<div class="form-actions">
|
||
|
|
<button type="submit" class="btn btn-primary">${empty editUser ? '添加用户' : '保存修改'}</button>
|
||
|
|
<a href="${pageContext.request.contextPath}/admin/user?action=list" class="btn btn-secondary">取消</a>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|