Commit afd15c60 authored by Lukas Böhm's avatar Lukas Böhm 🎱
Browse files

move some sharing options into expanded section

parent c89216a4
......@@ -17,7 +17,7 @@ type Share struct {
ID uuid.UUID `json:"id" gorm:"primary_key"`
Name string `json:"name,omitempty"`
Expires *time.Time `json:"expires,omitempty"`
DownloadLimit uint `json:"download_limit,omitempty"`
DownloadLimit int `json:"download_limit,omitempty"`
IsPublic bool `json:"is_public" gorm:"not null; default:false; index"`
Password string `json:"-"`
Emails []string `json:"emails,omitempty" gorm:"-"`
......
......@@ -32,6 +32,9 @@
<!-- page contents in here -->
{% block page %}
{% endblock page %}
<script src="https://unpkg.com/dayjs@1.8.21/dayjs.min.js"></script>
<script>dayjs().format()</script>
</body>
</html>
\ No newline at end of file
......@@ -44,9 +44,16 @@
</select>
</div>
<div class="form-group">
<input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button"
value="Hochladen" onclick="openShare()">
</div>
<div class="collapse" id="collapseExample">
<div class="row form-group">
<p class="custom-control custom-switch col">
<input class="custom-control-input" id="is_public" name="is_public" type="checkbox" value="y">
<input class="custom-control-input" id="is_public" name="is_public" type="checkbox"
value="y">
<label class="custom-control-label" for="is_public">Öffentlich</label>
</p>
<div class="col">
......@@ -60,11 +67,21 @@
</div>
<div class="form-group">
<input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button"
value="Hochladen" onclick="openShare()">
<label for="email">Empfänger-Mail</label>
<input type="email" id="email" class="form-control">
</div>
</div>
</div>
<a class="card-footer" data-toggle="collapse" href="#collapseExample" role="button"
aria-expanded="false" aria-controls="collapseExample">
weitere Einstellungen
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-chevron-expand" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708z"></path>
</svg>
</a>
</div>
<style>
......@@ -75,7 +92,6 @@
text-overflow: ellipsis;
}
</style>
<script src="{{ url_for('static', filename='js/jq-ajax-progress.min.js') }}"></script>
<script>
// To show filenames in the file selector.
......@@ -102,7 +118,11 @@
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({}),
"data": JSON.stringify({ // TODO
"name": $("#name").val(),
"download_limit": $("#download_limit").val(),
"is_public": $("#is_public").val()
}),
}).done((response) => {
share = response;
console.log(share);
......@@ -128,9 +148,6 @@
success: function (response) {
console.log(response);
},
//progress: function (e) {
// console.log(e);
//},
uploadProgress: function (e) {
if (e.lengthComputable) {
let completedPercentage = Math.round((e.loaded * 100) / e.total);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment