Skip to content

Commit

Permalink
Small templates improvements for books and rs
Browse files Browse the repository at this point in the history
  • Loading branch information
daniviga committed Jan 5, 2025
1 parent 206b9ae commit ead9fe6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
27 changes: 18 additions & 9 deletions ram/portal/templates/bookshelf/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,33 @@
<th scope="row">Publication year</th>
<td>{{ book.publication_year|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
{% if book.description %}
<tr>
<th class="w-33" scope="row">Description</th>
<td>{{ book.description | safe }}</td>
</tr>
{% endif %}
</tbody>
</table>
{% if request.user.is_staff %}
<table class="table table-striped">
<thead>
<tr>
<th colspan="2" scope="row">Purchase</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr>
<th scope="row">Purchase date</th>
<th class="w-33" scope="row">Purchase date</th>
<td>{{ book.purchase_date|default:"-" }}</td>
</tr>
<tr>
<th scope="row">Price ({{ site_conf.currency }})</th>
<td>{{ book.price|default:"-" }}</td>
</tr>
{% endif %}
{% if book.description %}
<tr>
<th class="w-33" scope="row">Description</th>
<td>{{ book.description | safe }}</td>
</tr>
{% endif %}
</tbody>
</table>
{% endif %}
{% if properties %}
<table class="table table-striped">
<thead>
Expand Down
29 changes: 19 additions & 10 deletions ram/portal/templates/rollingstock.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<table class="table table-striped">
<thead>
<tr>
<th colspan="2" scope="row">Data</th>
<th colspan="2" scope="row">Rolling stock</th>
</tr>
</thead>
<tbody class="table-group-divider">
Expand Down Expand Up @@ -182,24 +182,33 @@
<th scope="row">Production year</th>
<td>{{ rolling_stock.production_year|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
{% if rolling_stock.description %}
<tr>
<th class="w-33" scope="row">Description</th>
<td>{{ rolling_stock.description | safe }}</td>
</tr>
{% endif %}
</tbody>
</table>
{% if request.user.is_staff %}
<table class="table table-striped">
<thead>
<tr>
<th colspan="2" scope="row">Purchase</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr>
<th scope="row">Purchase date</th>
<th class="w-33" scope="row">Purchase date</th>
<td>{{ rolling_stock.purchase_date|default:"-" }}</td>
</tr>
<tr>
<th scope="row">Price ({{ site_conf.currency }})</th>
<td>{{ rolling_stock.price|default:"-" }}</td>
</tr>
{% endif %}
{% if rolling_stock.description %}
<tr>
<th class="w-33" scope="row">Description</th>
<td>{{ rolling_stock.description | safe }}</td>
</tr>
{% endif %}
</tbody>
</table>
{% endif %}
{% if properties %}
<table class="table table-striped">
<thead>
Expand Down

0 comments on commit ead9fe6

Please sign in to comment.