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