only display album select when user is logged in

It still needs additional styling and stuff
This commit is contained in:
Onestay 2017-04-23 14:09:44 +02:00
parent e2885bd37c
commit 81f1707835
2 changed files with 19 additions and 5 deletions

View File

@ -45,16 +45,27 @@
<div class="hero-body">
<div class="container">
<p id="b">
<img class='logo' src="/images/logo_smol.png">
<img class="logo" src="/images/logo_smol.png">
</p>
<h1 class="title">loli-safe</h1>
<h2 class="subtitle">A <strong>modern</strong> self-hosted file upload service</h2>
<h3 class="subtitle" id="maxFileSize"></h2>
<h3 class="subtitle" id="maxFileSize"></h3>
<div class="columns">
<div class="column is-hidden-mobile"></div>
<div class="column" id='uploadContainer'>
<div class="column" id="uploadContainer">
<a id="loginToUpload" href="/auth" class="button is-danger">Running in private mode. Log in to upload.</a>
<div class="field" id="albumDiv" style="display: none">
<label class="label">Album</label>
<p class="control">
<span class="select">
<select>
<option>Album 1</option>
<option>Album 2</option>
</select>
</span>
</p>
</div>
</div>
<div class="column is-hidden-mobile"></div>
</div>

View File

@ -16,7 +16,6 @@ upload.checkIfPublic = function(){
return swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error");
console.log(error);
});
}
upload.preparePage = function(){
@ -61,6 +60,10 @@ upload.verifyToken = function(token, reloadOnError){
}
upload.prepareUpload = function(){
if (upload.token) {
document.getElementById('albumDiv').style.display = 'block';
}
div = document.createElement('div');
div.id = 'dropzone';
@ -74,7 +77,7 @@ upload.prepareUpload = function(){
document.getElementById('loginLinkText').innerHTML = 'Create an account and keep track of your uploads';
document.getElementById('uploadContainer').appendChild(div);
upload.prepareDropzone();
}