mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Major templates and views refactoring
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{% extends "cards.html" %}
|
||||
|
||||
{% block cards %}
|
||||
{% for m in manufacturers %}
|
||||
{% for d in data %}
|
||||
<div class="col">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<p class="card-text" style="position: relative;">
|
||||
<strong>{{ m.name }}</strong>
|
||||
<strong>{{ d.name }}</strong>
|
||||
</p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -15,27 +15,27 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if m.logo %}
|
||||
{% if d.logo %}
|
||||
<tr>
|
||||
<th width="35%" scope="row">Logo</th>
|
||||
<td><img style="max-height: 48px" src="{{ m.logo.url }}" /></td>
|
||||
<td><img style="max-height: 48px" src="{{ d.logo.url }}" /></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if m.website %}
|
||||
{% if d.website %}
|
||||
<tr>
|
||||
<th width="35%" scope="row">Website</th>
|
||||
<td><a href="{{ m.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a></td>
|
||||
<td><a href="{{ d.website }}" target="_blank"><i class="bi bi-box-arrow-up-right"></i></a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th width="35%" scope="row">Category</th>
|
||||
<td>{{ m.category | title }}</td>
|
||||
<td>{{ d.category | title }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-grid gap-2 mb-1 d-md-block">
|
||||
<a class="btn btn-sm btn-outline-primary" href="{% url 'filtered' _filter="manufacturer" search=m.safe_name %}">Show all rolling stock</a>
|
||||
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:metadata_manufacturer_change' m.pk %}">Edit</a>{% endif %}
|
||||
<a class="btn btn-sm btn-outline-primary" href="{% url 'filtered' _filter="manufacturer" search=d.safe_name %}">Show all rolling stock</a>
|
||||
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:metadata_manufacturer_change' d.pk %}">Edit</a>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user