Browse Source

Remove custom date

Unknown 7 years ago
parent
commit
5ce37d5030

+ 83 - 14
canvas/css/canvas.css

@@ -134,8 +134,17 @@ a.logo img {
 
 /* User area button and dropdown menu in the header: only shown when logged in */
 
-.form-header .user-profile {
-    margin-top: 7px;
+.form-header #collaborators-container {
+    position: absolute;
+    top: 21px;
+    right: 300px;
+    width: 250px;
+}
+.form-header #user-profile-container {
+    position: absolute;
+    top: 21px;
+    right: 0;
+    width: 300px;
 }
 .form-header .dropdown {
     font-size: 1em;
@@ -1403,11 +1412,22 @@ div.dialog-content {
         width: 100%;
     }
     /* User area button and dropdown menu in the header: only shown when logged in */
-    .form-header .user-profile {
-        margin-top: 20px;
+    .form-header #collaborators-container {
+        position: static;
+        margin: 2em auto 0 auto;
     }
-    .form-header .collaborators {
-        margin-bottom: -15px;
+    .form-header #user-profile-container {
+        position: static;
+        margin: 1em auto 0 auto;
+    }
+    .form-header #collaborators {
+        text-align: center;
+    }
+    .form-header #user-profile {
+        text-align: center;
+    }
+    .form-header #user-profile ul {
+        margin-left: 28px;
     }
     /*
     .form-header .dropdown {
@@ -1527,12 +1547,31 @@ div.dialog-content {
         width: 100%;
     }
     /* User area button and dropdown menu in the header: only shown when logged in */
+    .form-header #collaborators-container {
+        position: static;
+        margin: 2em auto 0 auto;
+    }
+    .form-header #user-profile-container {
+        position: static;
+        margin: 1em auto 0 auto;
+    }
+    .form-header #collaborators {
+        text-align: center;
+    }
+    .form-header #user-profile {
+        text-align: center;
+    }
+    .form-header #user-profile ul {
+        margin-left: 28px;
+    }
+    /*
     .form-header .user-profile {
         margin-top: 20px;
     }
     .form-header .collaborators {
         margin-bottom: -15px;
     }
+     */
     /*
     .form-header .user-profile {
         margin-left: 0;
@@ -1614,21 +1653,39 @@ div.dialog-content {
         margin-top: 1.85em;
     }
     /* User area button and dropdown menu in the header: only shown when logged in */
+    .form-header #collaborators-container {
+        position: static;
+        margin: 2em auto 0 auto;
+    }
+    .form-header #user-profile-container {
+        position: static;
+        margin: 1em auto 0 auto;
+    }
+    .form-header #collaborators {
+        text-align: center;
+    }
+    .form-header #user-profile {
+        text-align: center;
+    }
+    .form-header #user-profile ul {
+        margin-left: 28px;
+    }
+    /*
     .form-header .user-profile {
         margin-top: 20px;
     }
     .form-header .collaborators {
         margin-bottom: -15px;
     }
+     */
     /*
     .form-header .dropdown {
         text-align: center;
-        /*
-        margin-left: 0;
-        width: 60%;
-        margin: 2em auto;
-         */
+        // margin-left: 0;
+        // width: 60%;
+        // margin: 2em auto;
     }
+     */
     /*
     .form-header .dropdown {
         width: 50%;
@@ -1730,12 +1787,24 @@ div.dialog-content {
         margin-top: 2em;
     }
     /* User area button and dropdown menu in the header: only shown when logged in */
+    .form-header #collaborators-container {
+        position: absolute;
+        top: 54px;
+        right: 250px;
+    }
+    .form-header #user-profile-container {
+        position: absolute;
+        top: 54px;
+        right: -25px;
+    }
+    /*
     .form-header .user-profile {
-        /* margin-left: 0; */
-        /* width: 60%; */
+        // margin-left: 0;
+        // width: 60%;
         margin-top: 19px;
-        /* transition: all 0.4s; */
+        // transition: all 0.4s;
     }
+     */
     /* Collaborators window */
     /*
     div#collaborators-window {

+ 1 - 1
canvas/css/dashboard.css

@@ -68,7 +68,7 @@ a.logo img {
     margin: 2.5% 2.5% 0 2.5%;
     background-color: #546e7a;/*default*/
     border-radius: 5px;
-    padding: 1em;
+    padding: 2.5em 1em 1em 1em;
     height:15em;
     transition:all 0.3s;
 }

+ 17 - 15
canvas/index.php

@@ -61,15 +61,30 @@
                         <label class="project_title">Project Title</label>
                         <input class="proj_title" name="field_00[]" type="text" />
                     </div>
+                    <!--
                     <div class="col-md-3 ">
                         <label class="project_date">Date</label>
                         <input class="proj_date" name="field_00[]" type="date" />
                     </div>
+                    -->
+                    <!-- Collaborators -->
+                    <div class="col-md-3" id="collaborators-container">
+                        <?php if(!empty($name)) { ?>
+                        <!-- Bootstrap dropdown component -->
+                        <div class="dropdown" id="collaborators">
+                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1">
+                                <!-- <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> -->
+                                <img src="../icon/collaborators.svg" alt="collaborators" /><span>Collaborators (0 active)</span>
+                                <!-- <span class="caret"></span> -->
+                            </button>
+                        </div>
+                        <?php } ?>
+                    </div>
                     <!-- Log in -->
-                    <div class="col-md-3 ">
+                    <div class="col-md-3" id="user-profile-container">
                         <?php if(!empty($name)) { ?>
                         <!-- Bootstrap dropdown component -->
-                        <div class="dropdown user-profile">
+                        <div class="dropdown" id="user-profile">
                             <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                 <img src="../icon/profile.svg"/><span><?php echo $name; ?></span>
                                 <span class="caret"></span>
@@ -83,19 +98,6 @@
                         </div>
                         <?php } ?>
                     </div>
-                    <!-- Collaborators -->
-                    <div class="col-md-3">
-                        <?php if(!empty($name)) { ?>
-                        <!-- Bootstrap dropdown component -->
-                        <div class="dropdown collaborators">
-                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1">
-                            <!-- <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> -->
-                                <img src="../icon/collaborators.svg" alt="collaborators" /><span>Collaborators (0 active)</span>
-                                <!-- <span class="caret"></span> -->
-                            </button>
-                        </div>
-                        <?php } ?>
-                    </div>
                 </div>
                 
                 <!-- Jump to -->

+ 19 - 23
canvas/js/canvas.js

@@ -150,7 +150,7 @@ $(document).ready(function() {
     ================================================= */
     
     // If the user clicks on the "Collaborators" button, show the collaborators window
-    $("div.collaborators button").on("click", function() {
+    $("div#collaborators button").on("click", function() {
         // Show the collaborators window
         $("div#shadow").css("display", "block");
         $("div#collaborators-window").css("display", "block");
@@ -339,7 +339,7 @@ $(document).ready(function() {
                     $("div#collaborators-window table").html(htmlToAppend);
                     
                     // Update the button to open the collaborators window
-                    $("div.collaborators button span").text("Collaborators (" + $("td.collaborators-active span").length + " active)");
+                    $("div#collaborators button span").text("Collaborators (" + $("td.collaborators-active span").length + " active)");
                     
                     // Toggle the text explaining that the canvas is saved automatically
                     $("p#save-canvas").hide();
@@ -1447,37 +1447,33 @@ $(document).ready(function() {
     Getting the current date
     ================================================= */
     
-    /*
-    var fullDate = new Date();
-    var twoDigitMonth = fullDate.getMonth() + "";
-    if (twoDigitMonth.length == 1) twoDigitMonth = "0" + twoDigitMonth;
-    var twoDigitDate = fullDate.getDate() + "";
-    if (twoDigitDate.length == 1) twoDigitDate = "0" + twoDigitDate;
-
-    var currentDate = fullDate.getFullYear() + "-" + twoDigitMonth + "-" + twoDigitDate;
-    // Set the current date in the date input field
-    $('.proj_date').val(currentDate);
-     */
-        
     var fullDate = new Date();
+    var fourDigitYear = fullDate.getFullYear();
     var twoDigitMonth = fullDate.getMonth() + 1 + "";
-    if (twoDigitMonth.length == 1) twoDigitMonth = "0" + twoDigitMonth;
     var twoDigitDate = fullDate.getDate() + "";
-    if (twoDigitDate.length == 1) twoDigitDate = "0" + twoDigitDate;
     
-    var currentDate = fullDate.getFullYear() + "-" + twoDigitMonth + "-" + twoDigitDate;
+    if(twoDigitMonth.length == 1) {
+        twoDigitMonth = "0" + twoDigitMonth;
+    }
+    
+    if(twoDigitDate.length == 1) {
+        twoDigitDate = "0" + twoDigitDate;
+    }
+    
+    var currentDate = fourDigitYear + "-" + twoDigitMonth + "-" + twoDigitDate;
+    
     // Set the current date in the date input field
-    $('.proj_date').val(currentDate);
+    // $('.proj_date').val(currentDate);
     
     /* ================================================
     USER LOGS OUT (dropdown menu)
     ================================================= */
     
-    $('.user-profile').on('click', '#logout', function() {
+    $('#user-profile').on('click', '#logout', function() {
         var url = 'php/logout.php';
         $.post(url, function(data, status) {
             if (data == 200) {
-                $('.user-profile').hide();
+                $('#user-profile').hide();
                 $('.invited-members').hide();
                 window.location.href="https://www.ethicscanvas.org";
             }
@@ -1506,7 +1502,7 @@ $(document).ready(function() {
                 if (key === 'field_00[]') {
                     $('.form-header').find('input.proj_title').val(value[
                         0]);
-                    $('.form-header').find('input.proj_date').val(value[1]);
+                    // $('.form-header').find('input.proj_date').val(value[1]);
                 }
                 else if (key !== 'new_item') {
                     if ($.type(value) === "array") {
@@ -2015,8 +2011,8 @@ $(document).ready(function() {
         
         // php variables are retieved in the header of the canvas index.php as js variables -->
         var name_save_canvas = $('.form-header').find('.proj_title').val();
-        var date_save_canvas = $('.form-header').find('.proj_date').val();
-        // var date_save_canvas = currentDate;
+        // var date_save_canvas = $('.form-header').find('.proj_date').val();
+        var date_save_canvas = currentDate;
         var save_canvas_obj = {
             'email_save_canvas': email_save_canvas,
             'name_save_canvas': name_save_canvas,

+ 2 - 2
canvas/js/dashboard.js

@@ -48,7 +48,7 @@ $(function() {
                 canvas_color_index = index % 5;
             }
             
-            var canvasGalleryHTML = '<div class="canvas-gallery-item col-md-4 col-sm-6 text-center" id="' + canvasItem.canvas_id + '"><div class="col-md-12 color' + canvas_color_index + '"><h4>Canvas Title:</h4><h3>' + canvasItem.canvas_name + '</h3><p>Created:</p><p>' + canvasItem.canvas_date + '</p></div><button type="button" class="remove-canvas"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span>Remove</button></div>';
+            var canvasGalleryHTML = '<div class="canvas-gallery-item col-md-4 col-sm-6 text-center" id="' + canvasItem.canvas_id + '"><div class="col-md-12 color' + canvas_color_index + '"><h4>Canvas Title:</h4><h3>' + canvasItem.canvas_name + '</h3><p>Created:<br />' + canvasItem.canvas_date + '</p></div><button type="button" class="remove-canvas"><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span>Remove</button></div>';
             //the added divs are appended to the outer gallery div .user-canvas-gallery
             $('.user-dashboard').find('.user-canvas-gallery').append(canvasGalleryHTML);
         }); // End of $.each loop for the user canvas data
@@ -97,7 +97,7 @@ $(function() {
                 canvas_color_index = index % 5;
             }
             
-            var canvasGalleryHTML = '<div class="canvas-gallery-item col-md-4 col-sm-6 text-center" id="' + canvasItem.canvas_id + '"><div class="col-md-12 color' + canvas_color_index + '"><h4>Canvas Title:</h4><h3>' + canvasItem.canvas_name + '</h3><p>Owner:</p><p>' + canvasItem.owner + '</p></div></div>';
+            var canvasGalleryHTML = '<div class="canvas-gallery-item col-md-4 col-sm-6 text-center" id="' + canvasItem.canvas_id + '"><div class="col-md-12 color' + canvas_color_index + '"><h4>Canvas Title:</h4><h3>' + canvasItem.canvas_name + '</h3><p>Owner:<br />' + canvasItem.owner + '</p></div></div>';
             //the added divs are appended to the outer gallery div .user-canvas-gallery
             $('.user-dashboard').find('.shared-canvases-gallery').append(canvasGalleryHTML);
         }); // End of $.each loop for the user canvas data

+ 1 - 0
canvas/json/E2eq5ckkg4.json

@@ -0,0 +1 @@
+{"canvas_id":"E2eq5ckkg4","username":"a.burburan@gmail.com","field_00[]":"OK hehe","new_item":"","share-canvas-email":"","add-collaborator":"Please enter an email address..."}

+ 1 - 1
canvas/json/FwkZHzFZJs.json

@@ -1 +1 @@
-{"canvas_id":"FwkZHzFZJs","username":"a.burburan@gmail.com","field_00[]":["Testing",""],"new_item":"","share-canvas-email":"","add-collaborator":"Please enter an email address...","field_01[]":["ia1","ia2","ia3"],"field_03[]":"b1","field_04[]":"r1","field_06[]":"gc1","field_10[]":["ui1","ui2"]}
+{"canvas_id":"FwkZHzFZJs","username":"a.burburan@gmail.com","field_00[]":["Test","2017-07-31"],"new_item":"","share-canvas-email":"","add-collaborator":"Please enter an email address...","field_01[]":["ia1","ia2","ia3"],"field_03[]":"b1","field_04[]":"r1","field_06[]":"gc1","field_10[]":["ui1","ui2"]}