Merge branch 'receive_mode_styling' of https://github.com/mig5/onionshare into mig5-receive_mode_styling

This commit is contained in:
Micah Lee 2018-09-02 23:01:06 -07:00
commit f83aa3cffb
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
4 changed files with 76 additions and 10 deletions

View File

@ -331,7 +331,7 @@ class Web(object):
print(strings._('error_downloads_dir_not_writable').format(self.common.settings.get('downloads_dir'))) print(strings._('error_downloads_dir_not_writable').format(self.common.settings.get('downloads_dir')))
valid = False valid = False
if not valid: if not valid:
flash('Error uploading, please inform the OnionShare user') flash('Error uploading, please inform the OnionShare user', 'error')
if self.common.settings.get('receive_public_mode'): if self.common.settings.get('receive_public_mode'):
return redirect('/') return redirect('/')
else: else:
@ -390,10 +390,10 @@ class Web(object):
# Note that flash strings are on English, and not translated, on purpose, # Note that flash strings are on English, and not translated, on purpose,
# to avoid leaking the locale of the OnionShare user # to avoid leaking the locale of the OnionShare user
if len(filenames) == 0: if len(filenames) == 0:
flash('No files uploaded') flash('No files uploaded', 'info')
else: else:
for filename in filenames: for filename in filenames:
flash('Uploaded {}'.format(filename)) flash('Sent {}'.format(filename), 'info')
if self.common.settings.get('receive_public_mode'): if self.common.settings.get('receive_public_mode'):
return redirect('/') return redirect('/')

View File

@ -142,3 +142,53 @@ ul.flashes li {
margin: 0; margin: 0;
padding: 10px; padding: 10px;
} }
li.error {
list-style: none;
margin: 0;
padding: 0;
color: #ffffff;
background-color: #c90c0c;
border: 0;
border-radius: 5px;
text-align: left;
}
li.info {
list-style: none;
margin: 0;
padding: 0;
color: #000000;
background-color: #a9e26c;
border: 0;
border-radius: 5px;
text-align: left;
}
.closed-wrapper {
display: flex;
align-items: center;
justify-content: center;
min-height: 400px;
}
.closed {
text-align: center;
}
.closed img {
width: 120px;
height: 120px;
}
.closed .closed-header {
font-size: 30px;
font-weight: normal;
color: #666666;
margin: 0 0 10px 0;
}
.closed .closed-description {
color: #666666;
margin: 0 0 20px 0;
}

View File

@ -3,8 +3,20 @@
<head> <head>
<title>OnionShare is closed</title> <title>OnionShare is closed</title>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" />
<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<p>Thank you for using OnionShare</p> <header class="clearfix">
<img class="logo" src="/static/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<div class="closed-wrapper">
<div class="closed">
<p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p>
<p class="closed-header">Thank you for using OnionShare</p>
<p class="closed-description">You may now close this window.</p>
</div>
</div>
</body> </body>
</html> </html>

View File

@ -21,11 +21,11 @@
<p><input type="file" name="file[]" multiple /></p> <p><input type="file" name="file[]" multiple /></p>
<p><input type="submit" class="button" value="Send Files" /></p> <p><input type="submit" class="button" value="Send Files" /></p>
<div> <div>
{% with messages = get_flashed_messages() %} {% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %} {% if messages %}
<ul class=flashes> <ul class=flashes>
{% for message in messages %} {% for category, message in messages %}
<li>{{ message }}</li> <li class="{{ category }}">{{ message }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
@ -35,9 +35,13 @@
</div> </div>
</div> </div>
{% if receive_allow_receiver_shutdown %} {% if receive_allow_receiver_shutdown %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<form method="post" action="{{ close_action }}"> <form method="post" action="{{ close_action }}">
<input type="submit" class="close-button" value="I'm Finished Uploading" /> <input type="submit" class="close-button" value="I'm Finished Sending" />
</form> </form>
{% endif %} {% endif %}
{% endwith %}
{% endif %}
</body> </body>
</html> </html>