{{ title }}
{% endif %}{% endblock %} + {% block content %} + {% block object-tools %}{% endblock %} + {{ content }} + {% endblock %} + {% block sidebar %}{% endblock %} ++
diff --git a/archivebox/core/admin.py b/archivebox/core/admin.py index b61d93d6..d131d3e8 100644 --- a/archivebox/core/admin.py +++ b/archivebox/core/admin.py @@ -1,11 +1,19 @@ + +from datetime import datetime + from django.contrib import admin from .models import Page class PageAdmin(admin.ModelAdmin): list_display = ('timestamp', 'short_url', 'title', 'is_archived', 'num_outputs', 'added', 'updated', 'url_hash') + readonly_fields = ('num_outputs', 'is_archived', 'added', 'updated', 'bookmarked') + fields = ('url', 'timestamp', 'title', 'tags', *readonly_fields) def short_url(self, obj): return obj.url[:64] + def updated(self, obj): + return obj.isoformat() + admin.site.register(Page, PageAdmin) diff --git a/archivebox/core/models.py b/archivebox/core/models.py index 94258b1a..9c82c61d 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -5,6 +5,7 @@ import uuid from django.db import models from legacy.schema import Link +from legacy.util import parse_date class Page(models.Model): @@ -44,6 +45,10 @@ class Page(models.Model): def as_link(self) -> Link: return Link.from_json(self.as_json()) + @property + def bookmarked(self): + return parse_date(self.timestamp) + @property def is_archived(self): return self.as_link().is_archived diff --git a/archivebox/themes/admin/app_index.html b/archivebox/themes/admin/app_index.html new file mode 100644 index 00000000..6868b497 --- /dev/null +++ b/archivebox/themes/admin/app_index.html @@ -0,0 +1,18 @@ +{% extends "admin/index.html" %} +{% load i18n %} + +{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %} + +{% if not is_popup %} +{% block breadcrumbs %} +
+{% endblock %} +{% endif %} + +{% block sidebar %}{% endblock %} diff --git a/archivebox/themes/admin/base.html b/archivebox/themes/admin/base.html new file mode 100644 index 00000000..2160dfeb --- /dev/null +++ b/archivebox/themes/admin/base.html @@ -0,0 +1,94 @@ +{% load i18n static %} +{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} + + +