Download templates/admin_registration_codes.html from cacode/SACC: direct link, hf CLI and curl.
- Browser
- Download file 3.56 kB
-
https://huggingface.co/spaces/cacode/SACC/resolve/main/templates/admin_registration_codes.html
- Command line
-
hf download hf://spaces/cacode/SACC/templates/admin_registration_codes.html
-
curl -L -o admin_registration_codes.html https://huggingface.co/spaces/cacode/SACC/resolve/main/templates/admin_registration_codes.html
3.56 kB
| {% extends "admin_layout.html" %} | |
| {% block admin_title %}注册码{% endblock %} | |
| {% block admin_page_content %} | |
| <section class="content-grid admin-grid reveal-up delay-2"> | |
| <article class="card"> | |
| <div class="card-head"> | |
| <span class="kicker">注册码</span> | |
| <h2>创建注册码</h2> | |
| <p>学生拿到注册码后即可在 <code>/register</code> 页面使用学号和教务处密码完成注册。</p> | |
| </div> | |
| <form method="post" action="{{ url_for('create_registration_code') }}" class="form-grid form-grid-compact"> | |
| <label class="field span-2"> | |
| <span>备注</span> | |
| <input type="text" name="note" placeholder="例如 2025 春季新用户批次"> | |
| </label> | |
| <label class="field"> | |
| <span>可用次数</span> | |
| <input type="number" name="max_uses" min="1" max="99" value="{{ default_registration_code_max_uses }}" required> | |
| </label> | |
| <button type="submit" class="btn btn-secondary">生成注册码</button> | |
| </form> | |
| </article> | |
| <article class="card"> | |
| <div class="card-head"> | |
| <span class="kicker">使用说明</span> | |
| <h2>给学生的注册提示</h2> | |
| <p>建议提示用户使用学号和教务处密码注册;注册码只负责开通本系统账号,不替代教务处认证。</p> | |
| </div> | |
| <div class="button-row wrap-row"> | |
| <a href="{{ url_for('admin_users') }}" class="btn btn-ghost">返回用户管理</a> | |
| </div> | |
| </article> | |
| </section> | |
| <section class="card reveal-up delay-3 span-2"> | |
| <div class="card-head split"> | |
| <div> | |
| <span class="kicker">注册码清单</span> | |
| <h2>注册码状态</h2> | |
| <p>可以查看注册码是否启用、可用次数、已用次数以及最近一次使用情况。</p> | |
| </div> | |
| </div> | |
| <div class="course-table-wrap"> | |
| <table class="data-table"> | |
| <thead> | |
| <tr> | |
| <th>注册码</th> | |
| <th>备注</th> | |
| <th>状态</th> | |
| <th>使用</th> | |
| <th>最近使用者</th> | |
| <th>操作</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% if registration_codes %} | |
| {% for code in registration_codes %} | |
| <tr> | |
| <td><code>{{ code.code }}</code></td> | |
| <td>{{ code.note or '无' }}</td> | |
| <td>{{ '启用' if code.is_active else '停用' }}</td> | |
| <td>{{ code.used_count }}/{{ code.max_uses }}</td> | |
| <td>{{ code.used_by_student_id or '暂无' }}</td> | |
| <td> | |
| <form method="post" action="{{ url_for('toggle_registration_code', registration_code_id=code.id) }}"> | |
| <button type="submit" class="inline-action">{{ '停用' if code.is_active else '启用' }}</button> | |
| </form> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| {% else %} | |
| <tr> | |
| <td colspan="6" class="empty-cell">还没有创建注册码。</td> | |
| </tr> | |
| {% endif %} | |
| </tbody> | |
| </table> | |
| </div> | |
| </section> | |
| {% endblock %} | |