update. 完善基础信息配置以及页面链接处理

This commit is contained in:
2026-04-02 00:49:21 +08:00
parent b8d53a4c2e
commit 66dd4916d1
17 changed files with 218 additions and 275 deletions
+106 -97
View File
@@ -1,26 +1,22 @@
{% load static %}
{% load footer_tags %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>{% block title %}{% endblock %}XXXXXXX官网</title>
<title>{% block title %}{% endblock %}{{ site_info.title }}</title>
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
</head>
<body>
<!-- 顶部 -->
<header class="top-header">
<span></span>
<div class="header-container flex">
<img src="{% static 'images/logo.png' %}" class="logo" alt="">
<div>
<h1>XXXXXXX官网</h1>
<p>CHANGBAI MOUNTAIN FIRE AND RESCUE BRIGADE</p>
<h1>{{ site_info.title }}</h1>
<p>{{ site_info.e_title }}</p>
<p>CHANGBAI MOUNTAIN FIRE AND RESCUE BRIGADE</p>
</div>
</div>
<div></div>
@@ -45,29 +41,13 @@
<li class="{% if request.resolver_match.url_name == 'news' %}active{% endif %}">
<a href="{% url 'front:news' %}">新闻中心</a>
</li>
{% show_main_menu %}
{% for menu in menus %}
<!-- 新闻中心 -->
{##}
{# <!-- 信息公开 -->#}
{# <li class="{% if request.resolver_match.url_name == 'info' %}active{% endif %}">#}
{# <a href="{% url 'front:info' %}">信息公开</a>#}
{# </li>#}
{# <!-- 党建引领 -->#}
{# <li class="{% if request.resolver_match.url_name == 'party' %}active{% endif %}">#}
{# <a href="{% url 'front:party' %}">党建引领</a>#}
{# </li>#}
{# <!-- 办事服务 -->#}
{# <li class="{% if request.resolver_match.url_name == 'service' %}active{% endif %}">#}
{# <a href="{% url 'front:service' %}">办事服务</a>#}
{# </li>#}
{# <!-- 互动交流 -->#}
{# <li class="{% if request.resolver_match.url_name == 'interaction' %}active{% endif %}">#}
{# <a href="{% url 'front:interaction' %}">互动交流</a>#}
{# </li>#}
{# <!-- 消防科普 -->#}
{# <li class="{% if request.resolver_match.url_name == 'science' %}active{% endif %}">#}
{# <a href="{% url 'front:science' %}">消防科普</a>#}
{# </li>#}
<li class="{% if menu.code in request.path %}active{% endif %}">
<a href="{% url 'front:section' main=menu.code %}">{{ menu.title }}</a>
</li>
{% endfor %}
</ul>
</div>
<span></span>
@@ -86,75 +66,104 @@
</main>
<!-- 底部页脚:只需要写这一行,全站生效! -->
{% show_footer %}
<!-- 底部 -->
{#<footer class="footer">#}
{# <div class=" d-none d-md-block">#}
{# <div class="row"#}
{# style="align-items: center;justify-content: space-evenly;padding: 15px 0;background-color: #F5F5F5;width: 100%!important;margin-left: 0 !important;gap: 10px;">#}
{# <div style="display: flex;align-items: center;">#}
{# <img src="{% static "icons/link.svg" %}" alt="" style="width: 13px; height: 13px; object-fit: contain;">#}
{# <a href="#"#}
{# style="margin-left: 6px; text-decoration: none; color: #13227a; font-size: 14px; white-space: nowrap;">#}
{# 友情链接#}
{# </a>#}
{# </div>#}
{# <div style="width: 280px;">#}
{# <select class="form-control" id="exampleFormControlSelect1"#}
{# x-placement="市政府网站"#}
{# >#}
{# <option>市政府网站</option>#}
{# <option>1</option>#}
{# <option>2</option>#}
{# <option>3</option>#}
{# <option>4</option>#}
{# <option>5</option>#}
{# </select>#}
{# </div>#}
{# <div style="display: block;width: 280px;">#}
{# <select class="form-control" id="exampleFormControlSelect1"#}
{# x-placement="国内消防站点"#}
{# >#}
{# <option>国内消防站点</option>#}
{# <option>1</option>#}
{# <option>2</option>#}
{# <option>3</option>#}
{# <option>4</option>#}
{# <option>5</option>#}
{# </select>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# <div class="footer-info">#}
{# <div class="row">#}
{# <div class="col-lg-3 col-md-6 text-center">#}
{# <img src="{% static 'images/red.png' %}">#}
{# <img class="footerImg" src="{% static 'images/jiucuo.png' %}">#}
{# </div>#}
{# <div class="col-lg-6 d-none d-xl-block">#}
{# <p class="margin-top-20 font-size-14 line-height-2 footerColor">#}
{# 地址:某某市某某东路锦海·某某区大厦B栋14楼 邮编:xxxxxx#}
{# </p>#}
{# <p class="font-size-14 line-height-2 footerColor">#}
{# 服务热线:0791-00000000 传真:0791-00000000#}
{# </p>#}
{# </div>#}
{# <div class="col-lg-3 col-md-6 text-center">#}
{# <img src="/media/upload/images/2026/03/25/wechat.png" alt="">#}
{# <img class="footerImg" src="/media/upload/images/2026/03/25/weibo.png" alt="">#}
{# </div>#}
{# </div>#}
{# <div class="copyright text-center line-height-2 padding-bottom-20 padding-top-20">#}
{# <p class="margin-top-20 font-size-14 line-height-2 footerColor">#}
{# 版权所有:长白山消防救援支队 备案证号:<a href="http://beian.miit.gov.cn/"#}
{# target="_blank">辽ICP备xxxxxxxx号</a>#}
{# </p>#}
{# </div>#}
{# </div>#}
{#</footer>#}
<footer class="footer">
<!-- 友情链接区域 -->
<div class=" d-none d-md-block">
<div class="row"
style="align-items: center;justify-content: space-evenly;padding: 15px 0;background-color: #F5F5F5;width: 100%!important;margin-left: 0 !important;gap: 10px;">
<div style="display: flex;align-items: center;">
<img src="{% static "icons/link.svg" %}" alt=""
style="width: 13px; height: 13px; object-fit: contain;">
<a href="#"
style="margin-left: 6px; text-decoration: none; color: #13227a; font-size: 14px; white-space: nowrap;">
友情链接
</a>
</div>
{% for category in categories %}
<!-- 市政府网站下拉框 -->
<div style="width: 280px;">
<select class="form-control"
onchange="if(this.value) window.open(this.value)">
<option>{{ category.name }}</option>
{% for link in category.links.all %}
{% if link.is_active %}
<!-- 这里可以动态循环 FooterLink 关联的友情链接对象 -->
<option value="{{ link.url }}">{{ link.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{% empty %}
<!-- 如果后台没配置分类,显示默认占位 -->
<div style="width: 280px;">
<select class="form-control">
<option>暂无链接</option>
</select>
</div>
{% endfor %}
</div>
</div>
<!-- 页脚主体信息区域 -->
<div class="footer-info">
<div class="row">
<!-- 左侧:Logo 图标 -->
<div class="col-lg-3 col-md-6 text-center">
<img src="{% static 'images/red.png' %}" alt="政府标识">
<img class="footerImg" src="{% static 'images/jiucuo.png' %}" alt="找错">
</div>
<!-- 中间:文字信息 -->
<div class="col-lg-6 d-none d-xl-block">
<!-- 地址与邮编 -->
<p class="margin-top-20 font-size-14 line-height-2 footerColor">
地址:{{ base_info.address }} 邮编:{{ base_info.postal }}
</p>
<!-- 电话与传真 -->
<p class="font-size-14 line-height-2 footerColor">
服务热线:{{ base_info.telephone }} 传真:{{ base_info.fax }}
</p>
</div>
<!-- 右侧:公众号/微博二维码 -->
<div class="col-lg-3 col-md-6 text-center">
<!-- 微信二维码 -->
{% if base_info.official_account %}
<img src="{{ base_info.official_account.url }}" alt="微信公众号"
style="width: 50px; height: 50px; margin-right: 10px;">
{% else %}
<span>暂无二维码</span>
{% endif %}
<!-- 微博二维码 -->
{% if base_info.weibo %}
<img class="footerImg" src="{{ base_info.weibo.url }}" alt="政务微博"
style="width: 50px; height: 50px;">
{% else %}
<span>暂无微博</span>
{% endif %}
</div>
</div>
<!-- 版权备案信息 -->
<div class="copyright text-center line-height-2 padding-bottom-20 padding-top-20">
<p class="margin-top-20 font-size-14 line-height-2 footerColor">
版权所有:{{ base_info.unit }} 备案证号:
<a href="http://beian.miit.gov.cn/" target="_blank">
{{ base_info.filing }}
</a>
</p>
</div>
</div>
</footer>
<script src="{% static 'js/jquery-3.6.0.min.js' %}"></script>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
<!-- 页面底部脚本 -->
{% block extra_js %}{% endblock %}
</body>
</html>
-95
View File
@@ -1,95 +0,0 @@
{% load static %}
<footer class="footer">
<!-- 友情链接区域 -->
<div class=" d-none d-md-block">
<div class="row"
style="align-items: center;justify-content: space-evenly;padding: 15px 0;background-color: #F5F5F5;width: 100%!important;margin-left: 0 !important;gap: 10px;">
<div style="display: flex;align-items: center;">
<img src="{% static "icons/link.svg" %}" alt=""
style="width: 13px; height: 13px; object-fit: contain;">
<a href="#"
style="margin-left: 6px; text-decoration: none; color: #13227a; font-size: 14px; white-space: nowrap;">
友情链接
</a>
</div>
{% for category in categories %}
<!-- 市政府网站下拉框 -->
<div style="width: 280px;">
<select class="form-control"
onchange="if(this.value) window.open(this.value)">
<option>{{ category.name }}</option>
{% for link in category.links.all %}
{% if link.is_active %}
<!-- 这里可以动态循环 FooterLink 关联的友情链接对象 -->
<option value="{{ link.url }}">{{ link.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{% empty %}
<!-- 如果后台没配置分类,显示默认占位 -->
<div style="width: 280px;">
<select class="form-control">
<option>暂无链接</option>
</select>
</div>
{% endfor %}
</div>
</div>
<!-- 页脚主体信息区域 -->
<div class="footer-info">
<div class="row">
<!-- 左侧:Logo 图标 -->
<div class="col-lg-3 col-md-6 text-center">
<img src="{% static 'images/red.png' %}" alt="政府标识">
<img class="footerImg" src="{% static 'images/jiucuo.png' %}" alt="找错">
</div>
<!-- 中间:文字信息 -->
<div class="col-lg-6 d-none d-xl-block">
<!-- 地址与邮编 -->
<p class="margin-top-20 font-size-14 line-height-2 footerColor">
地址:{{ footer.address }} 邮编:{{ footer.postal }}
</p>
<!-- 电话与传真 -->
<p class="font-size-14 line-height-2 footerColor">
服务热线:{{ footer.telephone }} 传真:{{ footer.fax }}
</p>
</div>
<!-- 右侧:公众号/微博二维码 -->
<div class="col-lg-3 col-md-6 text-center">
<!-- 微信二维码 -->
{% if footer.official_account %}
<img src="{{ footer.official_account.url }}" alt="微信公众号"
style="width: 50px; height: 50px; margin-right: 10px;">
{% else %}
<span>暂无二维码</span>
{% endif %}
<!-- 微博二维码 -->
{% if footer.weibo %}
<img class="footerImg" src="{{ footer.weibo.url }}" alt="政务微博"
style="width: 50px; height: 50px;">
{% else %}
<span>暂无微博</span>
{% endif %}
</div>
</div>
<!-- 版权备案信息 -->
<div class="copyright text-center line-height-2 padding-bottom-20 padding-top-20">
<p class="margin-top-20 font-size-14 line-height-2 footerColor">
版权所有:{{ footer.unit }} 备案证号:
<a href="http://beian.miit.gov.cn/" target="_blank">
{{ footer.filing }}
</a>
</p>
</div>
</div>
</footer>
-10
View File
@@ -1,10 +0,0 @@
{% load static %}
{% for menu in menus %}
<!-- 新闻中心 -->
<li class="{% if menu.code in request.path %}active{% endif %}">
<a href="{% url 'front:section' main=menu.code %}">{{ menu.title }}</a>
</li>
{% endfor %}
+4 -2
View File
@@ -9,8 +9,10 @@
<ol class="breadcrumb" style="background-color: transparent !important; padding-bottom: 0;">
<li class="breadcrumb-item"><a href="/">网站首页</a></li>
<!-- 动态显示所属板块 -->
<li class="breadcrumb-item"><a href="#">{{ article.section.parent.title }}</a></li>
<li class="breadcrumb-item"><a href="#">{{ article.section.title }}</a></li>
<li class="breadcrumb-item"><a href="{% url "front:news_main" %}">{{ article.section.parent.title }}</a>
</li>
<li class="breadcrumb-item"><a
href="{% url "front:news_list" article.section.code %}">{{ article.section.title }}</a></li>
<li class="breadcrumb-item active" aria-current="page">文章详情</li>
</ol>
</nav>
+1 -1
View File
@@ -42,7 +42,7 @@
{% include 'components/_carousel.html' with carousel_id=carousel.key slides=carousel.data height="300px" %}
</div>
<div class="col-md-6 col-sm-12">
{% url "front:news" as more_url %}
{% url "front:news_main" as more_url %}
{% include 'components/_news_card.html' with data=news_data.data unique_id=news_data.key more_url=more_url route="front:news_detail" %}
</div>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="container">
<nav aria-label="breadcrumb" style="margin-left: -10px;">
<ol class="breadcrumb" style="background-color: transparent !important;padding-bottom: 0;">
<li class="breadcrumb-item"><a href="#">网站首页</a></li>
<li class="breadcrumb-item"><a href="/">网站首页</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ main_section.title }}</li>
</ol>
</nav>
+23 -7
View File
@@ -4,17 +4,24 @@
<div class="container">
<nav aria-label="breadcrumb" style="margin-left: -10px;">
<ol class="breadcrumb" style="background-color: transparent !important;padding-bottom: 0;">
<li class="breadcrumb-item"><a href="/">网站首页</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ main_section.title }}</li>
<li class="breadcrumb-item active" aria-current="page">{{ sub_section.title }}</li>
<li class="breadcrumb-item"><a href="/" style="color: #23408A; text-decoration: none;">网站首页</a></li>
<li class="breadcrumb-item active" aria-current="page">
<a href="{% url "front:main_list" main=main_section.code %}"
style="color: #23408A; text-decoration: none;"
>
{{ main_section.title }}
</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
{{ sub_section.title }}
</li>
</ol>
</nav>
<div class="row" style="height: 100%;margin: 15px auto;margin-right: 0 !important;">
<div class="col-3">
<ul class="list-group">
{% if request.path|slice:":6" == '/news/' %}
{% if '/news' in request.path %}
<li class="list-group-item" style="background: #23418A; color: #f5f5f5">
<a href="{% url "front:news" %}"
style="color: #F5F5F5;text-decoration: none;">
@@ -23,7 +30,7 @@
</li>
{% for sec in sections %}
<!-- 核心修改:判断当前路径是否包含该子栏目的 code -->
{% if request.path|slice:":6" == '/news/' and sec.code in request.path %}
{% if '/news' in request.path and sec.code in request.path %}
<li class="list-group-item" style="background: #e9ecef;"> <!-- 选中样式:灰色背景 -->
<a href="{% url "front:news_list" sub=sec.code %}"
style="color: #23418A; text-decoration: none; font-weight: bold;"> {{ sec.title }}</a>
@@ -82,12 +89,21 @@
{% if articles %}
{% for item in articles %}
<li class="news-item">
{% if '/news' in request.path %}
<a href="{% url "front:news_detail" pk=item.id %}"
style="text-decoration: none;color: black;">
{% else %}
<a href="{% url "front:article_detail" pk=item.id %}"
style="text-decoration: none;color: black;">
{% endif %}
<div class="news-title-wrapper">
<span class="bullet-point"></span>
<span class="news-title-text"
title="{{ item.title }}">{{ item.title|truncatechars:30 }}</span>
</div>
<span class="news-date">{{ item.created_at }}</span>
</a>
<span class="news-date">{{ item.created_at|date:"Y-m-d" }}</span>
</li>
{% endfor %}
{% else %}
+1 -1
View File
@@ -15,7 +15,7 @@
{% for section in sections %}
<div class="row" style="margin: auto auto 15px;">
{% url "front:news_list" sub=section.key as more_url %}
{% include 'components/_news_card.html' with data=section.data unique_id=section.key more_url=more_url route="front:news_detail" %}
{% include 'components/_news_card.html' with data=section.data unique_id=section.key more_url=more_url route="front:news_detail" %}
</div>
{% endfor %}
</div>