Переглянути джерело

only display album select when user is logged in

It still needs additional styling and stuff
Onestay 7 роки тому
батько
коміт
81f1707835
2 змінених файлів з 19 додано та 5 видалено
  1. 14 3
      pages/home.html
  2. 5 2
      public/js/home.js

+ 14 - 3
pages/home.html

@@ -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>

+ 5 - 2
public/js/home.js

@@ -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();
 
 }