update. 完善基础信息配置以及页面链接处理
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user