-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e644057
commit eb1ca6c
Showing
6 changed files
with
105 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 92 additions & 88 deletions
180
app/src/main/resources/http4kbox/endpoints/ListFiles.rocker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,98 @@ | ||
@args (Iterable<http4kbox.FileName> files) | ||
<head> | ||
<title>http4kbox</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" | ||
integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.2.0/min/dropzone.min.css" | ||
integrity="sha256-e47xOkXs1JXFbjjpoRr1/LhVcqSzRmGmPqsrUQeVs+g=" crossorigin="anonymous"/> | ||
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" | ||
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" | ||
crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.2.0/min/dropzone.min.js" | ||
integrity="sha256-eO9VTVeZLaplH86Iwt8l39+l7GZpLOTsVWYziS5oY0Q=" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" | ||
integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" | ||
crossorigin="anonymous"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" | ||
integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" | ||
crossorigin="anonymous"></script> | ||
<style> | ||
body { | ||
padding-top: 100px; | ||
padding-left: 30px; | ||
padding-right: 30px; | ||
} | ||
@args (Iterable | ||
<http4kbox.FileName> files) | ||
<head> | ||
<title>http4kbox</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" | ||
integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.2.0/min/dropzone.min.css" | ||
integrity="sha256-e47xOkXs1JXFbjjpoRr1/LhVcqSzRmGmPqsrUQeVs+g=" crossorigin="anonymous"/> | ||
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" | ||
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" | ||
crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.2.0/min/dropzone.min.js" | ||
integrity="sha256-eO9VTVeZLaplH86Iwt8l39+l7GZpLOTsVWYziS5oY0Q=" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" | ||
integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" | ||
crossorigin="anonymous"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" | ||
integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" | ||
crossorigin="anonymous"></script> | ||
<script src="/htmx.min.js"></script> | ||
<style> | ||
body { | ||
padding-top: 100px; | ||
padding-left: 30px; | ||
padding-right: 30px; | ||
} | ||
|
||
.logo { | ||
max-height: 30px; | ||
vertical-align: bottom; | ||
} | ||
.logo { | ||
max-height: 30px; | ||
vertical-align: bottom; | ||
} | ||
|
||
.text { | ||
max-width: 50%; | ||
} | ||
.text { | ||
max-width: 50%; | ||
} | ||
|
||
.upload { | ||
float: right; | ||
} | ||
</style> | ||
</head> | ||
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse fixed-top"> | ||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" | ||
data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" | ||
aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<a class="navbar-brand" href="https://github.com/http4k/http4kbox"><img class="logo" src="https://www.http4k.org/img/octocat-inverted-64.png"></a> | ||
.upload { | ||
float: right; | ||
} | ||
|
||
<div class="collapse navbar-collapse" id="navbarsExampleDefault"> | ||
<ul class="navbar-nav mr-auto"></ul> | ||
<div class="error"><a href="https://http4k.org"><img class="logo" | ||
src="https://www.http4k.org/img/logo_1100x200_white_on_black_trans.png"/></a> | ||
tr.htmx-swapping td { | ||
opacity: 0; | ||
transition: opacity 0.5s ease-out; | ||
} | ||
</style> | ||
</head> | ||
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse fixed-top"> | ||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" | ||
data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" | ||
aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<a class="navbar-brand" href="https://github.com/http4k/http4kbox"><img class="logo" src="https://www.http4k.org/img/octocat-inverted-64.png"></a> | ||
|
||
<div class="collapse navbar-collapse" id="navbarsExampleDefault"> | ||
<ul class="navbar-nav mr-auto"></ul> | ||
<div class="error"><a href="https://http4k.org"><img class="logo" | ||
src="https://www.http4k.org/img/logo_1100x200_white_on_black_trans.png"/></a> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
<body> | ||
<span class="upload"> | ||
<form class="dropzone" method="POST" action="/"/> | ||
</form> | ||
</nav> | ||
<body> | ||
<span class="upload"> | ||
<form class="dropzone" method="POST" action="/"></form> | ||
</span> | ||
<div> | ||
<h2>http4kbox</h2> | ||
<p class="text">This is a simple Dropbox clone written using <a href="https://http4k.org">http4k</a> and <a href="https://connect.http4k.org">http4k Connect</a>, backed by an | ||
<a href="https://aws.amazon.com/s3">S3</a> bucket. | ||
</p> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@for ((file) : files) { | ||
<tr> | ||
<td><a id="file-@file" href="/@file">@file</a></td> | ||
<td> | ||
<form method="POST" action="/@file/delete"> | ||
<button>delete</button> | ||
</form> | ||
</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
</div> | ||
</body> | ||
<script type="text/javascript"> | ||
$(function () { | ||
Dropzone.forElement(".dropzone").on('queuecomplete', function () { | ||
location.reload(); | ||
}) | ||
}); | ||
</script> | ||
</html> | ||
<div> | ||
<h2>http4kbox</h2> | ||
<p class="text">This is a simple Dropbox clone written using <a href="https://http4k.org">http4k</a>, <a href="https://connect.http4k.org">http4k Connect</a>, <a href="https://htmx.org">HTMX</a>, backed by an | ||
<a href="https://aws.amazon.com/s3">S3</a> bucket. | ||
</p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody id="fileList" hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:0.5s"> | ||
@for ((file) : files) { | ||
<tr id="file-@file"> | ||
<td><a href="/@file" target="_blank">@file</a></td> | ||
<td> | ||
<button hx-delete="/@file">delete</button> | ||
</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
</div> | ||
</body> | ||
<script type="text/javascript"> | ||
$(function () { | ||
Dropzone.forElement(".dropzone").on('queuecomplete', function () { | ||
location.reload(); | ||
}) | ||
}); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters