diff --git a/sdbs_pile/pile/static/main.css b/sdbs_pile/pile/static/main.css index 02b74aa..85a8dab 100755 --- a/sdbs_pile/pile/static/main.css +++ b/sdbs_pile/pile/static/main.css @@ -100,6 +100,20 @@ ul > li:before { margin: 0 0 1rem 0; } +.docs-header { + text-align: center; + text-transform: uppercase; + background: #303030; +} + +.docs-header h3 { + margin: 0; +} + +.doc-item { + padding: 1.2rem 1rem; +} + .doc-item-text { display: inline-block; margin-right: 3em; diff --git a/sdbs_pile/pile/templates/front_doc_listing.html b/sdbs_pile/pile/templates/front_doc_listing.html index c1493dd..554d369 100644 --- a/sdbs_pile/pile/templates/front_doc_listing.html +++ b/sdbs_pile/pile/templates/front_doc_listing.html @@ -19,16 +19,21 @@ {% endif %} - {% for document in documents %} -
- 🔗 - -
-

{{ document.title }}

-

{{ document.author }} {{ document.published }}

+ {% for status, documents in status_documents.items %} + {% if documents|length > 0 %} +

{{ status.label }}

+ {% for document in documents %} +
- -
+ {% endfor %} + {% endif %} {% endfor %} {% endblock %} diff --git a/sdbs_pile/pile/views.py b/sdbs_pile/pile/views.py index 1075535..1b8a200 100644 --- a/sdbs_pile/pile/views.py +++ b/sdbs_pile/pile/views.py @@ -78,10 +78,14 @@ class TagView(BasePileView): except ObjectDoesNotExist: raise Http404 + status_documents = {s: [] for s in Document.DocumentStatus} + for document in documents: + status_documents[document.status] += [document] + return { 'tag': tag if tag != "UNTAGGED" else None, 'untagged': tag == "UNTAGGED", - 'documents': documents, + 'status_documents': status_documents, **base_context_data }