From ff9445648b27e301b3e70713eaf35a6f294af522 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 1 Apr 2021 01:39:34 -0400 Subject: [PATCH] fix navbar and tags display --- archivebox/core/admin.py | 10 +++++++--- archivebox/templates/admin/base.html | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/archivebox/core/admin.py b/archivebox/core/admin.py index 91feb07b..612a1edb 100644 --- a/archivebox/core/admin.py +++ b/archivebox/core/admin.py @@ -267,11 +267,11 @@ class TagAdmin(admin.ModelAdmin): class ArchiveResultAdmin(admin.ModelAdmin): - list_display = ('id', 'start_ts', 'extractor', 'snapshot_str', 'cmd_str', 'status', 'output_str') + list_display = ('id', 'start_ts', 'extractor', 'snapshot_str', 'tags_str', 'cmd_str', 'status', 'output_str') sort_fields = ('start_ts', 'extractor', 'status') - readonly_fields = ('id', 'uuid', 'snapshot_str') + readonly_fields = ('id', 'uuid', 'snapshot_str', 'tags_str') search_fields = ('id', 'uuid', 'snapshot__url', 'extractor', 'output', 'cmd_version', 'cmd', 'snapshot__timestamp') - fields = (*readonly_fields, 'snapshot', 'snapshot__tags', 'extractor', 'status', 'start_ts', 'end_ts', 'pwd', 'cmd', 'cmd_version', 'output') + fields = (*readonly_fields, 'snapshot', 'extractor', 'status', 'start_ts', 'end_ts', 'output', 'pwd', 'cmd', 'cmd_version') autocomplete_fields = ['snapshot'] list_filter = ('status', 'extractor', 'start_ts', 'cmd_version') @@ -287,6 +287,9 @@ class ArchiveResultAdmin(admin.ModelAdmin): obj.snapshot.url[:128], ) + def tags_str(self, obj): + return obj.snapshot.tags_str() + def cmd_str(self, obj): return format_html( '
{}
', @@ -301,6 +304,7 @@ class ArchiveResultAdmin(admin.ModelAdmin): obj.output, ) + tags_str.short_description = 'tags' snapshot_str.short_description = 'snapshot' class ArchiveBoxAdmin(admin.AdminSite): diff --git a/archivebox/templates/admin/base.html b/archivebox/templates/admin/base.html index a3d21ba9..f2552736 100644 --- a/archivebox/templates/admin/base.html +++ b/archivebox/templates/admin/base.html @@ -80,17 +80,22 @@ ArchiveBox +     + + | + ⣿⣿ + - {% block usertools %} {% if has_permission %}
- Add ➕ / - Snapshots / - Tags / - Admin / - Docs + Add ➕     + Snapshots | + Outputs | + Tags     + Docs | + Admin     {% block welcome-msg %} {% trans 'User' %} @@ -104,12 +109,9 @@ {% endif %} {% endif %} {% if user.has_usable_password %} - {% trans 'Change password' %} / + Account / {% endif %} {% trans 'Log out' %} - | - - ⣿⣿ {% endblock %}
{% endif %}