fix: 修复关于我们多语言切换和语言切换按钮回退问题
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<div class="section-title">
|
||||
<h2>{% trans '关于我们' %}</h2>
|
||||
</div>
|
||||
{% with about_content=site_settings.about_content_zh|default:site_settings.about_content_en %}
|
||||
{% with about_content=site_settings|ml:'about_content' %}
|
||||
{% if about_content %}
|
||||
<div class="about-content">
|
||||
{{ about_content|safe }}
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% if not site_settings.about_content_zh and not site_settings.about_content_en %}
|
||||
{% if not site_settings.about_content_zh and not site_settings.about_content_en and not about_content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="section-title">
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
</ul>
|
||||
<form action="{% url 'set_language' %}" method="post" class="lang-switcher ms-lg-3 mt-2 mt-lg-0">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="next" value="{{ request.get_full_path|force_escape }}">
|
||||
<button type="submit" name="language" value="zh-hans" class="btn btn-sm {% if LANGUAGE_CODE == 'zh-hans' %}btn-primary{% else %}btn-outline-primary{% endif %}">中文</button>
|
||||
<button type="submit" name="language" value="en" class="btn btn-sm {% if LANGUAGE_CODE == 'en' %}btn-primary{% else %}btn-outline-primary{% endif %}">EN</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user