This repository has been archived on 2023-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
web-gpt/project/templates/index.html

57 lines
1.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block content %}
<h2 class="subtitle">
{% if user and user.is_authenticated %}
你好,{{ user.name }}
{% else %}
你好,游客!
{% endif %}
</h2>
{% with messages = get_flashed_messages() %}
{% if messages %}<div class="notification is-danger">{{ messages[0] }}</div>{% endif %}
{% endwith %}
{% if user and user.is_authenticated %}
{% if user.isActivated %}
<a href="{{ url_for('main.chat') }}">
<button type="button" class="btn btn-primary">开始聊天</button>
</a>
{% else %}
<div class="column is-4 is-offset-4">
<div class="box">
<p class="text-warning">您的账号暂未激活。</p>
<p class="text-warning">如未收到激活码邮件,请联系管理员处理</p>
<br/>
<form method="post" action="{{ url_for('auth.activate') }}">
<div class="field">
<div class="control">
<input class="input is-large"
type="text"
name="activation_code"
placeholder="激活码"
autofocus=""
required="required"/>
</div>
</div>
<button class="button is-block is-info is-large is-fullwidth">激活</button>
</form>
</div>
</div>
{% endif %}
{% else %}
<a href="{{ url_for('auth.login') }}">
<button type="button" class="btn btn-primary">登录</button>
</a>
<a href="{{ url_for('auth.signup') }}">
<button type="button" class="btn btn-default">注册</button>
</a>
{% endif %}
<div id="homepage-notice" class="row" style="margin-top: 100px;">
{% if homepage_notice %}
<h3 class="subtitle">公告栏</h3>
<pre>{{ homepage_notice }}</pre>
{% endif %}
</div>
{% endblock content %}