mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 05:07:50 +02:00
329 lines
16 KiB
HTML
329 lines
16 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block header %}
|
|
{% if rolling_stock.tags.all %}
|
|
<p><small>Tags:</small>
|
|
{% for t in rolling_stock.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>
|
|
{% endif %}
|
|
<small class="text-muted">Updated {{ rolling_stock.updated_time | date:"M d, Y H:i" }}</small>
|
|
{% endblock %}
|
|
{% block carousel %}
|
|
<div class="row">
|
|
<div id="carouselControls" class="carousel carousel-dark slide" data-bs-ride="carousel" data-bs-interval="10000">
|
|
<div class="carousel-inner">
|
|
{% for t in rolling_stock.image.all %}
|
|
{% if forloop.first %}
|
|
<div class="carousel-item active">
|
|
{% else %}
|
|
<div class="carousel-item">
|
|
{% endif %}
|
|
<img src="{{ t.image.url }}" class="d-block w-100 rounded img-thumbnail" alt="...">
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% if rolling_stock.image.count > 1 %}
|
|
<button class="carousel-control-prev" type="button" data-bs-target="#carouselControls" data-bs-slide="prev">
|
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
|
<span class="visually-hidden">Previous</span>
|
|
</button>
|
|
<button class="carousel-control-next" type="button" data-bs-target="#carouselControls" data-bs-slide="next">
|
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
|
<span class="visually-hidden">Next</span>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block cards %}
|
|
{% 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>
|
|
<button class="nav-link" id="nav-model-tab" data-bs-toggle="tab" data-bs-target="#nav-model" type="button" role="tab" aria-controls="nav-model" aria-selected="false">Model data</button>
|
|
<button class="nav-link" id="nav-class-tab" data-bs-toggle="tab" data-bs-target="#nav-class" type="button" role="tab" aria-controls="nav-class" aria-selected="false">Class data</button>
|
|
{% if rolling_stock.decoder %}<button class="nav-link" id="nav-dcc-tab" data-bs-toggle="tab" data-bs-target="#nav-dcc" type="button" role="tab" aria-controls="nav-dcc" aria-selected="false">DCC</button>{% endif %}
|
|
{% if rolling_stock.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 %}
|
|
{% if rolling_stock.document.count > 0 %}<button class="nav-link" id="nav-documents-tab" data-bs-toggle="tab" data-bs-target="#nav-documents" type="button" role="tab" aria-controls="nav-documents" aria-selected="false">Documents</button>{% endif %}
|
|
{% if rolling_stock_journal.count > 0 %}<button class="nav-link" id="nav-journal-tab" data-bs-toggle="tab" data-bs-target="#nav-journal" type="button" role="tab" aria-controls="nav-journal" aria-selected="false">Journal</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">Type</th>
|
|
<td>{{ rolling_stock.rolling_class.type }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Company</th>
|
|
<td>
|
|
<a href="{% url 'filtered' _filter="company" search=rolling_stock.rolling_class.company %}"><abbr title="{{ rolling_stock.rolling_class.company.extended_name }}">{{ rolling_stock.rolling_class.company }}</abbr></a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Class</th>
|
|
<td>{{ rolling_stock.rolling_class.identifier }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Road number</th>
|
|
<td>{{ rolling_stock.road_number }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Era</th>
|
|
<td>{{ rolling_stock.era }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Model data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th width="35%" scope="row">Manufacturer</th>
|
|
<td>{{ rolling_stock.manufacturer|default_if_none:"" }}{% if rolling_stock.manufacturer.website %} <a href="{{ rolling_stock.manufacturer.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>{% endif %}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Scale</th>
|
|
<td><a href="{% url 'filtered' _filter="scale" search=rolling_stock.scale %}"><abbr title="{{ rolling_stock.scale.ratio }} - {{ rolling_stock.scale.tracks }}">{{ rolling_stock.scale }}</abbr></a></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">SKU</th>
|
|
<td>{{ rolling_stock.sku }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
{% if rolling_stock.decoder or rolling_stock.decoder_interface %}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">DCC data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th width="35%" scope="row">Interface</th>
|
|
<td>{{ rolling_stock.get_decoder_interface_display }}</td>
|
|
</tr>
|
|
{% if rolling_stock.decoder %}
|
|
<tr>
|
|
<th scope="row">Decoder</th>
|
|
<td>{{ rolling_stock.decoder }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Address</th>
|
|
<td>{{ rolling_stock.address }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-model" role="tabpanel" aria-labelledby="nav-model-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Model data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th width="35%" scope="row">Manufacturer</th>
|
|
<td>{{ rolling_stock.manufacturer|default_if_none:"" }}{% if rolling_stock.manufacturer.website %} <a href="{{ rolling_stock.manufacturer.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a>{% endif %}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Scale</th>
|
|
<td><abbr title="{{ rolling_stock.scale.ratio }} - {{ rolling_stock.scale.tracks }}">{{ rolling_stock.scale }}</abbr></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">SKU</th>
|
|
<td>{{ rolling_stock.sku }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Era</th>
|
|
<td>{{ rolling_stock.era }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Production year</th>
|
|
<td>{{ rolling_stock.production_year | default_if_none:"" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Purchase date</th>
|
|
<td>{{ rolling_stock.purchase_date | default_if_none:"" }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
{% if rolling_stock_properties %}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Properties</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in rolling_stock_properties %}
|
|
<tr>
|
|
<th width="35%" scope="row">{{ p.property }}</th>
|
|
<td>{{ p.value }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-class" role="tabpanel" aria-labelledby="nav-class-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Class data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th width="35%" scope="row">Class</th>
|
|
<td>{{ rolling_stock.rolling_class.identifier }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Type</th>
|
|
<td>{{ rolling_stock.rolling_class.type }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Company</th>
|
|
<td>{{ rolling_stock.rolling_class.company }} ({{ rolling_stock.rolling_class.company.extended_name }})</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Country</th>
|
|
<td>{{ rolling_stock.rolling_class.company.country.name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Manufacturer</th>
|
|
<td>{{ rolling_stock.rolling_class.manufacturer|default_if_none:"" }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
{% if class_properties %}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Properties</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in class_properties %}
|
|
<tr>
|
|
<th width="35%" scope="row">{{ p.property }}</th>
|
|
<td>{{ p.value }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-dcc" role="tabpanel" aria-labelledby="nav-dcc-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">DCC data</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th scope="row">Interface</th>
|
|
<td>{{ rolling_stock.get_decoder_interface_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th width="35%" scope="row">Address</th>
|
|
<td>{{ rolling_stock.address }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Name</th>
|
|
<td>{{ rolling_stock.decoder.name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Manufacturer</th>
|
|
<td>{{ rolling_stock.decoder.manufacturer|default_if_none:"" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Version</th>
|
|
<td>{{ rolling_stock.decoder.version }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Sound</th>
|
|
<td>{{ rolling_stock.decoder.sound | yesno:"Yes,No" }}</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>{{ rolling_stock.notes | safe }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-documents" role="tabpanel" aria-labelledby="nav-documents-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="3" scope="row">Documents</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for d in rolling_stock.document.all %}
|
|
<tr>
|
|
<td>{{ d.description }}</td>
|
|
<td><a href="{{ d.file.url }}" target="_blank">{{ d.filename }}</a></td>
|
|
<td class="text-end">{{ d.file.size | filesizeformat }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="tab-pane fade" id="nav-journal" role="tabpanel" aria-labelledby="nav-journal-tab">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="3" scope="row">Journal</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for j in rolling_stock_journal %}
|
|
<tr>
|
|
<th width="35%" scope="row">{{ j.date }}</th>
|
|
<td>{{ j.log | safe }}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</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:roster_rollingstock_change' rolling_stock.pk %}">Edit</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|