Skip to content

Commit

Permalink
complete
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalvivek committed Jan 31, 2021
1 parent 98989e2 commit 25e132d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def logout():
# after upload feedback
@app.route('/done')
def done():
return session['upload_message']
status = session.get('upload_message')['status']
get_url = session.get('upload_message')['get_url']
return render_template('done.html', status=status, get_url=get_url)

if __name__ == "__main__":
app.run(debug=True)
Binary file added static/img/failure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions templates/done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>

<head>
<title>
Image Upload Portal
</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<style>
.file {
visibility: hidden;
position: absolute;
}
</style>
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">S3 Upload Portal</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="logout">Exit Session</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class=" col-sm-3 "></div>
<div class="ml-2 col-sm-6 text-center">
<div class="p-5">
{% if status == 'SUCCESS' %}
<div class="p-3">
<img width="25%" src="{{ url_for('static', filename='img/success.png') }}" />
</div>
<h3>Upload Successful!</h3>
<p>
<strong>Get URL : </strong><code id="url">{{ get_url }}</code> <button type="button"
onclick="copy('#url')" class="btn btn-light">Copy</button>
</p>
<a href="/" class="btn btn-primary" role="button">Upload another image</a>
{% else %}
<div class="p-3">
<img src="{{ url_for('static', filename='img/failure.png') }}" />
</div>
<h3>Upload Failed</h3>
<p>
<strong>Error : </strong>{{ status }}
</p>
<a href="/" class="btn btn-primary" role="button">Try Again</a>
{% endif %}
</div>
</div>
</div>
</body>
<script>
function copy(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}

</script>

</html>

0 comments on commit 25e132d

Please sign in to comment.