diff --git a/archivebox/core/views.py b/archivebox/core/views.py index b7911674..5efa79cd 100644 --- a/archivebox/core/views.py +++ b/archivebox/core/views.py @@ -57,19 +57,22 @@ class AddLinks(View): def post(self, request): url = request.POST['url'] - print(f'[+] Adding URL: {url}') - add_stdout = StringIO() - with redirect_stdout(add_stdout): - extracted_links = add( - import_str=url, - update_all=False, - out_dir=OUTPUT_DIR, - ) - print(add_stdout.getvalue()) + if url: + print(f'[+] Adding URL: {url}') + add_stdout = StringIO() + with redirect_stdout(add_stdout): + extracted_links = add( + import_str=url, + update_all=False, + out_dir=OUTPUT_DIR, + ) + print(add_stdout.getvalue()) - context = { - "stdout": ansi_to_html(add_stdout.getvalue()) - } + context = { + "stdout": ansi_to_html(add_stdout.getvalue()) + } + else: + context = {"stdout": "Please enter a URL"} return render(template_name=self.template, request=request, context=context) diff --git a/archivebox/themes/default/add_links.html b/archivebox/themes/default/add_links.html index db09322f..6c625594 100644 --- a/archivebox/themes/default/add_links.html +++ b/archivebox/themes/default/add_links.html @@ -2,231 +2,211 @@ - - Archived Sites - - - - - - - - - -
-
- -
-
-
- {{ stdout | safe }} -

-
- {% csrf_token %} Add new links...
-
- -
+ tr td a.favicon img { + padding-left: 6px; + padding-right: 12px; + vertical-align: -4px; + } + tr td a.title { + font-size: 1.4em; + text-decoration:none; + color:black; + } + tr td a.title small { + background-color: #efefef; + border-radius: 4px; + float:right + } + input[type=search]::-webkit-search-cancel-button { + -webkit-appearance: searchfield-cancel-button; + } + .title-col { + text-align: left; + } + .title-col a { + color: black; + } + + + + + + + + +
+
+ +
+
+
+ {{ stdout | safe }} +

+
{% csrf_token %} + Add new links...
+
+ +
+
- Go back to Snapshot list -
- + Go back to Snapshot list + +