mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Minor fixes and improvements
This commit is contained in:
@@ -121,6 +121,7 @@ class CatalogAdmin(SortableAdminBase, admin.ModelAdmin):
|
|||||||
BookDocInline,
|
BookDocInline,
|
||||||
)
|
)
|
||||||
list_display = (
|
list_display = (
|
||||||
|
"__str__",
|
||||||
"manufacturer",
|
"manufacturer",
|
||||||
"years",
|
"years",
|
||||||
"get_scales",
|
"get_scales",
|
||||||
|
@@ -46,10 +46,12 @@
|
|||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
<nav class="nav nav-tabs d-none d-lg-flex flex-row mb-2" id="nav-tab" role="tablist">
|
<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>
|
<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 documents %}<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 book.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 book.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>
|
</nav>
|
||||||
<select class="form-select d-lg-none mb-2" id="tabSelector" aria-label="Tab selector">
|
<select class="form-select d-lg-none mb-2" id="tabSelector" aria-label="Tab selector">
|
||||||
<option value="nav-summary" selected>Summary</option>
|
<option value="nav-summary" selected>Summary</option>
|
||||||
|
{% if documents %}<option value="nav-documents">Documents</option>{% endif %}
|
||||||
{% if book.notes %}<option value="nav-notes">Notes</option>{% endif %}
|
{% if book.notes %}<option value="nav-notes">Notes</option>{% endif %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tab-content" id="nav-tabContent">
|
<div class="tab-content" id="nav-tabContent">
|
||||||
@@ -131,6 +133,24 @@
|
|||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane" 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 class="table-group-divider">
|
||||||
|
{% for d in documents.all %}
|
||||||
|
<tr>
|
||||||
|
<td class="w-33">{{ 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" id="nav-notes" role="tabpanel" aria-labelledby="nav-notes-tab">
|
<div class="tab-pane" id="nav-notes" role="tabpanel" aria-labelledby="nav-notes-tab">
|
||||||
{{ book.notes | safe }}
|
{{ book.notes | safe }}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -549,14 +549,16 @@ class GetBookCatalog(View):
|
|||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
book_properties = book.property.get_public(request.user)
|
properties = book.property.get_public(request.user)
|
||||||
|
documents = book.document.get_public(request.user)
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"bookshelf/book.html",
|
"bookshelf/book.html",
|
||||||
{
|
{
|
||||||
"title": book,
|
"title": book,
|
||||||
"book_properties": book_properties,
|
|
||||||
"book": book,
|
"book": book,
|
||||||
|
"documents": documents,
|
||||||
|
"properties": properties,
|
||||||
"type": selector
|
"type": selector
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
from ram.utils import git_suffix
|
from ram.utils import git_suffix
|
||||||
|
|
||||||
__version__ = "0.14.0"
|
__version__ = "0.14.1"
|
||||||
__version__ += git_suffix(__file__)
|
__version__ += git_suffix(__file__)
|
||||||
|
Reference in New Issue
Block a user