diff --git a/archivebox/core/models.py b/archivebox/core/models.py
index a225f4d7..2b555e08 100644
--- a/archivebox/core/models.py
+++ b/archivebox/core/models.py
@@ -3,7 +3,7 @@ __package__ = 'archivebox.core'
import uuid
from pathlib import Path
from typing import Dict, Optional, List
-from datetime import datetime
+from datetime import datetime, timedelta
from collections import defaultdict
from django.db import models, transaction
@@ -148,7 +148,6 @@ class Snapshot(models.Model):
output["history"] = self.get_history()
return output
-
def as_csv(self, cols: Optional[List[str]]=None, separator: str=',', ljust: int=0) -> str:
from ..index.csv import to_csv
return to_csv(self, cols=cols or self.field_names(), separator=separator, ljust=ljust)
@@ -167,6 +166,19 @@ class Snapshot(models.Model):
def bookmarked(self):
return parse_date(self.timestamp)
+ @cached_property
+ def bookmarked_date(self) -> Optional[str]:
+ from ..util import ts_to_date
+
+ max_ts = (datetime.now() + timedelta(days=30)).timestamp()
+
+ if self.timestamp and self.timestamp.replace('.', '').isdigit():
+ if 0 < float(self.timestamp) < max_ts:
+ return ts_to_date(datetime.fromtimestamp(float(self.timestamp)))
+ else:
+ return str(self.timestamp)
+ return None
+
@cached_property
def is_archived(self) -> bool:
from ..config import ARCHIVE_DIR
diff --git a/archivebox/index/html.py b/archivebox/index/html.py
index 5917af3c..a2a7cb35 100644
--- a/archivebox/index/html.py
+++ b/archivebox/index/html.py
@@ -84,12 +84,6 @@ def snapshot_details_template(snapshot: Model) -> str:
from ..extractors.wget import wget_output_path
- tags = snapshot.tags.all()
- if len(tags) > 0:
- tags = ",".join(list(tags.values_list("name", flat=True)))
- else:
- tags = "untagged"
-
return render_django_template(LINK_DETAILS_TEMPLATE, {
**snapshot.as_json(),
**snapshot.canonical_outputs(),
@@ -103,7 +97,7 @@ def snapshot_details_template(snapshot: Model) -> str:
or (snapshot.domain if snapshot.is_archived else '')
) or 'about:blank',
'extension': snapshot.extension or 'html',
- 'tags': tags,
+ 'tags': snapshot.tags_str() or "untagged",
'size': printable_filesize(snapshot.archive_size) if snapshot.archive_size else 'pending',
'status': 'archived' if snapshot.is_archived else 'not yet archived',
'status_color': 'success' if snapshot.is_archived else 'danger',
diff --git a/archivebox/themes/default/main_index.html b/archivebox/themes/default/main_index.html
index 95af1963..42150342 100644
--- a/archivebox/themes/default/main_index.html
+++ b/archivebox/themes/default/main_index.html
@@ -227,14 +227,14 @@
Bookmarked |
- Saved Link ({{num_links}}) |
+ Saved Link ({{num_snapshots}}) |
Files |
Original URL |
- {% for link in links %}
- {% include 'main_index_row.html' with link=link %}
+ {% for snapshot in snapshots %}
+ {% include 'main_index_row.html' with snapshot=snapshot %}
{% endfor %}
diff --git a/archivebox/themes/default/main_index_minimal.html b/archivebox/themes/default/main_index_minimal.html
index dcfaa23f..e7bd6840 100644
--- a/archivebox/themes/default/main_index_minimal.html
+++ b/archivebox/themes/default/main_index_minimal.html
@@ -1,24 +1,30 @@
-
- Archived Sites
-
-
-
-
-
-
- Bookmarked |
- Saved Link ({{num_links}}) |
- Files |
- Original URL |
-
-
-
- {% for link in links %}
- {% include "main_index_row.html" with link=link %}
- {% endfor %}
-
-
-
-
\ No newline at end of file
+
+ Archived Sites
+
+
+
+
+
+
+ Bookmarked |
+ Saved Link ({{num_links}}) |
+ Files |
+
+ Original URL
+ |
+
+
+
+ {% for snapshot in snapshots %}
+ {% include "main_index_row.html" with snapshot=snapshot %}
+ {% endfor %}
+
+
+
+