Show document serial number on change list

This commit is contained in:
Jonas Winkler 2018-07-06 18:04:31 +02:00
parent e143a20f50
commit c5b315f518
2 changed files with 17 additions and 3 deletions

View File

@ -142,7 +142,7 @@ class DocumentAdmin(CommonAdmin):
search_fields = ("correspondent__name", "title", "content", "tags__name")
readonly_fields = ("added",)
list_display = ("title", "created", "added", "thumbnail", "correspondent",
"tags_")
"tags_", "archive_serial_number")
list_filter = ("tags", "correspondent", FinancialYearFilter,
MonthListFilter)

View File

@ -25,6 +25,7 @@
border-radius: 2%;
overflow: hidden;
height: 300px;
position: relative;
}
.result .header {
padding: 5px;
@ -79,6 +80,15 @@
.result .image img {
width: 100%;
}
.result .footer {
position: absolute;
bottom: 0;
right: 0;
border-left: 1px solid #cccccc;
border-top: 1px solid #cccccc;
padding: 4px 10px 4px 10px;
background: white;
}
.grid {
margin-right: 260px;
@ -152,7 +162,8 @@
{# 4: Image #}
{# 5: Correspondent #}
{# 6: Tags #}
{# 7: Document edit url #}
{# 7: Archive serial number #}
{# 8: Document edit url #}
<div class="box">
<div class="result">
<div class="header">
@ -166,7 +177,7 @@
selection would not be possible with mouse click + drag. Instead,
the underlying link would be dragged.
{% endcomment %}
<div class="headerLink" onclick="location.href='{{ result.7 }}';"></div>
<div class="headerLink" onclick="location.href='{{ result.8 }}';"></div>
<div class="checkbox">{{ result.0 }}</div>
<div class="info">
{{ result.5 }}
@ -178,6 +189,9 @@
<div class="date">{{ result.2 }}</div>
<div style="clear: both;"></div>
<div class="image">{{ result.4 }}</div>
{# Only show the archive serial number if it is set on the document. #}
{# checking for >-< (i.e., will a dash be displayed) doesn't feel like a very good solution to me. #}
{% if '>-<' not in result.7 %}<div class="footer">#{{ result.7 }}</div>{% endif %}
</div>
</div>
{% endfor %}