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 { ...@@ -17,7 +17,7 @@ type Share struct {
ID uuid.UUID `json:"id" gorm:"primary_key"` ID uuid.UUID `json:"id" gorm:"primary_key"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
Expires *time.Time `json:"expires,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"` IsPublic bool `json:"is_public" gorm:"not null; default:false; index"`
Password string `json:"-"` Password string `json:"-"`
Emails []string `json:"emails,omitempty" gorm:"-"` Emails []string `json:"emails,omitempty" gorm:"-"`
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="ChiefSend"> <meta name="description" content="ChiefSend">
<meta name="theme-color" content="#0b5ed7"> <meta name="theme-color" content="#0b5ed7">
<link rel="icon" href="{{ url_for('static', filename='img/favicon.ico') }}"> <link rel="icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
{% block preview %} {% block preview %}
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:url" content="https://send.chief.zone"> <meta property="og:url" content="https://send.chief.zone">
<meta property="og:title" content="ChiefSend"> <meta property="og:title" content="ChiefSend">
<meta property="og:description" content="Verschicke Dateien"> <meta property="og:description" content="Verschicke Dateien">
{% endblock preview %} {% endblock preview %}
<title>{% block title %} ChiefSend {% endblock title %}</title> <title>{% block title %} ChiefSend {% endblock title %}</title>
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
<!-- page contents in here --> <!-- page contents in here -->
{% block page %} {% block page %}
{% endblock page %} {% endblock page %}
<script src="https://unpkg.com/dayjs@1.8.21/dayjs.min.js"></script>
<script>dayjs().format()</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -44,27 +44,44 @@ ...@@ -44,27 +44,44 @@
</select> </select>
</div> </div>
<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">
<label class="custom-control-label" for="is_public">Öffentlich</label>
</p>
<div class="col">
<input autocomplete="off" class="form-control" id="password" name="password"
placeholder="Passwort ..." type="text" value="">
</div>
</div>
<div class="progress form-group d-none">
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="form-group"> <div class="form-group">
<input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button" <input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button"
value="Hochladen" onclick="openShare()"> value="Hochladen" onclick="openShare()">
</div> </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">
<label class="custom-control-label" for="is_public">Öffentlich</label>
</p>
<div class="col">
<input autocomplete="off" class="form-control" id="password" name="password"
placeholder="Passwort ..." type="text" value="">
</div>
</div>
<div class="progress form-group d-none">
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="form-group">
<label for="email">Empfänger-Mail</label>
<input type="email" id="email" class="form-control">
</div>
</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> </div>
<style> <style>
...@@ -75,7 +92,6 @@ ...@@ -75,7 +92,6 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
</style> </style>
<script src="{{ url_for('static', filename='js/jq-ajax-progress.min.js') }}"></script> <script src="{{ url_for('static', filename='js/jq-ajax-progress.min.js') }}"></script>
<script> <script>
// To show filenames in the file selector. // To show filenames in the file selector.
...@@ -102,7 +118,11 @@ ...@@ -102,7 +118,11 @@
"headers": { "headers": {
"Content-Type": "application/json" "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) => { }).done((response) => {
share = response; share = response;
console.log(share); console.log(share);
...@@ -128,9 +148,6 @@ ...@@ -128,9 +148,6 @@
success: function (response) { success: function (response) {
console.log(response); console.log(response);
}, },
//progress: function (e) {
// console.log(e);
//},
uploadProgress: function (e) { uploadProgress: function (e) {
if (e.lengthComputable) { if (e.lengthComputable) {
let completedPercentage = Math.round((e.loaded * 100) / e.total); 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