Compare commits

..

9 Commits

7 changed files with 7 additions and 17 deletions

View File

@@ -49,5 +49,3 @@ class CatalogSerializer(serializers.ModelSerializer):
"price",
)
read_only_fields = ("creation_time", "updated_time")
# FIXME: add Magazine and MagazineIssue serializers

View File

@@ -38,5 +38,3 @@ class CatalogGet(RetrieveAPIView):
def get_queryset(self):
return Book.objects.get_published(self.request.user)
# FIXME: add Magazine and MagazineIssue views

View File

@@ -61,7 +61,8 @@
<thead>
<tr>
<th colspan="2" scope="row">
{{ label|capfirst }}
{% if type == "catalog" %}Catalog
{% elif type == "book" %}Book{% endif %}
</th>
</tr>
</thead>

View File

@@ -24,7 +24,7 @@
<thead>
<tr>
<th colspan="2" scope="row">
{{ d.label|capfirst }}
{{ d.type | capfirst }}
<div class="float-end">
{% if not d.item.published %}
<span class="badge text-bg-warning">Unpublished</span>

View File

@@ -1,5 +1,4 @@
{% load static %}
{% load dynamic_url %}
<div class="col">
<div class="card shadow-sm">
{% if d.type == "magazine" %}
@@ -42,7 +41,7 @@
<thead>
<tr>
<th colspan="2" scope="row">
{{ d.label|capfirst }}
{{ d.type | capfirst }}
<div class="float-end">
{% if not d.item.published %}
<span class="badge text-bg-warning">Unpublished</span>
@@ -91,7 +90,7 @@
{% else %}
<a class="btn btn-sm btn-outline-primary" href="{{ d.item.get_absolute_url }}">Show all data</a>
{% endif %}
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% dynamic_admin_url 'bookshelf' d.type d.item.pk %}">Edit</a>{% endif %}
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:bookshelf_magazineissue_change' d.item.pk %}">Edit</a>{% endif %}
</div>
</div>
</div>

View File

@@ -77,11 +77,7 @@ class GetData(View):
self.filter = filter
data = []
for item in self.get_data(request):
data.append({
"type": self.item_type,
"label": self.item_type.capitalize(),
"item": item
})
data.append({"type": self.item_type, "item": item})
paginator = Paginator(data, get_items_per_page())
data = paginator.get_page(page)
@@ -673,7 +669,6 @@ class GetMagazine(View):
data = [
{
"type": "magazineissue",
"label": "Magazine issue",
"item": i,
}
for i in magazine.issue.get_published(request.user).all()
@@ -747,7 +742,6 @@ class GetBookCatalog(View):
"documents": documents,
"properties": properties,
"type": selector,
"label": selector.capitalize(),
},
)

View File

@@ -1,4 +1,4 @@
from ram.utils import git_suffix
__version__ = "0.18.3"
__version__ = "0.18.1"
__version__ += git_suffix(__file__)