You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DjangoBlog/templates/account/result.html

46 lines
2.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{# gq: #}
{# 1. 模板继承:复用网站基础布局模板 #}
{# base.html 通常包含网站公共组件(如顶部导航栏、底部版权信息、全局样式引用等)#}
{# 继承后只需编写当前页面的专属内容,减少重复代码并保证全站风格统一 #}
{% extends 'share_layout/base.html' %}
{# 2. 加载国际化标签库:实现多语言文本切换 #}
{# 后续用{% trans %}包裹的文本如“login”“back to the homepage”可根据用户语言设置自动翻译 #}
{% load i18n %}
{# 3. 重写父模板的header块定义当前页面的标题 #}
{# 父模板中header块通常对应HTML的<head>区域,此处仅重写<title>标签 #}
{% block header %}
{# 动态标题:{{ title }}由视图函数传递,不同场景显示不同标题(如“登录提示”“操作成功”)#}
<title> {{ title }}</title>
{% endblock %}
{# 4. 重写父模板的content块定义页面核心内容提示信息与操作链接#}
{% block content %}
{# 主内容容器site-content和content类通常是网站预设样式控制内容区域的布局和样式 #}
<div id="primary" class="site-content">
<div id="content" role="main"> {# role="main"提升页面可访问性,告诉辅助工具这是主要内容区 #}
{# 提示信息头部archive-header类为预设样式用于包裹标题类内容 #}
<header class="archive-header">
{# 动态提示内容:{{ content }}由视图传递,显示具体提示文本(如“请先登录再访问该页面”“操作已完成”)#}
<h2 class="archive-title"> {{ content }}</h2>
</header><!-- .archive-header -->
<br/> {# 换行符:增加提示信息与操作链接之间的间距,提升视觉舒适度 #}
{# 操作链接头部:设置文本居中,引导用户点击关键链接 #}
<header class="archive-header" style="text-align: center">
{# 登录链接:跳转到账户登录页,供未登录用户使用(多语言文本支持)#}
<a href="{% url "account:login" %}">
{% trans 'login' %}
</a>
| {# 分隔符:视觉上区分不同链接,避免混淆 #}
{# 首页链接:跳转到网站首页,供需要返回主页面的用户使用(多语言文本支持)#}
<a href="/">
{% trans 'back to the homepage' %}
</a>
</header><!-- .archive-header -->
</div>
</div>
{% endblock %}