mirror of
https://github.com/daniviga/django-ram.git
synced 2025-12-26 07:18:32 +01:00
More fixes to lables
This commit is contained in:
@@ -49,3 +49,5 @@ class CatalogSerializer(serializers.ModelSerializer):
|
||||
"price",
|
||||
)
|
||||
read_only_fields = ("creation_time", "updated_time")
|
||||
|
||||
# FIXME: add Magazine and MagazineIssue serializers
|
||||
|
||||
@@ -38,3 +38,5 @@ class CatalogGet(RetrieveAPIView):
|
||||
|
||||
def get_queryset(self):
|
||||
return Book.objects.get_published(self.request.user)
|
||||
|
||||
# FIXME: add Magazine and MagazineIssue views
|
||||
|
||||
@@ -61,8 +61,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="row">
|
||||
{% if type == "catalog" %}Catalog
|
||||
{% elif type == "book" %}Book{% endif %}
|
||||
{{ label|capfirst }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="row">
|
||||
{{ d.type | capfirst }}
|
||||
{{ d.label|capfirst }}
|
||||
<div class="float-end">
|
||||
{% if not d.item.published %}
|
||||
<span class="badge text-bg-warning">Unpublished</span>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="row">
|
||||
{{ d.type | capfirst }}
|
||||
{{ d.label|capfirst }}
|
||||
<div class="float-end">
|
||||
{% if not d.item.published %}
|
||||
<span class="badge text-bg-warning">Unpublished</span>
|
||||
|
||||
@@ -77,7 +77,11 @@ class GetData(View):
|
||||
self.filter = filter
|
||||
data = []
|
||||
for item in self.get_data(request):
|
||||
data.append({"type": self.item_type, "item": item})
|
||||
data.append({
|
||||
"type": self.item_type,
|
||||
"label": self.item_type.capitalize(),
|
||||
"item": item
|
||||
})
|
||||
|
||||
paginator = Paginator(data, get_items_per_page())
|
||||
data = paginator.get_page(page)
|
||||
@@ -669,6 +673,7 @@ class GetMagazine(View):
|
||||
data = [
|
||||
{
|
||||
"type": "magazineissue",
|
||||
"label": "Magazine issue",
|
||||
"item": i,
|
||||
}
|
||||
for i in magazine.issue.get_published(request.user).all()
|
||||
@@ -742,6 +747,7 @@ class GetBookCatalog(View):
|
||||
"documents": documents,
|
||||
"properties": properties,
|
||||
"type": selector,
|
||||
"label": selector.capitalize(),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from ram.utils import git_suffix
|
||||
|
||||
__version__ = "0.18.2"
|
||||
__version__ = "0.18.3"
|
||||
__version__ += git_suffix(__file__)
|
||||
|
||||
Reference in New Issue
Block a user