Преглед изворни кода

Replace login/reg functionality. Change minor formatting problems.

Lee Morgan пре 6 година
родитељ
комит
74bb5d5e74
3 измењених фајлова са 16 додато и 22 уклоњено
  1. 7 15
      branchNotes.txt
  2. 6 6
      views/landingPage/landing.ejs
  3. 3 1
      views/landingPage/register.js

+ 7 - 15
branchNotes.txt

@@ -1,17 +1,9 @@
-v 1.  The login and register forms should not be partials because they are only used in one place.  
-    Only use partials if they are going to be used in multiple places
-    In the future we can easily turn them into partials if we need to reuse it.
-    This also means that their css should be in the landing.css and not their own css file
+I have updated the login and registration so that you can create an account and then login with it.
 
-v 2.  You have css in landing.css that applies to partials, this should never be.
-    However, this will be solved once you fix #1, so you can ignore this problem
+1.  Create an account and check the rest of the website.
+    A lot of the work style that you changed affects every other page and breaks things.
+    This is why I told you you really should not add style to "shared.css" unless you are absolute certain that you want it to affect every single page.
+    You need to go through and get rid of all of these negative affects.
+    Maybe go through "shared.css" and move all that code to the more local "landing.css"
 
-v 3.  The register strand does show the background picture, but the login strand does
-
-v 5.  In shared.css, move .button-join class to the "header partial" section further down.  
-    The button-join class is only found in the header
-
-v6.  The "link" class that you created in shared.css is under the "banner partial" section.
-    It is not part of the banner partial.  It needs to be moved to an appropriate place.  Probaby landing.css - moved to main area of shared.css since this should be apply to all pages.
-
-7.  In shared.css.  You create style for h1, h3 and label.  This belongs near the top with all of the other general, site-wide style.
+Other than that, everything seems good to me.  Fix those side effects on the rest of the site and everything should be ready to go.

+ 6 - 6
views/landingPage/landing.ejs

@@ -44,30 +44,30 @@
         </div>
 
         <div id="registerStrand">
-            <form onsubmit="basicInfoObj.submit()">
+            <form onsubmit="registerObj.submit()">
                 <h1> Please Sign Up </h1>
 
                 <h3 class="link" onclick="loginObj.display()"> Or Register with Clover </h3>
 
                 <label id="nameLabel">Restaurant Name
-                    <input class="input" id="regName" type="text">
+                    <input class="input" id="regName" name="name" type="text" required>
                 </label>
         
                 <label>Email
-                    <input type="text" id="regEmail" type="email" required>
+                    <input type="text" id="regEmail" name="email" type="email" required>
                 </label>
         
                 <label>Password
-                    <input type="password" id="regPass" type="password" required>
+                    <input type="password" id="regPass" name="password" type="password" required>
                 </label>
         
                 <label>Confirm Password
-                    <input type="password" id="regConfirmPass" type="password" required>
+                    <input type="password" id="regConfirmPass" name="confirmPassword" type="password" required>
                 </label>
         
                 <div id="agreement">
                     <label class="container">
-                        <input type="checkbox">
+                        <input id="checkAgree" type="checkbox">
 
                         <span class="checkmark"></span>
         

+ 3 - 1
views/landingPage/register.js

@@ -25,7 +25,9 @@ let registerObj = {
         let checkbox = document.querySelector("#checkAgree");
 
         if(checkbox.checked){
-            if(validator.isSanitary(document.querySelector("#restName").value)){
+            if(validator.isSanitary(document.querySelector("#regName").value)){
+                form.action = "merchant/create/none";
+                form.method = "post";
                 form.submit();
             }
         }else{