update. 完成前端页面展示、列表和详情页

update. 调整融合主菜单与板块
update. 分离新闻模块
This commit is contained in:
ngfchl
2026-04-01 14:17:03 +08:00
parent af9d7a676f
commit 777ca50328
55 changed files with 2190 additions and 567 deletions
+7 -2
View File
@@ -47,12 +47,17 @@
{% if items %}
{% for item in items %}
<li class="news-item">
<a href="{% url "front:article_detail" pk=item.id %}"
style="text-decoration: none;color: black;">
<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.date }}</span>
</a>
<span class="news-date">{{ item.created_at | date:"Y-m-d" }}</span>
</li>
{% endfor %}
{% else %}
@@ -63,4 +68,4 @@
{% endfor %}
</div>
</div>
</div>
+95
View File
@@ -0,0 +1,95 @@
{% 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>
+9
View File
@@ -0,0 +1,9 @@
{% load static %}
{% for menu in menus %}
<!-- 新闻中心 -->
<li class="{% if request.resolver_match.kwargs.url == menu.url %}active{% endif %}">
<a href="{% url 'front:menu' main=menu.code %}">{{ menu.title }}</a>
</li>
{% endfor %}