Add shop as a fixed property (#49)

* Add shop field (from properties)

* Update template

* Implement description in BaseModel and then consist

* Make notes internal only

* Fix a merge issue
This commit is contained in:
2025-01-27 23:16:52 +01:00
committed by GitHub
parent d16e00d66b
commit b10e1f3952
12 changed files with 52 additions and 36 deletions

View File

@@ -68,11 +68,9 @@
<div class="mx-auto">
<nav class="nav nav-tabs d-none d-lg-flex flex-row mb-2" 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 %}
</nav>
<select class="form-select d-lg-none mb-2" id="tabSelector" aria-label="Tab selector">
<option value="nav-summary" selected>Summary</option>
{% if consist.notes %}<option value="nav-notes">Notes</option>{% endif %}
</select>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane show active" id="nav-summary" role="tabpanel" aria-labelledby="nav-summary-tab">
@@ -103,6 +101,12 @@
<th scope="row">Era</th>
<td>{{ consist.era }}</td>
</tr>
{% if consist.description %}
<tr>
<th scope="row">Description</th>
<td>{{ consist.description | safe }}</td>
</tr>
{% endif %}
<tr>
<th scope="row">Length</th>
<td>{{ data | length }}</td>
@@ -110,20 +114,6 @@
</tbody>
</table>
</div>
<div class="tab-pane" id="nav-notes" role="tabpanel" aria-labelledby="nav-notes-tab">
<table class="table">
<thead>
<tr>
<th scope="row">Notes</th>
</tr>
</thead>
<tbody class="table-group-divider">
<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 %}