@@ -0,0 +1,26 @@
|
||||
{% extends "admin/base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ title }} | 葫芦数学后台{% endblock %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" href="{% static 'admin/css/hulumath_admin.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
<div class="hulu-brand">
|
||||
<a href="{% url 'admin:index' %}" class="hulu-brand-mark">H</a>
|
||||
<div>
|
||||
<a href="{% url 'admin:index' %}" class="hulu-brand-name">葫芦数学</a>
|
||||
<span>运营管理中心</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav-global %}
|
||||
<div class="hulu-global-nav">
|
||||
<span class="hulu-environment">{{ admin_environment|default:"运营后台" }}</span>
|
||||
<a href="/" target="_blank" rel="noopener">查看网站</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,146 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} dashboard hulu-dashboard{% endblock %}
|
||||
{% block breadcrumbs %}{% endblock %}
|
||||
{% block content_title %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="hulu-dashboard-head">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">OPERATIONS OVERVIEW</span>
|
||||
<h1>今天从哪里开始?</h1>
|
||||
<p>管理用户、人生内容、比赛和视频,关键异常会集中显示在这里。</p>
|
||||
</div>
|
||||
<div class="hulu-head-actions">
|
||||
<a class="hulu-button primary" href="{% url 'admin:content_contentitem_add' %}">发布内容</a>
|
||||
<a class="hulu-button" href="{% url 'admin:accounts_invitecode_add' %}">生成邀请码</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hulu-metric-grid">
|
||||
{% for metric in dashboard_metrics %}
|
||||
<article class="hulu-metric {{ metric.tone }}">
|
||||
<span>{{ metric.label }}</span>
|
||||
<strong>{{ metric.value }}</strong>
|
||||
<small>{{ metric.hint }}</small>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="hulu-dashboard-layout">
|
||||
<main class="hulu-modules">
|
||||
<div class="hulu-section-title">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">BUSINESS MODULES</span>
|
||||
<h2>业务模块</h2>
|
||||
</div>
|
||||
<span>按日常运营顺序排列</span>
|
||||
</div>
|
||||
|
||||
{% if app_list %}
|
||||
<div class="hulu-app-grid">
|
||||
{% for app in app_list %}
|
||||
<section class="hulu-app-card module-{{ app.app_label }}">
|
||||
<header>
|
||||
<div class="hulu-app-icon">{{ app.name|slice:":1" }}</div>
|
||||
<div>
|
||||
<h3>
|
||||
<a href="{{ app.app_url }}">{{ app.name }}</a>
|
||||
</h3>
|
||||
<span>{{ app.models|length }} 个管理入口</span>
|
||||
</div>
|
||||
</header>
|
||||
<div class="hulu-model-list">
|
||||
{% for model in app.models %}
|
||||
<div class="hulu-model-row">
|
||||
{% if model.admin_url %}
|
||||
<a href="{{ model.admin_url }}">{{ model.name }}</a>
|
||||
{% else %}
|
||||
<span>{{ model.name }}</span>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if model.add_url %}
|
||||
<a class="hulu-add-link" href="{{ model.add_url }}">新增</a>
|
||||
{% endif %}
|
||||
{% if model.admin_url %}
|
||||
<a class="hulu-view-link" href="{{ model.admin_url }}">管理</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="hulu-empty">当前账号没有后台管理权限。</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
|
||||
<aside class="hulu-dashboard-side">
|
||||
<section class="hulu-side-card hulu-todos">
|
||||
<div class="hulu-section-title compact">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">ATTENTION</span>
|
||||
<h2>待处理</h2>
|
||||
</div>
|
||||
</div>
|
||||
{% for alert in dashboard_alerts %}
|
||||
<a class="hulu-alert-row" href="{{ alert.url }}">
|
||||
<span>{{ alert.label }}</span>
|
||||
<strong>{{ alert.value }}</strong>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
<section class="hulu-side-card">
|
||||
<div class="hulu-section-title compact">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">QUICK LINKS</span>
|
||||
<h2>常用操作</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hulu-quick-links">
|
||||
<a href="{% url 'admin:math_life_story_add' %}">创建数学人生</a>
|
||||
<a href="{% url 'admin:contest_contest_add' %}">创建比赛</a>
|
||||
<a href="{% url 'admin:contest_question_add' %}">录入题目</a>
|
||||
<a href="{% url 'admin:latex_lab_latexcourse_add' %}">创建 LaTeX 课程</a>
|
||||
<a href="{% url 'admin:accounts_user_changelist' %}">查询用户</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="hulu-side-card">
|
||||
<div class="hulu-section-title compact">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">RECENT ACTIVITY</span>
|
||||
<h2>最近操作</h2>
|
||||
</div>
|
||||
</div>
|
||||
{% load log %}
|
||||
{% get_admin_log 6 as admin_log for_user user %}
|
||||
{% if admin_log %}
|
||||
<div class="hulu-recent-list">
|
||||
{% for entry in admin_log %}
|
||||
<div class="hulu-recent-row">
|
||||
<span class="hulu-action-dot {% if entry.is_addition %}add{% elif entry.is_change %}change{% else %}delete{% endif %}"></span>
|
||||
<div>
|
||||
{% if entry.is_deletion or not entry.get_admin_url %}
|
||||
<strong>{{ entry.object_repr }}</strong>
|
||||
{% else %}
|
||||
<a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
|
||||
{% endif %}
|
||||
<small>{{ entry.content_type }} · {{ entry.action_time|timesince }}前</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="hulu-muted">还没有后台操作记录。</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
</aside>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
@@ -0,0 +1,65 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n static %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} login hulu-admin-login{% endblock %}
|
||||
{% block nav-sidebar %}{% endblock %}
|
||||
{% block breadcrumbs %}{% endblock %}
|
||||
{% block nav-global %}{% endblock %}
|
||||
{% block content_title %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="hulu-login-shell">
|
||||
<section class="hulu-login-intro">
|
||||
<span class="hulu-eyebrow">HULU MATH OPERATIONS</span>
|
||||
<h1>管理数学人生宇宙</h1>
|
||||
<p>发布内容、维护剧情、组织比赛,并查看真实用户的成长轨迹。</p>
|
||||
<div class="hulu-login-points">
|
||||
<span>用户与邀请码</span>
|
||||
<span>剧情与 MathBTI</span>
|
||||
<span>比赛与内容运营</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="hulu-login-card">
|
||||
<div>
|
||||
<span class="hulu-eyebrow">STAFF SIGN IN</span>
|
||||
<h2>后台登录</h2>
|
||||
<p>仅限已授权的运营和管理员账号。</p>
|
||||
</div>
|
||||
|
||||
{% if form.errors and not form.non_field_errors %}
|
||||
<p class="errornote">用户名或密码不正确,请重新输入。</p>
|
||||
{% endif %}
|
||||
{% if form.non_field_errors %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<p class="errornote">{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ app_path }}" method="post" id="login-form">
|
||||
{% csrf_token %}
|
||||
<div class="form-row">
|
||||
{{ form.username.errors }}
|
||||
<label for="{{ form.username.id_for_label }}">用户名</label>
|
||||
{{ form.username }}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
{{ form.password.errors }}
|
||||
<label for="{{ form.password.id_for_label }}">密码</label>
|
||||
{{ form.password }}
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
</div>
|
||||
{% url 'admin_password_reset' as password_reset_url %}
|
||||
{% if password_reset_url %}
|
||||
<div class="password-reset-link">
|
||||
<a href="{{ password_reset_url }}">忘记密码?</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="submit-row">
|
||||
<input type="submit" value="进入运营后台">
|
||||
</div>
|
||||
</form>
|
||||
<a class="hulu-back-site" href="/">← 返回葫芦数学网站</a>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user