[UGLY UPLOAD BUTTON HACKS INTENSIFIES]

This commit is contained in:
Dominik V. Salonen 2015-12-23 14:41:25 +01:00
parent e689511fb5
commit 0b376d9478
3 changed files with 24 additions and 24 deletions

3
run.py
View File

@ -19,7 +19,7 @@ app = Flask(__name__)
# Pre-start functions # Pre-start functions
print_log('Main', 'Running authorization towards B2') print_log('Main', 'Running in "' + os.getcwd() + '"')
print_log('Main', 'Checking for data folder') print_log('Main', 'Checking for data folder')
if not os.path.exists(config['UPLOAD_FOLDER']): if not os.path.exists(config['UPLOAD_FOLDER']):
print_log('Main', 'Data folder not found, creating') print_log('Main', 'Data folder not found, creating')
@ -59,7 +59,6 @@ def upload_file():
thread1.start() thread1.start()
print_log('Thread', 'Adding to DB') print_log('Thread', 'Adding to DB')
file.save(os.path.join(config['UPLOAD_FOLDER'], filename)) file.save(os.path.join(config['UPLOAD_FOLDER'], filename))
#db.add_file(filename)
thread1.join() thread1.join()
data["file"] = filename data["file"] = filename

View File

@ -10,7 +10,7 @@
body { body {
font-family: "Lato", sans-serif; font-family: "Lato", sans-serif;
color: #ffffff; color: #ffffff;
background-color: #101010; background-color: #2d2d2d;
} }
.header { .header {
@ -40,30 +40,26 @@ body {
} }
.uploadForm { .uploadForm {
margin-top: 80px;
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.uploadForm input[type="file"] { .uploadButton {
padding: 10px;
font-size: 12pt;
font-weight: 300;
border: none;
display: inline-block;
}
.uploadForm input[type="submit"] {
width: 100%;
padding: 20px;
font-size: 12pt;
font-weight: 300;
max-width: 320px;
background-color: #229922; background-color: #229922;
margin-top: 10px; border-radius: 10px;
color: #FFFFFF;
border: none;
} }
.uploadForm input[type="submit"]:hover { .uploadButton p {
background-color: #33BB33; padding: 20px;
}
.uploadButton input[type="file"] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 900;
} }

View File

@ -1,7 +1,12 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<form action="" id="form" method="post" enctype="multipart/form-data" class="uploadForm"> <form action="" id="form" name="fileForm" method="post" enctype="multipart/form-data" class="uploadForm">
<input id="file" type="file" name="file"> <div class="uploadButton">
<input id="file" type="file" name="file">
<p>
Select a file
</p>
</div>
<input type="hidden" name="source" value="web"> <input type="hidden" name="source" value="web">
</form> </form>
<script> <script>