| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- {% extends "base.html" %}
- {% block title %}{% if user %}逐鹿人才-证件合同管理系统-编辑{% else %}逐鹿人才-证件合同管理系统-新建{% endif %}逐鹿人才-证件合同管理系统-用户{% endblock %}
- {% block content %}
- <div class="d-flex justify-content-between align-items-center mb-3">
- <h2>{% if user %}编辑{% else %}新建{% endif %}用户</h2>
- <a href="{{ url_for('user_list') }}" class="btn btn-outline-secondary">返回列表</a>
- </div>
- <div class="card">
- <div class="card-body">
- <form method="POST">
- <div class="row">
- <div class="col-md-6 mb-3">
- <label for="username" class="form-label">用户名</label>
- <input type="text" class="form-control" id="username" name="username"
- value="{{ user.username if user }}" required>
- </div>
- <div class="col-md-6 mb-3">
- <label for="password" class="form-label">密码</label>
- <input type="password" class="form-control" id="password" name="password"
- {% if not user %}required{% endif %}>
- {% if user %}
- <small class="text-muted">留空则不修改密码</small>
- {% endif %}
- </div>
- </div>
- <div class="row">
- <div class="col-md-6 mb-3">
- <label for="name" class="form-label">姓名</label>
- <input type="text" class="form-control" id="name" name="name"
- value="{{ user.name if user }}" required>
- </div>
- <div class="col-md-6 mb-3">
- <label for="department" class="form-label">部门</label>
- <input type="text" class="form-control" id="department" name="department"
- value="{{ user.department if user }}" required>
- </div>
- </div>
- <div class="mb-3">
- <label for="email" class="form-label">邮箱</label>
- <input type="email" class="form-control" id="email" name="email"
- value="{{ user.email if user }}" required>
- </div>
- <div class="mb-3">
- <div class="form-check">
- <input class="form-check-input" type="checkbox" id="is_admin" name="is_admin"
- {% if user and user.is_admin %}checked{% endif %}>
- <label class="form-check-label" for="is_admin">管理员</label>
- </div>
- </div>
- <div class="mb-3">
- <h5>权限设置</h5>
- <div class="form-check">
- <input class="form-check-input" type="checkbox" id="can_create" name="can_create"
- {% if user and user.can_create %}checked{% endif %}>
- <label class="form-check-label" for="can_create">创建合同</label>
- </div>
- <div class="form-check">
- <input class="form-check-input" type="checkbox" id="can_view" name="can_view"
- {% if user and user.can_view %}checked{% endif %}>
- <label class="form-check-label" for="can_view">查看合同</label>
- </div>
- <div class="form-check">
- <input class="form-check-input" type="checkbox" id="can_edit" name="can_edit"
- {% if user and user.can_edit %}checked{% endif %}>
- <label class="form-check-label" for="can_edit">编辑合同</label>
- </div>
- <div class="form-check">
- <input class="form-check-input" type="checkbox" id="can_delete" name="can_delete"
- {% if user and user.can_delete %}checked{% endif %}>
- <label class="form-check-label" for="can_delete">删除合同</label>
- </div>
- </div>
- <div class="d-grid gap-2 mt-4">
- <button type="submit" class="btn btn-primary">保存</button>
- </div>
- </form>
- </div>
- </div>
- {% endblock %}
|