修改关于我们页面,优化中英文切换

This commit is contained in:
2026-08-05 08:56:28 +08:00
parent d06c955a3d
commit 2022664e7e
5 changed files with 47 additions and 1 deletions
+13
View File
@@ -6,6 +6,15 @@
{% block content %}
<section class="section bg-white py-5">
<div class="container">
<div class="section-title">
<h2>{% trans '关于我们' %}</h2>
</div>
{% with about_content=site_settings.about_content_zh|default:site_settings.about_content_en %}
{% if about_content %}
<div class="about-content">
{{ about_content|safe }}
</div>
{% else %}
<div class="row align-items-center g-5">
<div class="col-lg-6">
<h2 class="mb-4">{% trans '关于我们' %}</h2>
@@ -36,9 +45,12 @@
</div>
</div>
</div>
{% endif %}
{% endwith %}
</div>
</section>
{% if not site_settings.about_content_zh and not site_settings.about_content_en %}
<section class="section">
<div class="container">
<div class="section-title">
@@ -69,4 +81,5 @@
</div>
</div>
</section>
{% endif %}
{% endblock %}
-1
View File
@@ -31,7 +31,6 @@
</ul>
<form action="{% url 'set_language' %}" method="post" class="lang-switcher ms-lg-3 mt-2 mt-lg-0">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}">
<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>