Commits

jasonyeo  committed 2274f7c Draft

reduced span for checkout form

  • Participants
  • Parent commits 8320538

Comments (0)

Files changed (5)

File static/js/app.js

             'product/:id': 'showProduct',
             'checkout': 'showCheckout',
             'checkout2': 'showCheckout2',
-            'checkout3': 'showCheckout3'
+            'checkout3': 'showCheckout3',
         },
 
         showPurchase: function() {
             new app.CheckoutView();
         },
 
-        showCheckout2: function() {
-            new app.Checkout2View();
-        },
-
         showCheckout3: function() {
             new app.Checkout3View();
-        }
+        },
     });
     var AekiRouter = new Workspace();
 

File static/js/views/checkout.js

                 url: "/mail",
                 data: JSON.stringify(mail),
                 contentType: "application/json; charset=utf-8",
+                async: true,
                 success: function(data) {
                     var str = 'Sent: ' + data
                     console.log(str);

File templates/branchInfo.html

                         </div>
                     </div>
                 </div>
+            </div>
+            <!-- End of retrieved order div --> 
 
-            </div>
-        </div>
-        <!-- End of retrieved order div --> 
+            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+            <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
 
-        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
-        <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
-        <script>
-            
-            $(document).ready(function() {
-                retrieveAllBranches();
-                loadBranch(1);
-            });
-            
-            function retrieveAllBranches()
-            {
-                console.log("retrieving all branches");
-                $.getJSON("http://lowe.jschua.com/DinoPos/api/branches/",
-                function (data) {
-                    // On success, 'data' contains a list of branch.
-                    $.each(data, function (key, val) {
-                        
-                        var branchName = val.Address;
-                        var branchId = val.Branch_ID
-                        
-                        console.log("branch name =="+val.Name);
-                        console.log("branch iD =="+val.Branch_ID);
-                        
-                        if(key ==0)
-                            var branchNavDetail =  '<li id=\"'+branchId+'\" class=\"active\" onclick=\"loadBranch('+branchId+')\"><a href=\"#\"><br>'+ branchName +'<i class=\"icon-chevron-right pull-right\"></i></a></li>';
-                        else
-                            var branchNavDetail =  '<li id=\"'+branchId+'\" onclick=\"loadBranch('+branchId+')\"><a href=\"#\"><br>'+ branchName +'<i class=\"icon-chevron-right pull-right\"></i></a></li>';        
-                        $('#branchNav').append(branchNavDetail);     
-                    });
-                })
-                .fail(
-                function (jqXHR, textStatus, err) {
-                    console.log("error = " +err);
+            <script>
+
+                $(document).ready(function() {
+                    console.log('ready');
+                    retrieveAllBranches();
+                    loadBranch(1);
                 });
 
-            }
-            
-            function loadBranch(branchId)
-            {
-                clearExistingBranch();
-                setNavActive(branchId);
-                $.getJSON("http://lowe.jschua.com/DinoPos/api/branches/" + branchId,
-                function (val) {
-       
-                    var branchDetailTab = document.getElementById("tab1");
-                    var branchMapTab = document.getElementById("tab2");
-                    
-                    /**set up tab 1 **/
-                    
-                    //Branch detail div
-                    var tabTopDiv = document.createElement("div");
-                    tabTopDiv.className = "well well-large";
-                    
-                    //content
-                    var contentHeader = "<legend> Branch Information </legend>";
-                    var branchName = "Branch name: " +val.Address + "</br>";
-                    var branchLocation = "Branch Location: "+val.Name + "</br>";
-                    var branchTel = "Branch Telephone: "+val.Tel +"</br>";
-                    var branchMail = "Branch Email: "+val.Email +"</br>";
-                    var branchOps = "Store Operating Hours: 10am to 10 pm daily </br>";
-                    tabTopDiv.innerHTML = contentHeader + branchName + branchLocation + branchTel + branchMail + branchOps;
-                    
-                    //In case of fire div
-                    var tabBtmDiv = document.createElement("div");
-                    tabBtmDiv.className = "well well-large";
-                    
-                    //content
-                    var fireHeader = "<Legend> In case of fire emergency </legend>";
-                    var fireContent = "Stay calm, wait for announcement over the PA.";
-                    
-                    tabBtmDiv.innerHTML = fireHeader + fireContent; 
-                    
-                    branchDetailTab.appendChild(tabTopDiv);
-                    branchDetailTab.appendChild(tabBtmDiv);
-                    
-                    /**set up tab 2 **/
-                    var tabMapImage = document.createElement("img");
-                    tabMapImage.className = "img-rounded";
-                    tabMapImage.setAttribute("src", "static/img/ikea-map.jpg");
-                    branchMapTab.appendChild(tabMapImage);
-                    
-                })
-                .fail(
-                function (jqXHR, textStatus, err) {
-                    console.log("error = "+err)
-                });
+                function retrieveAllBranches()
+                {
+                    console.log("retrieving all branches");
+                    $.getJSON("http://lowe.jschua.com/DinoPos/api/branches/",
+                    function (data) {
+                        // On success, 'data' contains a list of branch.
+                        $.each(data, function (key, val) {
 
-            }
-            
-            function clearExistingBranch() {
-                 
-                var tab1Node = document.getElementById("tab1");
-               
-                while (tab1Node.firstChild) {
-                    tab1Node.removeChild(tab1Node.firstChild);
+                            var branchName = val.Address;
+                            var branchId = val.Branch_ID
+
+                            console.log("branch name =="+val.Name);
+                            console.log("branch iD =="+val.Branch_ID);
+
+                            if(key ==0)
+                            var branchNavDetail =  '<li id=\"'+branchId+'\" class=\"active\" onclick=\"loadBranch('+branchId+')\"><a href=\"#\"><br>'+ branchName +'<i class=\"icon-chevron-right pull-right\"></i></a></li>';
+                            else
+                            var branchNavDetail =  '<li id=\"'+branchId+'\" onclick=\"loadBranch('+branchId+')\"><a href=\"#\"><br>'+ branchName +'<i class=\"icon-chevron-right pull-right\"></i></a></li>';        
+                            $('#branchNav').append(branchNavDetail);     
+                        });
+                    })
+                    .fail(
+                    function (jqXHR, textStatus, err) {
+                        console.log("error = " +err);
+                    });
+
                 }
-                
-                var tab2Node = document.getElementById("tab2");
-               
-                while (tab2Node.firstChild) {
-                    tab2Node.removeChild(tab2Node.firstChild);
+
+                function loadBranch(branchId)
+                {
+                    clearExistingBranch();
+                    setNavActive(branchId);
+                    $.getJSON("http://lowe.jschua.com/DinoPos/api/branches/" + branchId,
+                    function (val) {
+
+                        var branchDetailTab = document.getElementById("tab1");
+                        var branchMapTab = document.getElementById("tab2");
+
+                        /**set up tab 1 **/
+
+                        //Branch detail div
+                        var tabTopDiv = document.createElement("div");
+                        tabTopDiv.className = "well well-large";
+
+                        //content
+                        var contentHeader = "<legend> Branch Information </legend>";
+                        var branchName = "Branch name: " +val.Address + "</br>";
+                        var branchLocation = "Branch Location: "+val.Name + "</br>";
+                        var branchTel = "Branch Telephone: "+val.Tel +"</br>";
+                        var branchMail = "Branch Email: "+val.Email +"</br>";
+                        var branchOps = "Store Operating Hours: 10am to 10 pm daily </br>";
+                        tabTopDiv.innerHTML = contentHeader + branchName + branchLocation + branchTel + branchMail + branchOps;
+
+                        //In case of fire div
+                        var tabBtmDiv = document.createElement("div");
+                        tabBtmDiv.className = "well well-large";
+
+                        //content
+                        var fireHeader = "<Legend> In case of fire emergency </legend>";
+                        var fireContent = "Stay calm, wait for announcement over the PA.";
+
+                        tabBtmDiv.innerHTML = fireHeader + fireContent; 
+
+                        branchDetailTab.appendChild(tabTopDiv);
+                        branchDetailTab.appendChild(tabBtmDiv);
+
+                        /**set up tab 2 **/
+                        var tabMapImage = document.createElement("img");
+                        tabMapImage.className = "img-rounded";
+                        tabMapImage.setAttribute("src", "static/img/ikea-map.jpg");
+                        branchMapTab.appendChild(tabMapImage);
+
+                    })
+                    .fail(
+                    function (jqXHR, textStatus, err) {
+                        console.log("error = "+err)
+                    });
+
                 }
-                
-            }
-            
-            function setNavActive(branchId) {
-                
-                var node = document.getElementById("branchNav").childNodes;
-                
-                for(i=0;i<node.length;i++)
-                {
-                    if(node[i].id != branchId)
+
+                function clearExistingBranch() {
+
+                    var tab1Node = document.getElementById("tab1");
+
+                    while (tab1Node.firstChild) {
+                        tab1Node.removeChild(tab1Node.firstChild);
+                    }
+
+                    var tab2Node = document.getElementById("tab2");
+
+                    while (tab2Node.firstChild) {
+                        tab2Node.removeChild(tab2Node.firstChild);
+                    }
+
+                }
+
+                function setNavActive(branchId) {
+
+                    var node = document.getElementById("branchNav").childNodes;
+
+                    for(i=0;i<node.length;i++)
+                    {
+                        if(node[i].id != branchId)
                         node[i].className = "";
-                    else
+                        else
                         node[i].className ="active";
+                    }
+
                 }
-               
-            }
-            
-            
-        </script>
 
-    </body>
-</html>
+
+            </script>
+
+        </body>
+    </html>

File templates/checkOut.html

     </div>
 
     <!--payment information request-->
-    <div class="span9">
+    <div class="span8">
         <br/>
 
         <div id="form-container">

File templates/index.html

             Delivery Gopher
         </script>
 
-        </script>
+
         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
         <script src="../static/js/lib/jquery/noty/jquery.noty.js"></script>
         <script src="../static/js/lib/jquery/noty/topCenter.js"></script>