mirror of
https://git.sdbs.cz/sdbs/pile.git
synced 2025-05-10 00:12:18 +00:00
sort document lists by their status
This commit is contained in:
parent
264dc9485d
commit
23faa2bb69
3 changed files with 33 additions and 10 deletions
|
@ -100,6 +100,20 @@ ul > li:before {
|
||||||
margin: 0 0 1rem 0;
|
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 {
|
.doc-item-text {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 3em;
|
margin-right: 3em;
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% for status, documents in status_documents.items %}
|
||||||
|
{% if documents|length > 0 %}
|
||||||
|
<div class="text docs-header"><h3>{{ status.label }}</h3></div>
|
||||||
{% for document in documents %}
|
{% for document in documents %}
|
||||||
<div class="text doc-item">
|
<div class="text doc-item">
|
||||||
<a class="doc-item-link" href="{% url "pile:retrieve" document.id %}">🔗</a>
|
<a class="doc-item-link" href="{% url "pile:retrieve" document.id %}">🔗</a>
|
||||||
|
@ -30,6 +33,8 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block meta-og %}
|
{% block meta-og %}
|
||||||
|
|
|
@ -78,10 +78,14 @@ class TagView(BasePileView):
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
|
status_documents = {s: [] for s in Document.DocumentStatus}
|
||||||
|
for document in documents:
|
||||||
|
status_documents[document.status] += [document]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'tag': tag if tag != "UNTAGGED" else None,
|
'tag': tag if tag != "UNTAGGED" else None,
|
||||||
'untagged': tag == "UNTAGGED",
|
'untagged': tag == "UNTAGGED",
|
||||||
'documents': documents,
|
'status_documents': status_documents,
|
||||||
**base_context_data
|
**base_context_data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue