Skip to content

Commit

Permalink
Refactor templates: update block names
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Jan 19, 2024
1 parent 1d67f77 commit 5b2fbea
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 212 deletions.
2 changes: 1 addition & 1 deletion apps/sspanel/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

urlpatterns = [
# 网站用户面板
path("", views.IndexView.as_view(), name="index"),
path("", views.UserLogInView.as_view(), name="index"),
path("help/", views.HelpView.as_view(), name="help"),
# 邀请
path("invitecode/", views.InviteCodeView.as_view(), name="invite_code"),
Expand Down
7 changes: 0 additions & 7 deletions apps/sspanel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
from apps.utils import get_current_datetime, traffic_format


class IndexView(View):
def get(self, request):
"""跳转到首页"""
context = {"simple_extra_static": True}
return render(request, "web/index.html", context=context)


class HelpView(View):
def get(self, request):
"""跳转到帮助界面"""
context = {"simple_extra_static": True}
return render(request, "web/help.html", context=context)

Expand Down
61 changes: 19 additions & 42 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<hr class="navbar-divider" />
<a class="navbar-item" href="{% url 'sspanel:logout' %}">
<span class="icon">
<i class="fa fa-sign-out"></i>
<i class="fas fa-sign-out-alt"></i>
</span>
<span>注销登录</span>
</a>
Expand Down Expand Up @@ -86,17 +86,18 @@
<section class="hero is-small is-info">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">{% settings_value "SITE_SUBTITLE" %}</h1>
<h2 class="subtitle">你说会发现什么呢?</h2>
<h2 class="title">{% settings_value "SITE_TITLE" %}</h2>
<h1 class="subtitle">{% settings_value "SITE_SUBTITLE" %}</h1>
</div>
</div>
</section>
<hr />
<div class="container">
<div class="columns">
<div class="column is-2 is-hidden-mobile">
<div class="box">
{% if user.is_authenticated %}
<!-- 左侧导航栏 -->
{% if user.is_authenticated %}
<div class="column is-2 is-hidden-mobile">
<div class="box">
<aside class="menu">
<ul class="menu-list">
<p class="menu-label">我的信息</p>
Expand Down Expand Up @@ -146,45 +147,21 @@ <h2 class="subtitle">你说会发现什么呢?</h2>
</li>
</ul>
{% endif %}

{% else %}
<article class="message is-primary">
<div class="message-header">
<p>幻想乡</p>
<button class="delete"></button>
</div>
<div class="message-body">幻想中的「地方」</div>
</article>
<article class="message is-info">
<div class="message-header">
<p>谜の屋</p>
<button class="delete"></button>
</div>
<div class="message-body">他不存于「地表」</div>
</article>
<article class="message is-success">
<div class="message-header">
<p>时之塔</p>
<button class="delete"></button>
</div>
<div class="message-body">这囚禁着「思想」</div>
</article>
<article class="message is-warning">
<div class="message-header">
<p>旧の桥</p>
<button class="delete"></button>
</div>
<div class="message-body">却连接着「自由」</div>
</article>
{% endif %}
</aside>
</aside>
</div>
</div>
<!-- 右侧内容 -->
<div class="column is-10">
{% block authed %}
{% endblock authed %}
</div>
</div>
<div class="column is-10">
{% block main %}
{% endblock main %}
{% else %}
<div class="column is-12">
{% block un-authed %}
{% endblock un-authed %}
</div>
</div>
{% endif %}
</div>
</body>
{% settings_value "HIDE_FOOTER" as hide_footer %}
Expand Down
4 changes: 2 additions & 2 deletions templates/registration/password_change_done.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block main %}
{% block authed %}
<div class="flex-center">
<div class="container">
<div>
Expand All @@ -10,4 +10,4 @@
</div>
</div>
</div>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/registration/password_change_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand Down Expand Up @@ -32,4 +32,4 @@ <h3 class="title">密码修改:</h3>
</form>
</div>
</div>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/registration/password_reset_complete.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand All @@ -19,4 +19,4 @@ <h2 class="subtitle">这次要好好记住喔....</h2>
</h1>
</div>
</div>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/registration/password_reset_confirm.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand Down Expand Up @@ -32,4 +32,4 @@ <h3 class="title">设置新的密码:</h3>
</form>
</div>
</div>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/registration/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block un-authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand Down Expand Up @@ -44,4 +44,4 @@ <h2 class="subtitle">没收到的话请检查垃圾箱</h2>
</div>
</div>
</div>
{% endblock main %}
{% endblock un-authed %}
4 changes: 2 additions & 2 deletions templates/registration/password_reset_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block un-authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand Down Expand Up @@ -32,4 +32,4 @@ <h3 class="title">请输入注册邮箱:</h3>
</form>
</div>
</div>
{% endblock main %}
{% endblock un-authed %}
4 changes: 2 additions & 2 deletions templates/web/aff_invite.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
<div class="column is-12">
<section class="hero is-warning is-smaill">
<div class="hero-body">
Expand Down Expand Up @@ -77,4 +77,4 @@ <h2 class="subtitle">
};
genRefChart();
</script>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/web/announcement.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
<div class="column is-12">
<section class="hero is-success is-smaill">
<div class="hero-body">
Expand Down Expand Up @@ -34,4 +34,4 @@ <h2 class="subtitle">暂时还没发出公告</h2>
</div>
</div>
</div>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/web/charge_center.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block authed %}
{% load static %}
{% load ehcofilter %}
<div class="column is-12">
Expand Down Expand Up @@ -221,4 +221,4 @@ <h2 class="subtitle">捐赠的钱会自动打进你的账号余额....</h2>
payquery(false);
});
</script>
{% endblock main %}
{% endblock authed %}
4 changes: 2 additions & 2 deletions templates/web/help.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block un-authed %}
<div class="column is-12">
<section class="hero is-info is-smaill">
<div class="hero-body">
Expand Down Expand Up @@ -46,4 +46,4 @@ <h2 class="title">注册了你就知道了 ʘʚʘ</h2>
</div>
</div>
</div>
{% endblock main %}
{% endblock un-authed %}
69 changes: 0 additions & 69 deletions templates/web/index.html

This file was deleted.

4 changes: 2 additions & 2 deletions templates/web/invite.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block main %}
{% block un-authed %}
{% load ehcofilter %}
<div class="column is-12">
<section class="hero is-info is-smaill">
Expand Down Expand Up @@ -37,4 +37,4 @@ <h2 class="subtitle">哦哦哦,用完了!</h2>
</div>
</div>
</div>
{% endblock main %}
{% endblock un-authed %}
Loading

0 comments on commit 5b2fbea

Please sign in to comment.