From d3848a25ec2450f5b5dc5e764f88e881ff989ab0 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 16:19:23 -0800 Subject: [PATCH] Redesigned HTML/CSS download page --- install/onionshare.nsi | 4 + onionshare/web.py | 8 +- share/html/index.html | 193 +++++++++++++++++++++--------------- share/images/web_file.png | Bin 0 -> 251 bytes share/images/web_folder.png | Bin 0 -> 338 bytes 5 files changed, 125 insertions(+), 80 deletions(-) create mode 100644 share/images/web_file.png create mode 100644 share/images/web_folder.png 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 0000000000000000000000000000000000000000..1931aff0cb734d2182bbe14533f7dac1b1389987 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1|+Qw)-3{3Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmPd6E_2o;Ga3Gw*iGZJY5_^JdVGeev#{d0*CAAwEen& z%L3l)6bwu&=6N6O_`SuPd2aBe`n)3&n$P#VnjFUOu$ke3LuA&0t=D4hlNwuHq8?~k z$n;Fya=_VQ&xZz2?mJgi-=b^3?EKbL4AQ5OB5c(23}j zTVDQ3lq3D6XjO0ALFI;Q<&E02uWgyOO4;{y{6Usa32b%@yX#_eWKL{4(;{%puth*e z^oGm1$W%s~(p6{MKj&zDSdw&(h0{XK`efD~)*FBB_U-4^xyP$<`qQI1*7>~K&h3m| zuF;iz*`%sh+pM(zEsuPBOmff)fk&D%M7S7YuSfplIwi4qQ{e9jS!+vew=A8q?0t36 z{bvjlo?GtuuFkMx)vF8JbblrvOxj!eR=g|Nd1}z-IoX|Cu6+$SS`)z4*}Q$iB}W2K31 literal 0 HcmV?d00001