删除部分页面
This commit is contained in:
@@ -4,5 +4,4 @@ from . import views
|
||||
urlpatterns = [
|
||||
path('', views.home, name='home'),
|
||||
path('about/', views.about, name='about'),
|
||||
path('history/', views.history, name='history'),
|
||||
]
|
||||
|
||||
+1
-17
@@ -1,33 +1,17 @@
|
||||
from django.shortcuts import render
|
||||
from .models import Banner
|
||||
from apps.products.models import Product
|
||||
from apps.news.models import News
|
||||
|
||||
|
||||
def home(request):
|
||||
banners = Banner.objects.filter(is_active=True)
|
||||
featured_products = Product.objects.filter(is_active=True, is_featured=True)[:6]
|
||||
latest_news = News.objects.filter(is_active=True)[:4]
|
||||
return render(request, 'core/home.html', {
|
||||
'banners': banners,
|
||||
'featured_products': featured_products,
|
||||
'latest_news': latest_news,
|
||||
})
|
||||
|
||||
|
||||
def about(request):
|
||||
breadcrumb_items = [{'name': '关于我们', 'url': ''}, {'name': '公司简介', 'url': ''}]
|
||||
breadcrumb_items = [{'name': '关于我们', 'url': ''}]
|
||||
return render(request, 'core/about.html', {'breadcrumb_items': breadcrumb_items})
|
||||
|
||||
|
||||
def history(request):
|
||||
milestones = [
|
||||
('2015', '公司成立', 'TGOIM 正式成立,开始工业自动化领域的探索'),
|
||||
('2017', '首款产品发布', '推出首款伺服驱动器产品,获得市场认可'),
|
||||
('2019', '业务扩展', '产品线扩展至运动控制全系列,客户遍布全国'),
|
||||
('2021', '技术突破', '自主研发高性能控制算法,技术实力行业领先'),
|
||||
('2023', '智能制造升级', '推出智能制造整体解决方案,服务500+企业客户'),
|
||||
('2025', '持续创新', '持续投入研发,致力于成为行业标杆企业'),
|
||||
]
|
||||
breadcrumb_items = [{'name': '关于我们', 'url': ''}, {'name': '发展历程', 'url': ''}]
|
||||
return render(request, 'core/history.html', {'breadcrumb_items': breadcrumb_items, 'milestones': milestones})
|
||||
|
||||
@@ -70,7 +70,7 @@ a:hover { color: var(--primary-dark); }
|
||||
.section-title h2 { margin-bottom: 0.75rem; }
|
||||
.section-title p { color: var(--text-secondary); margin-bottom: 0; }
|
||||
|
||||
.banner-carousel .carousel-item { height: 500px; background: #000; }
|
||||
.banner-carousel .carousel-item { height: 650px; background: #000; }
|
||||
.banner-carousel .carousel-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
|
||||
.banner-carousel .carousel-caption { bottom: 25%; text-align: left; }
|
||||
.banner-carousel .carousel-caption h1 { font-size: 2.5rem; margin-bottom: 1rem; }
|
||||
@@ -261,13 +261,13 @@ a:hover { color: var(--primary-dark); }
|
||||
.contact-form textarea.form-control { resize: vertical; min-height: 120px; }
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.banner-carousel .carousel-item { height: 380px; }
|
||||
.banner-carousel .carousel-item { height: 480px; }
|
||||
.banner-carousel .carousel-caption h1 { font-size: 1.75rem; }
|
||||
.section { padding: 2.5rem 0; }
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.banner-carousel .carousel-item { height: 300px; }
|
||||
.banner-carousel .carousel-item { height: 380px; }
|
||||
.banner-carousel .carousel-caption { bottom: 20%; text-align: center; left: 10%; right: 10%; }
|
||||
.banner-carousel .carousel-caption h1 { font-size: 1.25rem; }
|
||||
.banner-carousel .carousel-caption p { font-size: 0.875rem; margin-bottom: 1rem; }
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static i18n i18n_tags %}
|
||||
|
||||
{% block breadcrumb %}{% include 'includes/breadcrumb.html' %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section bg-white py-5">
|
||||
<div class="container">
|
||||
<div class="section-title">
|
||||
<h2>{% trans '发展历程' %}</h2>
|
||||
<p>{% trans '见证我们的成长与里程碑' %}</p>
|
||||
</div>
|
||||
<div class="position-relative">
|
||||
<div class="position-absolute top-0 bottom-0 start-50 translate-middle-x border-start border-primary" style="width: 2px;"></div>
|
||||
{% for year, title, desc in milestones %}
|
||||
<div class="row mb-5">
|
||||
<div class="col-md-6 {% if forloop.counter|divisibleby:2 %}offset-md-6{% endif %}">
|
||||
<div class="card p-4">
|
||||
<span class="badge bg-primary w-auto mb-2">{{ year }}</span>
|
||||
<h5>{{ title }}</h5>
|
||||
<p class="text-secondary mb-0">{{ desc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -63,70 +63,4 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="section-title">
|
||||
<h2>{% trans '解决方案' %}</h2>
|
||||
<p>{% trans '专业的行业解决方案,助力企业发展' %}</p>
|
||||
</div>
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-4 col-md-6">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3"><i class="fa fa-cogs fa-3x" style="color: var(--primary);"></i></div>
|
||||
<h5>{% trans '智能制造' %}</h5>
|
||||
<p class="text-secondary">{% trans '提供完整的智能制造解决方案,提升生产效率' %}</p>
|
||||
<a href="{% url 'solution_list' %}" class="btn btn-outline-primary">{% trans '了解更多' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3"><i class="fa fa-cloud fa-3x" style="color: var(--primary);"></i></div>
|
||||
<h5>{% trans '工业互联网' %}</h5>
|
||||
<p class="text-secondary">{% trans '打造工业互联网平台,实现设备互联互通' %}</p>
|
||||
<a href="{% url 'solution_list' %}" class="btn btn-outline-primary">{% trans '了解更多' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3"><i class="fa fa-line-chart fa-3x" style="color: var(--primary);"></i></div>
|
||||
<h5>{% trans '数据服务' %}</h5>
|
||||
<p class="text-secondary">{% trans '数据采集与分析,为决策提供数据支撑' %}</p>
|
||||
<a href="{% url 'solution_list' %}" class="btn btn-outline-primary">{% trans '了解更多' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section bg-white">
|
||||
<div class="container">
|
||||
<div class="section-title">
|
||||
<h2>{% trans '新闻资讯' %}</h2>
|
||||
<p>{% trans '了解公司动态与行业资讯' %}</p>
|
||||
</div>
|
||||
{% if latest_news %}
|
||||
<div class="row g-4">
|
||||
{% for news in latest_news %}
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="card h-100">
|
||||
{% if news.cover_image %}
|
||||
<img src="{{ news.cover_image.url }}" class="card-img-top" alt="{% ml_field news 'title' %}" style="height: 160px; object-fit: cover;">
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<span class="badge bg-light text-primary mb-2">{{ news.category.name_zh }}</span>
|
||||
<h6 class="card-title">{% ml_field news 'title' %}</h6>
|
||||
<p class="card-text text-secondary small">{% ml_field news 'summary' %}</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<small class="text-muted">{{ news.created_at|date:"Y-m-d" }}</small>
|
||||
<a href="{% url 'news_detail' news.slug %}" class="small">{% trans '阅读' %} →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@@ -16,25 +16,15 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if request.resolver_match.url_name == 'home' %}active{% endif %}" href="{% url 'home' %}">{% trans '首页' %}</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">{% trans '关于我们' %}</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="{% url 'about' %}">{% trans '公司简介' %}</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'history' %}">{% trans '发展历程' %}</a></li>
|
||||
</ul>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if request.resolver_match.url_name == 'about' %}active{% endif %}" href="{% url 'about' %}">{% trans '关于我们' %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if '/products/' in request.path %}active{% endif %}" href="{% url 'product_list' %}">{% trans '产品中心' %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if '/solutions/' in request.path %}active{% endif %}" href="{% url 'solution_list' %}">{% trans '解决方案' %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if '/customers/' in request.path %}active{% endif %}" href="{% url 'customer_map' %}">{% trans '客户案例' %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if '/news/' in request.path %}active{% endif %}" href="{% url 'news_list' %}">{% trans '新闻中心' %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if '/contact/' in request.path %}active{% endif %}" href="{% url 'contact' %}">{% trans '联系我们' %}</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user