diff --git a/ram/bookshelf/serializers.py b/ram/bookshelf/serializers.py index 1aaf59a..3718d97 100644 --- a/ram/bookshelf/serializers.py +++ b/ram/bookshelf/serializers.py @@ -49,3 +49,5 @@ class CatalogSerializer(serializers.ModelSerializer): "price", ) read_only_fields = ("creation_time", "updated_time") + +# FIXME: add Magazine and MagazineIssue serializers diff --git a/ram/bookshelf/views.py b/ram/bookshelf/views.py index 06168b3..7da3bd8 100644 --- a/ram/bookshelf/views.py +++ b/ram/bookshelf/views.py @@ -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 diff --git a/ram/portal/templates/bookshelf/book.html b/ram/portal/templates/bookshelf/book.html index 34c66d1..dc08c31 100644 --- a/ram/portal/templates/bookshelf/book.html +++ b/ram/portal/templates/bookshelf/book.html @@ -61,8 +61,7 @@ - {% if type == "catalog" %}Catalog - {% elif type == "book" %}Book{% endif %} + {{ label|capfirst }} diff --git a/ram/portal/templates/cards/book.html b/ram/portal/templates/cards/book.html index 5110276..03c1927 100644 --- a/ram/portal/templates/cards/book.html +++ b/ram/portal/templates/cards/book.html @@ -24,7 +24,7 @@ - {{ d.type | capfirst }} + {{ d.label|capfirst }}
{% if not d.item.published %} Unpublished diff --git a/ram/portal/templates/cards/magazine.html b/ram/portal/templates/cards/magazine.html index 41b65c2..291485c 100644 --- a/ram/portal/templates/cards/magazine.html +++ b/ram/portal/templates/cards/magazine.html @@ -42,7 +42,7 @@ - {{ d.type | capfirst }} + {{ d.label|capfirst }}
{% if not d.item.published %} Unpublished diff --git a/ram/portal/views.py b/ram/portal/views.py index 8141761..25006ad 100644 --- a/ram/portal/views.py +++ b/ram/portal/views.py @@ -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(), }, ) diff --git a/ram/ram/__init__.py b/ram/ram/__init__.py index 5eb46df..bf43356 100644 --- a/ram/ram/__init__.py +++ b/ram/ram/__init__.py @@ -1,4 +1,4 @@ from ram.utils import git_suffix -__version__ = "0.18.2" +__version__ = "0.18.3" __version__ += git_suffix(__file__)