1
0
Fork 0

tweak icons

This commit is contained in:
Nick Sweeting 2020-10-31 19:32:43 -04:00
parent cafe35c595
commit 22fb9c2ad7
5 changed files with 20 additions and 12 deletions

View file

@ -429,6 +429,15 @@ Description: <div align="center">
# Optional: install the extractor dependencies
./bin/setup.sh
# Optional: develop via docker by mounting the code dir into the container
# if you edit e.g. ./archivebox/core/models.py on the docker host, runserver
# inside the container will reload and pick up your changes
docker build . -t archivebox
docker run -it -p 8000:8000 \
-v $PWD/data:/data \
-v $PWD/archivebox:/app/archivebox \
archivebox server 0.0.0.0:8000 --debug --reload
```
### Common development tasks

View file

@ -7,7 +7,6 @@ import sys
import json
import getpass
import shutil
import platform
import django
from hashlib import md5
@ -322,7 +321,7 @@ DERIVED_CONFIG_DEFAULTS: ConfigDefaultDict = {
'SAVE_PDF': {'default': lambda c: c['USE_CHROME'] and c['SAVE_PDF']},
'SAVE_SCREENSHOT': {'default': lambda c: c['USE_CHROME'] and c['SAVE_SCREENSHOT']},
'SAVE_DOM': {'default': lambda c: c['USE_CHROME'] and c['SAVE_DOM']},
'SAVE_SINGLEFILE': {'default': lambda c: c['USE_CHROME'] and c['USE_SINGLEFILE'] and c['USE_NODE']},
'SAVE_SINGLEFILE': {'default': lambda c: c['USE_CHROME'] and c['SAVE_SINGLEFILE'] and c['USE_NODE']},
'SAVE_READABILITY': {'default': lambda c: c['USE_READABILITY'] and c['USE_NODE']},
'SAVE_MERCURY': {'default': lambda c: c['USE_MERCURY'] and c['USE_NODE']},

View file

@ -137,7 +137,7 @@ class SnapshotAdmin(admin.ModelAdmin):
if archive_size > 52428800:
size_txt = mark_safe(f'<b>{size_txt}</b>')
else:
size_txt = 'pending'
size_txt = mark_safe('<span style="opacity: 0.3">...</span>')
return format_html(
'<a href="/{}" title="View all files">{}</a>',
obj.archive_path,
@ -146,7 +146,7 @@ class SnapshotAdmin(admin.ModelAdmin):
def url_str(self, obj):
return format_html(
'<a href="{}">{}</a>',
'<a href="{}"><code>{}</code></a>',
obj.url,
obj.url.split('://www.', 1)[-1].split('://', 1)[-1][:64],
)

View file

@ -17,18 +17,18 @@ def get_icons(snapshot: Snapshot) -> str:
return format_html(
'<span class="files-icons" style="font-size: 1.2em; opacity: 0.8">'
'<a href="/{}/{}" class="exists-{}" title="Wget clone">🌐 </a> '
'<a href="/{}/{}" class="exists-{}" title="SingleFile">&#128476; </a>'
'<a href="/{}/{}" class="exists-{}" title="PDF">📄</a> '
'<a href="/{}/{}" class="exists-{}" title="Screenshot">🖥 </a> '
'<a href="/{}/{}" class="exists-{}" title="SingleFile">❶ </a>'
'<a href="/{}/{}" class="exists-{}" title="Wget clone">🆆 </a> '
'<a href="/{}/{}" class="exists-{}" title="HTML dump">🅷 </a> '
'<a href="/{}/{}" class="exists-{}" title="WARC">🆆 </a> '
'<a href="/{}/{}" class="exists-{}" title="PDF">📄 </a> '
'<a href="/{}/{}" class="exists-{}" title="Screenshot">💻 </a> '
'<a href="/{}/{}" class="exists-{}" title="WARC">📦 </a> '
'<a href="/{}/{}/" class="exists-{}" title="Media files">📼 </a> '
'<a href="/{}/{}/" class="exists-{}" title="Git repos">📦 </a> '
'<a href="/{}/{}/" class="exists-{}" title="Git repos">🅶 </a> '
'<a href="{}" class="exists-{}" title="Archive.org snapshot">🏛 </a> '
'</span>',
*link_tuple(link, 'wget_path'),
*link_tuple(link, 'singlefile_path'),
*link_tuple(link, 'wget_path')[:2], any((out_dir / link.domain).glob('*')),
*link_tuple(link, 'pdf_path'),
*link_tuple(link, 'screenshot_path'),
*link_tuple(link, 'dom_path'),

View file

@ -140,7 +140,7 @@ def link_details_template(link: Link) -> str:
) or 'about:blank',
'extension': link.extension or 'html',
'tags': link.tags or 'untagged',
'size': printable_filesize(link.archive_size) if link.archive_size else mark_safe('<span style="opacity: 0.3">pending</span>'),
'size': printable_filesize(link.archive_size) if link.archive_size else 'pending',
'status': 'archived' if link.is_archived else 'not yet archived',
'status_color': 'success' if link.is_archived else 'danger',
'oldest_archive_date': ts_to_date(link.oldest_archive_date),