first commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{% 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: 140px; object-fit: cover;">{% 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 %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{% 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">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 mb-4 mb-lg-0">
|
||||
<div class="card p-3">
|
||||
<h6 class="mb-3">{% trans '方案分类' %}</h6>
|
||||
<div class="list-group list-group-flush">
|
||||
<a href="{% url 'solution_list' %}" class="list-group-item list-group-item-action {% if not current_category %}active{% endif %} border-0 px-0">{% trans '全部方案' %}</a>
|
||||
{% for cat in categories %}
|
||||
<a href="?category={{ cat.slug }}" class="list-group-item list-group-item-action {% if current_category == cat.slug %}active{% endif %} border-0 px-0">{% ml_field cat 'name' %}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9">
|
||||
<div class="row g-4">
|
||||
{% for solution in page_obj %}
|
||||
<div class="col-lg-6">
|
||||
<div class="card h-100">
|
||||
{% if solution.cover_image %}
|
||||
<img src="{{ solution.cover_image.url }}" class="card-img-top" alt="{% ml_field solution 'title' %}" style="height: 220px; object-fit: cover;">
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{% ml_field solution 'title' %}</h5>
|
||||
<p class="card-text text-secondary">{% ml_field solution 'summary' %}</p>
|
||||
<a href="{% url 'solution_detail' solution.slug %}" class="btn btn-outline-primary">{% trans '查看详情' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-12 text-center py-5 text-secondary">{% trans '暂无方案数据' %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% include 'includes/pagination.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user