Files
company_website/templates/solutions/detail.html
T
2026-08-10 22:33:04 +08:00

57 lines
2.4 KiB
HTML

{% extends 'base.html' %}
{% load static i18n i18n_tags %}
{% block breadcrumb %}{% include 'includes/breadcrumb.html' %}{% endblock %}
{% block content %}
<section class="section bg-white py-4">
<div class="container">
{% if solution.cover_image %}
<img src="{{ solution.cover_image.url }}" class="w-100 rounded mb-4" alt="{% ml_field solution 'title' %}" style="height: 350px; object-fit: cover;">
{% endif %}
<h2>{% ml_field solution 'title' %}</h2>
<p class="lead text-secondary">{% ml_field solution 'summary' %}</p>
{% if solution.video_url or solution.video_file %}
<div class="my-4">
<h4>{% trans '方案视频' %}</h4>
<div class="video-container mt-3">
{% if solution.video_file %}
<video controls src="{{ solution.video_file.url }}"></video>
{% elif solution.video_url %}
{% if 'bilibili' in solution.video_url or 'youtube' in solution.video_url %}
<iframe src="{{ solution.video_url }}" allowfullscreen></iframe>
{% else %}
<video controls src="{{ solution.video_url }}"></video>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
<div class="mt-4">
{{ solution.content_zh|safe|default:solution.content_en|safe }}
</div>
{% if related %}
<div class="mt-5">
<h4>{% trans '相关方案' %}</h4>
<div class="row g-4 mt-3">
{% for s in related %}
<div class="col-lg-3 col-md-4 col-6">
<div class="card h-100">
{% if s.cover_image %}<img src="{{ s.cover_image.url }}" class="card-img-top" alt="{% ml_field s 'title' %}" style="height: 160px; object-fit: contain; background: #f7f8fa; padding: 0.5rem;">{% endif %}
<div class="card-body p-3">
<h6 class="card-title small">{% ml_field s 'title' %}</h6>
<a href="{% url 'solution_detail' s.slug %}" class="btn btn-sm btn-outline-primary w-100">{% trans '查看' %}</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</section>
{% endblock %}