Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用户体验和SEO优化 #683

Merged
merged 4 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ MAX_CHECKIN_TRAFFIC=209715200
# 网站title
TITLE=谜之屋
SUBTITLE=秘密的小屋
KEYWORDS=秘密的小屋
DESCRIPTION=秘密的小屋
# 用户邀请返利比例
INVITE_PERCENT=0.2
# 用户能生成的邀请码数量
Expand Down
2 changes: 2 additions & 0 deletions configs/default/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
# 网站title
TITLE = os.getenv("TITLE", "谜之屋")
SUBTITLE = os.getenv("SUBTITLE", "秘密的小屋")
KEYWORDS = os.getenv("KEYWORDS", "")
DESCRIPTION = os.getenv("DESCRIPTION", "")

# 用户邀请返利比例
INVITE_PERCENT = float(os.getenv("INVITE_PERCENT", 0.2))
Expand Down
4 changes: 3 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<head>
{% load static %}
<title>{% settings_value "TITLE" %}</title>
<meta name="keywords" content="{% settings_value "KEYWORDS" %}" />
<meta name="description" content="{% settings_value "DESCRIPTION" %}" />
{% include "basehead.html" %}
</head>

Expand Down Expand Up @@ -208,4 +210,4 @@ <h2 class="subtitle">
</div>
</body>
{% include "footer.html" %}
</html>
</html>
10 changes: 4 additions & 6 deletions templates/sspanel/userinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 class="subtitle">
{% if user.today_is_checkin %}
<p class="subtitle is-5 is-spaced">今天已经签到过了ಠ౪ಠ</p>
{% else %}
<p class="subtitle is-5 is-spaced"> 今天还没有签到,点一下可以获得{{ min_traffic }}~{{ max_traffic }}流量</p>
<p class="subtitle is-5 is-spaced">今天还没有签到,点一下可以获得{{ min_traffic }}~{{ max_traffic }}流量</p>
<br>
<button class="button">
<a>
Expand Down Expand Up @@ -281,9 +281,7 @@ <h2 class="subtitle">
}
$.post(url, data, function (results) {
info = results
swal(info.title, info.subtitle, info.status)
var box = $("#id-checkin-box")
box.html('<p class="subtitle is-5 is-spaced">今天已经签到过了ಠ౪ಠ</p>')
swal(info.title, info.subtitle, info.status).then(function(){location.reload();})
})
}
CheckButton.click(Checkin)
Expand All @@ -300,7 +298,7 @@ <h2 class="subtitle">
url = "{% url 'api:change_theme' %}"
$.post(url, data, function (results) {
info = results
swal(info.title, info.subtitle, info.status)
swal(info.title, info.subtitle, info.status).then(function(){location.reload();})
})
} else {
swal('错误!', '请选择你要更换的主题', 'error')
Expand All @@ -326,4 +324,4 @@ <h2 class="subtitle">
}
}
PasswordButton.click(changePassword)
</script> {% endblock main %}
</script> {% endblock main %}