51 lines
3.6 KiB
HTML
51 lines
3.6 KiB
HTML
<!doctype html>
|
|
{% load static %}
|
|
<html lang="zh-Hans">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{% block title %}虾皮圈{% endblock %}</title>
|
|
<link href="{% static 'portal/vendor/bootstrap/bootstrap.min.css' %}" rel="stylesheet">
|
|
<link href="{% static 'portal/brand.css' %}" rel="stylesheet">
|
|
</head>
|
|
<body class="{% block body_class %}{% endblock %}">
|
|
<nav class="navbar navbar-expand">
|
|
<div class="container">
|
|
<a class="navbar-brand fw-semibold" href="{% url 'portal-home' %}">虾皮圈</a>
|
|
<div class="ms-auto d-flex gap-2 flex-wrap justify-content-end">
|
|
{% with current_url=request.resolver_match.url_name %}
|
|
{% if user.is_authenticated %}
|
|
<a class="btn btn-sm {% if current_url == 'portal-dashboard' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-dashboard' %} aria-current="page"{% endif %} href="{% url 'portal-dashboard' %}">控制台</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-recharge' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-recharge' %} aria-current="page"{% endif %} href="{% url 'portal-recharge' %}">充值</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-subscription' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-subscription' %} aria-current="page"{% endif %} href="{% url 'portal-subscription' %}">软件订阅</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-apikeys' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-apikeys' %} aria-current="page"{% endif %} href="{% url 'portal-apikeys' %}">API Key</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-models' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-models' %} aria-current="page"{% endif %} href="{% url 'portal-models' %}">可用模型</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-recharge-records' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-recharge-records' %} aria-current="page"{% endif %} href="{% url 'portal-recharge-records' %}">充值记录</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-usage-records' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-usage-records' %} aria-current="page"{% endif %} href="{% url 'portal-usage-records' %}">点数记录</a>
|
|
<form method="post" action="{% url 'portal-logout' %}">
|
|
{% csrf_token %}
|
|
<button class="btn btn-sm btn-outline-secondary" type="submit">退出</button>
|
|
</form>
|
|
{% else %}
|
|
<a class="btn btn-sm {% if current_url == 'portal-login' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-login' %} aria-current="page"{% endif %} href="{% url 'portal-login' %}">登录</a>
|
|
<a class="btn btn-sm {% if current_url == 'portal-signup' %}btn-primary{% else %}btn-outline-secondary{% endif %}"{% if current_url == 'portal-signup' %} aria-current="page"{% endif %} href="{% url 'portal-signup' %}">注册</a>
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
{% block body %}
|
|
<main class="cmhub-shell">
|
|
{% if messages %}
|
|
<div class="mb-3">
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ message.tags|default:'info' }} mb-2">{{ message }}</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
{% endblock %}
|
|
</body>
|
|
</html>
|