mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 05:07:50 +02:00
71 lines
3.0 KiB
HTML
71 lines
3.0 KiB
HTML
<div class="col">
|
|
<div class="card shadow-sm">
|
|
<a href="{{ d.item.get_absolute_url }}">
|
|
{% if d.item.image %}
|
|
<img class="card-img-top" src="{{ d.item.image.url }}" alt="{{ d.item }}">
|
|
{% else %}
|
|
{% with d.item.consist_item.first.rolling_stock as r %}
|
|
<img class="card-img-top" src="{{ r.image.first.image.url }}" alt="{{ d.item }}">
|
|
{% endwith %}
|
|
{% endif %}
|
|
</a>
|
|
<div class="card-body">
|
|
<p class="card-text" style="position: relative;">
|
|
<strong>{{ d.item }}</strong>
|
|
<a class="stretched-link" href="{{ d.item.get_absolute_url }}"></a>
|
|
</p>
|
|
{% if d.item.tags.all %}
|
|
<p class="card-text"><small>Tags:</small>
|
|
{% for t in d.item.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 %}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">
|
|
Consist
|
|
<div class="float-end">
|
|
{% if d.item.company.freelance %}
|
|
<span class="badge text-bg-secondary">Freelance</span>
|
|
{% endif %}
|
|
{% if not d.item.published %}
|
|
<span class="badge text-bg-warning">Draft</span>
|
|
{% endif %}
|
|
</div>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="table-group-divider">
|
|
{% if d.item.address %}
|
|
<tr>
|
|
<th class="w-33" scope="row">Address</th>
|
|
<td>{{ d.item.address }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr>
|
|
<th class="w-33" scope="row">Company</th>
|
|
<td>
|
|
<img src="{{ d.item.company.country.flag }}" alt="{{ d.item.company.country }}">
|
|
<abbr title="{{ d.item.company.extended_name }}">{{ d.item.company }}</abbr>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Era</th>
|
|
<td>{{ d.item.era }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Length</th>
|
|
<td>{{ d.item.length }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="d-grid gap-2 mb-1 d-md-block">
|
|
<a class="btn btn-sm btn-outline-primary" href="{{ d.item.get_absolute_url }}">Show all data</a>
|
|
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:consist_consist_change' d.item.pk %}">Edit</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|