{% extends "layout.html" %}
{% block title %}
<title>注册 - {{cfg("sr.ht", "site-name")}}</title>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-10 offset-md-1">
<h3>
注册 {{cfg("sr.ht", "site-name")}}
<small>
或 <a href="/login">登录</a>
</small>
</h3>
</div>
</div>
{% if is_external_auth() %}
<p>注册已禁用,{{cfg("sr.ht", "site-name")}} 的认证由其他服务管理。
请联系系统管理员了解详情。</p>
{% elif allow_registration() %}
{% if cfg("meta.sr.ht::billing", "enabled") == "yes" %}
<div class="row">
<div class="col-md-10 offset-md-1">
<p>
{% if payment %}
你正在注册为<strong>维护者</strong>。完成注册后,你将前往账单页面了解付款方式和减免政策。
<a href="{{url_for("auth.register")}}">改为注册贡献者 {{icon('caret-right')}}</a>
{% else %}
你正在注册为<strong>贡献者</strong>,免费但部分功能受限。
完成注册后,你可以随时在个人设置中转换为维护者账户。
<a href="{{url_for("auth.register")}}">改为注册维护者 {{icon('caret-right')}}</a>
{% endif %}
</p>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-6 offset-md-3">
<form method="POST" action="{{url_for("auth.register_step2_POST")}}">
{{csrf_token()}}
<div class="form-group">
<label for="username">用户名</label>
<input
type="text"
name="username"
id="username"
value="{{ username }}"
class="form-control {{valid.cls("username")}}"
required
autocomplete="username"
{% if not username %} autofocus{% endif %} />
{{valid.summary("username")}}
</div>
<div class="form-group">
<label for="email">邮箱地址</label>
<input
type="email"
name="email"
id="email"
value="{{ email }}"
class="form-control {{valid.cls("email")}}"
required
{% if username and not email %} autofocus{% endif %} />
{{valid.summary("email")}}
{% if email and "+" in email %}
<input type="hidden" name="allow-plus-in-email" value="yes" />
<div class="alert alert-danger">
<strong>警告</strong>:要正常使用 {{cfg("sr.ht",
"site-name")}},你必须能够使用此邮箱地址收发邮件。
如确认无误,请再次提交表单。
</div>
{% endif %}
</div>
<div class="form-group">
<label for="password">密码</label>
<input
type="password"
name="password"
id="password"
value="{{ password }}"
class="form-control {{valid.cls("password")}}"
required
autocomplete="new-password"
{% if username and email and not password %} autofocus{% endif %} />
{{valid.summary("password")}}
</div>
{% if site_key %}
<div class="form-group">
<details
{% if valid.cls("pgpKey") == "is-invalid" %}
open
{% endif %}
>
<summary>PGP 公钥(可选)</summary>
<textarea
class="form-control {{valid.cls("pgpKey")}}"
id="pgpKey"
name="pgpKey"
style="font-family: monospace"
rows="5"
placeholder="gpg --armor --export-options export-minimal --export fingerprint…"
>{{pgpKey or ""}}</textarea>
<small class="form-text">
{{cfg("sr.ht", "site-name")}} 发出的邮件使用以下 PGP 密钥签名:<br />
<a href="/privacy/pubkey">{{site_key}}</a>
<p>
如果你在此添加 PGP 公钥,我们还会对发给你的邮件进行加密。
你可以稍后在设置中修改。
</p>
<p>
<strong class="text-danger">重要!</strong>
如果你现在提供了 PGP 公钥,你必须能够解密确认邮件才能完成注册。
</p>
</small>
{{valid.summary("pgpKey")}}
</details>
</div>
{% endif %}
<button class="btn btn-primary pull-right" type="submit">
注册 {{icon("caret-right")}}
</button>
<p class="clearfix"></p>
</form>
</div>
</div>
<div class="row">
<div class="col-md-8 offset-md-2">
{{valid.summary()}}
</div>
</div>
<div class="row">
<div class="col-md-10 offset-md-1">
<div class="alert alert-warning">
<strong>隐私声明</strong>:
{{cfg("sr.ht", "site-name")}} 仅收集提供服务所必需的最少个人信息。
我们不会为营销或数据分析目的收集或处理你的个人信息,也不会发送营销邮件。
你的信息仅在为提供服务所必需时才会与第三方共享,
且在此之前会通知你并给予你阻止信息传输的机会。
<a
href="{{cfg("sr.ht", "privacy-policy", default="https://man.sr.ht/privacy.md")}}"
rel="noopener"
target="_blank"
>隐私政策 {{icon('external-link-alt')}}</a>
</div>
</div>
</div>
{% else %}
<p>注册当前已关闭。</p>
{% endif %}
{% endblock %}