mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 05:07:50 +02:00
121 lines
5.0 KiB
HTML
121 lines
5.0 KiB
HTML
{% extends "cards.html" %}
|
|
|
|
{% block header %}
|
|
{% if consist.tags.all %}
|
|
<p><small>Tags:</small>
|
|
{% for t in consist.tags.all %}<a href="{% url 'filtered' _filter="tag" search=t.slug %}" class="badge rounded-pill bg-primary">
|
|
{{ t.name }}</a>{# new line is required #}
|
|
{% endfor %}
|
|
</p>
|
|
<small class="text-muted">Updated {{ consist.updated_time | date:"M d, Y H:i" }}</small>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block carousel %}
|
|
{% if consist.image %}
|
|
<div class="row pb-4">
|
|
<div id="carouselControls" class="carousel carousel-dark slide" data-bs-ride="carousel">
|
|
<div class="carousel-inner">
|
|
<div class="carousel-item active">
|
|
<img src="{{ consist.image.url }}" class="d-block w-100 rounded img-thumbnail" alt="...">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block pagination %}
|
|
{% if data.has_other_pages %}
|
|
<nav aria-label="Page navigation example">
|
|
<ul class="pagination justify-content-center mt-4 mb-0">
|
|
{% if data.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="{% url 'consist_pagination' uuid=consist.uuid page=data.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled">
|
|
<span class="page-link">Previous</span>
|
|
</li>
|
|
{% endif %}
|
|
{% for i in page_range %}
|
|
{% if data.number == i %}
|
|
<li class="page-item active">
|
|
<span class="page-link">{{ i }}</span></span>
|
|
</li>
|
|
{% else %}
|
|
{% if i == data.paginator.ELLIPSIS %}
|
|
<li class="page-item"><span class="page-link">{{ i }}</span></li>
|
|
{% else %}
|
|
<li class="page-item"><a class="page-link" href="{% url 'consist_pagination' uuid=consist.uuid page=i %}#rolling-stock">{{ i }}</a></li>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if data.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="{% url 'consist_pagination' uuid=consist.uuid page=data.next_page_number %}#rolling-stock" tabindex="-1">Next</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled">
|
|
<span class="page-link">Next</span>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block extra_content %}
|
|
<section class="py-4 text-start container">
|
|
<div class="row">
|
|
<div class="mx-auto">
|
|
<nav>
|
|
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
|
<button class="nav-link active" id="nav-summary-tab" data-bs-toggle="tab" data-bs-target="#nav-summary" type="button" role="tab" aria-controls="nav-summary" aria-selected="true">Summary</button>
|
|
{% if consist.notes %}<button class="nav-link" id="nav-notes-tab" data-bs-toggle="tab" data-bs-target="#nav-notes" type="button" role="tab" aria-controls="nav-notes" aria-selected="false">Notes</button>{% endif %}
|
|
</div>
|
|
</nav>
|
|
<div class="tab-content" id="nav-tabContent">
|
|
<div class="tab-pane fade show active" id="nav-summary" role="tabpanel" aria-labelledby="nav-summary-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th width="35%" scope="row">Company</th>
|
|
<td><abbr title="{{ consist.company.extended_name }}">{{ consist.company }}</abbr></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Era</th>
|
|
<td>{{ consist.era }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Length</th>
|
|
<td>{{ data | length }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-notes" role="tabpanel" aria-labelledby="nav-notes-tab">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="row">Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{{ consist.notes | safe }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
|
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:consist_consist_change' consist.pk %}">Edit</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|