-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Shivanii30/master
Zip files and generate link
- Loading branch information
Showing
33 changed files
with
590 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
env/ |
Binary file not shown.
Binary file modified
BIN
-10 Bytes
(100%)
clickShare/clickShare/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-10 Bytes
(99%)
clickShare/home/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
-10 Bytes
(99%)
...ns/__pycache__/0002_rename_unique_id_folder_uid_files_created_at_and_more.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
-10 Bytes
(94%)
clickShare/home/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<!-- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> --> | ||
|
||
<style> | ||
/** | ||
* FilePond Custom Styles | ||
*/ | ||
.filepond--drop-label { | ||
color: #4c4e53; | ||
} | ||
|
||
.filepond--label-action { | ||
-webkit-text-decoration-color: #babdc0; | ||
text-decoration-color: #babdc0; | ||
} | ||
|
||
.filepond--panel-root { | ||
border-radius: 2em; | ||
background-color: #edf0f4; | ||
height: 1em; | ||
} | ||
|
||
.filepond--item-panel { | ||
background-color: #595e68; | ||
} | ||
|
||
.filepond--drip-blob { | ||
background-color: #7f8a9a; | ||
} | ||
|
||
/** | ||
* Page Styles | ||
*/ | ||
html { | ||
padding: 3vh 0 0; | ||
} | ||
|
||
body { | ||
max-width: 28em; | ||
margin: 0 auto; | ||
background-color: #03a9f4; | ||
} | ||
.background { | ||
|
||
border-radius: 5px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.clipboard { | ||
border: 0; | ||
padding: 15px; | ||
border-radius: 3px; | ||
background-image: linear-gradient(135deg, #FDEB71 10%, #F8D800 100%); | ||
cursor: pointer; | ||
color: #04048c; | ||
font-family: "Karla", sans-serif; | ||
font-size: 16px; | ||
position: relative; | ||
top: 0; | ||
transition: all 0.2s ease; | ||
} | ||
body .clipboard:hover { | ||
top: 2px; | ||
} | ||
body p { | ||
font-weight: 700; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet"> | ||
<link href="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css" rel="stylesheet"> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/filepond/4.30.3/filepond.min.js" | ||
integrity="sha512-AuMJiyTn/5k+gog21BWPrcoAC+CgOoobePSRqwsOyCSPo3Zj64eHyOsqDev8Yn9H45WUJmzbe9RaLTdFKkO0KQ==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> | ||
<script src="https://unpkg.com/jquery-filepond/filepond.jquery.js"></script> | ||
<script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.js"></script> | ||
|
||
|
||
<div class="text-center"> | ||
|
||
<img src="/media/image/download.svg" class="img-fluid img-responsive" style="height: 200px;"> | ||
</div> | ||
|
||
|
||
<div class="carad mt-5" > | ||
<div class="card-bodqy"> | ||
|
||
|
||
<div class="background"> | ||
<center> | ||
<a href="/media/zip/{{uid}}.zip" class="clipboard">Download Files</a> | ||
<p>Have you already clicked?</p> | ||
</center> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<script src="https://unpkg.com/filepond/dist/filepond.min.js"></script> | ||
|
||
|
||
|
||
|
||
|
||
<script> | ||
$(function () { | ||
$.fn.filepond.registerPlugin(FilePondPluginImagePreview, ); | ||
$('.my-pond').filepond(); | ||
$('.my-pond').filepond('allowMultiple', true); | ||
$('.my-pond').on('FilePond:addfile', function (e) { | ||
console.log('file added event', e); | ||
}); | ||
}); | ||
</script> | ||
|
||
</body> | ||
|
||
</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,12 +1,185 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<!-- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> --> | ||
|
||
<style> | ||
/** | ||
* FilePond Custom Styles | ||
*/ | ||
.filepond--drop-label { | ||
color: #4c4e53; | ||
} | ||
|
||
.filepond--label-action { | ||
-webkit-text-decoration-color: #babdc0; | ||
text-decoration-color: #babdc0; | ||
} | ||
|
||
.filepond--panel-root { | ||
border-radius: 2em; | ||
background-color: #edf0f4; | ||
height: 1em; | ||
} | ||
|
||
.filepond--item-panel { | ||
background-color: #595e68; | ||
} | ||
|
||
.filepond--drip-blob { | ||
background-color: #7f8a9a; | ||
} | ||
|
||
/** | ||
* Page Styles | ||
*/ | ||
html { | ||
padding: 3vh 0 0; | ||
} | ||
|
||
body { | ||
max-width: 28em; | ||
margin: 0 auto; | ||
background-color: #03a9f4; | ||
} | ||
|
||
.background { | ||
|
||
border-radius: 5px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.clipboard { | ||
border: 0; | ||
padding: 15px; | ||
border-radius: 3px; | ||
background-image: linear-gradient(135deg, #FDEB71 10%, #F8D800 100%); | ||
cursor: pointer; | ||
color: #04048c; | ||
font-family: "Karla", sans-serif; | ||
font-size: 16px; | ||
position: relative; | ||
top: 0; | ||
transition: all 0.2s ease; | ||
} | ||
|
||
body .clipboard:hover { | ||
top: 2px; | ||
} | ||
|
||
body p { | ||
font-weight: 700; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
UI will be Rendered Here. | ||
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet"> | ||
<link href="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css" | ||
rel="stylesheet"> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/filepond/4.30.3/filepond.min.js" | ||
integrity="sha512-AuMJiyTn/5k+gog21BWPrcoAC+CgOoobePSRqwsOyCSPo3Zj64eHyOsqDev8Yn9H45WUJmzbe9RaLTdFKkO0KQ==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> | ||
<script src="https://unpkg.com/jquery-filepond/filepond.jquery.js"></script> | ||
<script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.js"></script> | ||
|
||
|
||
<div class="text-center"> | ||
|
||
<img src="/media/image/undraw.svg" class="img-fluid img-responsive" style="height: 200px;"> | ||
</div> | ||
|
||
<input type="file" class="my-pond mt-4" multiple name="filepond" /> | ||
|
||
<div class="text-center"> | ||
<button class="btn btn-success" onclick="upload_file()">Upload File</button> | ||
</div> | ||
|
||
<div class="carad mt-3" id="btn" style="display: none;"> | ||
<div class="card-bodqy"> | ||
|
||
|
||
<div class="background"> | ||
<center> | ||
<button onclick="copyClip()" class="clipboard">Click me to copy current Url</button> | ||
<p>Have you already clicked?</p> | ||
</center> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<script src="https://unpkg.com/filepond/dist/filepond.min.js"></script> | ||
|
||
|
||
|
||
|
||
|
||
<script> | ||
FilePond.registerPlugin( | ||
FilePondPluginImagePreview, | ||
|
||
); | ||
|
||
const pond = FilePond.create( | ||
document.querySelector('.my-pond') | ||
); | ||
|
||
var url = null | ||
|
||
function upload_file() { | ||
var files = pond.getFiles() | ||
|
||
var formdata = new FormData() | ||
|
||
for (var i = 0; i < files.length; i++) { | ||
formdata.append('files', files[i].file) | ||
} | ||
|
||
fetch('/handle/', { | ||
method: 'POST', | ||
headers: { | ||
'X-CSRFToken': "{{csrf_token}}" | ||
}, | ||
body: formdata | ||
}).then(res => res.json()) | ||
.then(result => { | ||
console.log(result) | ||
|
||
url = `http://127.0.0.1:8000/download/${result.data.folder}` | ||
|
||
document.getElementById('btn').style.display = '';df -h | ||
|
||
|
||
}) | ||
|
||
} | ||
|
||
function copyClip() { | ||
console.log('dd') | ||
|
||
|
||
/* Copy the text inside the text field */ | ||
navigator.clipboard.writeText(url); | ||
|
||
/* Alert the copied text */ | ||
alert("Copied the text: " + url); | ||
} | ||
</script> | ||
|
||
</body> | ||
|
||
</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
Oops, something went wrong.