diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 0380cfb2..55ecdbcb 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -210,6 +210,8 @@ Section "install" File "${BINPATH}\share\images\server_stopped.png" File "${BINPATH}\share\images\server_working.png" File "${BINPATH}\share\images\settings.png" + File "${BINPATH}\share\images\web_file.png" + File "${BINPATH}\share\images\web_folder.png" SetOutPath "$INSTDIR\share\locale" File "${BINPATH}\share\locale\cs.json" @@ -389,6 +391,8 @@ FunctionEnd Delete "$INSTDIR\share\images\server_stopped.png" Delete "$INSTDIR\share\images\server_working.png" Delete "$INSTDIR\share\images\settings.png" + Delete "$INSTDIR\share\images\web_file.png" + Delete "$INSTDIR\share\images\web_folder.png" Delete "$INSTDIR\share\license.txt" Delete "$INSTDIR\share\locale\cs.json" Delete "$INSTDIR\share\locale\de.json" diff --git a/onionshare/web.py b/onionshare/web.py index 6ade1b47..7d1b72e8 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -126,8 +126,11 @@ def add_request(request_type, path, data=None): }) -# Load favicon.ico and base64 encode it, to pass into templates +# Load and base64 encode images to pass into templates favicon_b64 = base64.b64encode(open(common.get_resource_path('images/favicon.ico'), 'rb').read()).decode() +logo_b64 = base64.b64encode(open(common.get_resource_path('images/logo.png'), 'rb').read()).decode() +folder_b64 = base64.b64encode(open(common.get_resource_path('images/web_folder.png'), 'rb').read()).decode() +file_b64 = base64.b64encode(open(common.get_resource_path('images/web_file.png'), 'rb').read()).decode() slug = None @@ -223,6 +226,9 @@ def index(slug_candidate): r = make_response(render_template_string( open(common.get_resource_path('html/index.html')).read(), favicon_b64=favicon_b64, + logo_b64=logo_b64, + folder_b64=folder_b64, + file_b64=file_b64, slug=slug, file_info=file_info, filename=os.path.basename(zip_filename), diff --git a/share/html/index.html b/share/html/index.html index ba72ffaf..ad5f342d 100644 --- a/share/html/index.html +++ b/share/html/index.html @@ -4,103 +4,138 @@ OnionShare -

{{ filename }} ▼

-

{{ filesize_human }} (compressed)

-

This zip file contains the following contents:

+ +
+
+ +
+ +

OnionShare

+
+ - - + + + {% for info in file_info.dirs %} - - + + + {% endfor %} {% for info in file_info.files %} - - + + + {% endfor %}
TypeNameFilename Size
{{ info.basename }} + + {{ info.basename }} + {{ info.size_human }}
{{ info.basename }} + + {{ info.basename }} + {{ info.size_human }}
diff --git a/share/images/web_file.png b/share/images/web_file.png new file mode 100644 index 00000000..1931aff0 Binary files /dev/null and b/share/images/web_file.png differ diff --git a/share/images/web_folder.png b/share/images/web_folder.png new file mode 100644 index 00000000..3ca5df21 Binary files /dev/null and b/share/images/web_folder.png differ