bmc-reboot: add skeleton api calls

Change-Id: Ib3520165b726c793a8a8bb98384894c9771b241d
Signed-off-by: Michael Davis <michael.s.davis@ibm.com>
diff --git a/src/bmc-reboot.html b/src/bmc-reboot.html
index 61427eb..22df0c2 100644
--- a/src/bmc-reboot.html
+++ b/src/bmc-reboot.html
@@ -3,15 +3,23 @@
         <h1>Reboot BMC</h1>
     </div>
 
-    <div class="row column">
+    <div class="row column  btm-border-grey">
         <span class="bmc-reboot__status-log inline">BMC last reboot at {{dataService.last_updated |date:'h:mm:ss on MM/dd/yyyy'}}</span>
     </div>
 
-    <div class="row column">
-
-            <div class="row column btm-border-grey bmc-reboot-option" ng-class="{disabled: confirm && !bmcreboot_confirm, transitionAll: confirm && bmcreboot_confirm}">
-                <button id="bmc__reboot" class="btn-secondary" ng-click="bmcrebootConfirm()" role="button">Reboot BMC</button>
-                <confirm title="Reboot BMC" message="perform an orderly shutdown" confirm="bmcreboot_confirm" callback="bmcReboot"></confirm>
-            </div>
-        </div>
-</div>
\ No newline at end of file
+    <div class="row column btm-border-grey bmc-reboot-option"
+         ng-class="{transitionAll: confirm && immediately_confirm}">
+        <ul>
+            <li>Rebooting the BMC causes your browser to lose contact with the BMC for several minutes.</li>
+            <li>When the BMC software has started, you can then log in again.</li>
+            <li>If the Log In button is not enabled after several minutes, you may need to point your browser to the
+                BMC’s address and log in again.
+            </li>
+        </ul>
+        <button id="bmc__reboot" class="btn-secondary" ng-click="bmcRebootConfirm()"><i>&#x21BB</i> Reboot BMC
+        </button>
+        <confirm title="Reboot the BMC"
+                 message="Rebooting the BMC causes your browser to lose contact with the BMC for several minutes."
+                 confirm="bmcReboot_confirm" cancel="bmcRebootCancel"></confirm>
+    </div>
+</div>
diff --git a/src/js/controllers.js b/src/js/controllers.js
index e19f2e9..1b5df0f 100644
--- a/src/js/controllers.js
+++ b/src/js/controllers.js
@@ -1,164 +1,185 @@
- angular
- .module('app.controllers', [])
-   .controller('loginController', ['$scope', '$window', 'APIUtils', 'dataService', 'userModel', function($scope, $window, APIUtils, dataService, userModel){
-    $scope.dataService = dataService;
+angular
+    .module('app.controllers', [])
+    .controller('loginController', ['$scope', '$window', 'APIUtils', 'dataService', 'userModel', function ($scope, $window, APIUtils, dataService, userModel) {
+        $scope.dataService = dataService;
 
-    $scope.tryLogin = function(username, password, event){
-        if(event.keyCode === 13){
-            $scope.login(username, password);
-        }
-    };
-    $scope.login = function(username, password){
-        $scope.error = false;
-        if(!username || username == "" ||
-           !password || password == ""){
-            return false;
-        }else{
-            if(userModel.login(username, password)){
-                $window.location.hash = '#/system-overview';
-            }else{
-                $scope.error = true;
+        $scope.tryLogin = function (username, password, event) {
+            if (event.keyCode === 13) {
+                $scope.login(username, password);
+            }
+        };
+        $scope.login = function (username, password) {
+            $scope.error = false;
+            if (!username || username == "" || !password || password == "") {
+                return false;
+            } else {
+                if (userModel.login(username, password)) {
+                    $window.location.hash = '#/system-overview';
+                } else {
+                    $scope.error = true;
+                }
             }
         }
-    }
- }])
- .controller('dashboardController', ['$scope', 'dataService', function($scope, dataService){
-    $scope.dataService = dataService;
- }])
- .controller('systemOverviewController', ['$scope', 'dataService', function($scope, dataService){
-    $scope.dataService = dataService;
- }])
- .controller('unitIDController', ['$scope', 'dataService', function($scope, dataService){
-    $scope.dataService = dataService;
- }])
- .controller('bmcRebootController', ['$scope', 'dataService', function($scope, dataService){
-    $scope.dataService = dataService;
- }])
-  .controller('powerOperationsController', ['$scope', 'APIUtils', 'dataService', function($scope, APIUtils, dataService){
-    $scope.dataService = dataService;
-    $scope.confirm = false;
-    $scope.power_confirm = false;
-    $scope.warmboot_confirm = false;
-    $scope.coldboot_confirm = false;
-    $scope.orderly_confirm = false;
-    $scope.immediately_confirm = false;
+    }])
+    .controller('dashboardController', ['$scope', 'dataService', function ($scope, dataService) {
+        $scope.dataService = dataService;
+    }])
+    .controller('systemOverviewController', ['$scope', 'dataService', function ($scope, dataService) {
+        $scope.dataService = dataService;
+    }])
+    .controller('unitIDController', ['$scope', 'dataService', function ($scope, dataService) {
+        $scope.dataService = dataService;
+    }])
+    .controller('bmcRebootController', ['$scope', 'dataService', function ($scope, dataService) {
+        $scope.dataService = dataService;
+        $scope.bmcReboot_confirm = false;
 
-    //@TODO: call api and get proper state
-    $scope.toggleState = function(){
-        dataService.server_state = (dataService.server_state == 'On') ? 'Off': 'On';
-    };
-
-    $scope.togglePower = function(){
-        var method = (dataService.server_state == 'On') ? 'chassisPowerOff' : 'chassisPowerOn';
-         //@TODO: show progress or set class orange
-        APIUtils[method](function(response){
-            //update state based on response
-            //error case?
-            if(response == null){
-                console.log("Failed request.");
-            }else{
-                dataService.server_state = response;
+        // BMC reboot
+        $scope.bmcReboot = function () {
+            //@TODO:show progress
+            APIUtils.bmcReboot(function (response) {
+                if (response) {
+                    //@TODO: set proper server state
+                } else {
+                    //@TODO:show error message
+                }
+                //@TODO:hide progress
+            });
+        };
+        $scope.bmcRebootConfirm = function () {
+            if ($scope.confirm) {
+                return;
             }
-        });
-    }
-    $scope.powerOnConfirm = function(){
-        if($scope.confirm) {
-            return;
-        }
-        $scope.confirm = true;
-        $scope.power_confirm = true;
-    };
-    $scope.warmReboot = function(){
-        //@TODO:show progress
-        APIUtils.hostPowerOff(function(response){
-            if(response){
-                APIUtils.hostPowerOn(function(response){
-                    if(response){
+            $scope.confirm = true;
+            $scope.bmcReboot_confirm = true;
+        };
+    }])
+    .controller('powerOperationsController', ['$scope', 'APIUtils', 'dataService', function ($scope, APIUtils, dataService) {
+        $scope.dataService = dataService;
+        $scope.confirm = false;
+        $scope.power_confirm = false;
+        $scope.warmboot_confirm = false;
+        $scope.coldboot_confirm = false;
+        $scope.orderly_confirm = false;
+        $scope.immediately_confirm = false;
 
-                    }else{
-                        //@TODO:show error message
-                    }
-                    //@TODO:hide progress, set proper server state
-                });
-            }else{
-                //@TODO:hide progress & show error message
+        //@TODO: call api and get proper state
+        $scope.toggleState = function () {
+            dataService.server_state = (dataService.server_state == 'On') ? 'Off' : 'On';
+        };
+
+        $scope.togglePower = function () {
+            var method = (dataService.server_state == 'On') ? 'chassisPowerOff' : 'chassisPowerOn';
+            //@TODO: show progress or set class orange
+            APIUtils[method](function (response) {
+                //update state based on response
+                //error case?
+                if (response == null) {
+                    console.log("Failed request.");
+                } else {
+                    dataService.server_state = response;
+                }
+            });
+        }
+        $scope.powerOnConfirm = function () {
+            if ($scope.confirm) {
+                return;
             }
-        });
-    };
-    $scope.warmRebootConfirm = function(){
-        if($scope.confirm) {
-            return;
-        }
-        $scope.confirm = true;
-        $scope.warmboot_confirm = true;
-    };
+            $scope.confirm = true;
+            $scope.power_confirm = true;
+        };
+        $scope.warmReboot = function () {
+            //@TODO:show progress
+            APIUtils.hostPowerOff(function (response) {
+                if (response) {
+                    APIUtils.hostPowerOn(function (response) {
+                        if (response) {
 
-    $scope.coldReboot = function(){
-        //@TODO:show progress
-        APIUtils.chassisPowerOff(function(response){
-            if(response){
-                APIUtils.chassisPowerOn(function(response){
-                    if(response){
-
-                    }else{
-                        //@TODO:show error message
-                    }
-                    //@TODO:hide progress, set proper server state
-                });
-            }else{
-                //@TODO:hide progress & show error message
+                        } else {
+                            //@TODO:show error message
+                        }
+                        //@TODO:hide progress, set proper server state
+                    });
+                } else {
+                    //@TODO:hide progress & show error message
+                }
+            });
+        };
+        $scope.warmRebootConfirm = function () {
+            if ($scope.confirm) {
+                return;
             }
-        });
-    };
-    $scope.coldRebootConfirm = function(){
-        if($scope.confirm) {
-            return;
-        }
-        $scope.confirm = true;
-        $scope.coldboot_confirm = true;
-    };
+            $scope.confirm = true;
+            $scope.warmboot_confirm = true;
+        };
 
-    $scope.orderlyShutdown = function(){
-        //@TODO:show progress
-        APIUtils.hostPowerOff(function(response){
-            if(response){
-                APIUtils.chassisPowerOff(function(response){
-                    if(response){
+        $scope.coldReboot = function () {
+            //@TODO:show progress
+            APIUtils.chassisPowerOff(function (response) {
+                if (response) {
+                    APIUtils.chassisPowerOn(function (response) {
+                        if (response) {
 
-                    }else{
-                        //@TODO:show error message
-                    }
-                    //@TODO:hide progress, set proper server state
-                });
-            }else{
-                //@TODO:hide progress & show error message
+                        } else {
+                            //@TODO:show error message
+                        }
+                        //@TODO:hide progress, set proper server state
+                    });
+                } else {
+                    //@TODO:hide progress & show error message
+                }
+            });
+        };
+        $scope.coldRebootConfirm = function () {
+            if ($scope.confirm) {
+                return;
             }
-        });
-    };
-    $scope.orderlyShutdownConfirm = function(){
-        if($scope.confirm) {
-            return;
-        }
-        $scope.confirm = true;
-        $scope.orderly_confirm = true;
-    };
+            $scope.confirm = true;
+            $scope.coldboot_confirm = true;
+        };
 
-    $scope.immediateShutdown = function(){
-        //@TODO:show progress
-        APIUtils.chassisPowerOff(function(response){
-            if(response){
-                //@TODO: set proper server state
-            }else{
-                //@TODO:show error message
+        $scope.orderlyShutdown = function () {
+            //@TODO:show progress
+            APIUtils.hostPowerOff(function (response) {
+                if (response) {
+                    APIUtils.chassisPowerOff(function (response) {
+                        if (response) {
+
+                        } else {
+                            //@TODO:show error message
+                        }
+                        //@TODO:hide progress, set proper server state
+                    });
+                } else {
+                    //@TODO:hide progress & show error message
+                }
+            });
+        };
+        $scope.orderlyShutdownConfirm = function () {
+            if ($scope.confirm) {
+                return;
             }
-            //@TODO:hide progress
-        });
-    };
-    $scope.immediateShutdownConfirm = function(){
-        if($scope.confirm) {
-            return;
-        }
-        $scope.confirm = true;
-        $scope.immediately_confirm = true;
-    };
- }]);
+            $scope.confirm = true;
+            $scope.orderly_confirm = true;
+        };
+
+        $scope.immediateShutdown = function () {
+            //@TODO:show progress
+            APIUtils.chassisPowerOff(function (response) {
+                if (response) {
+                    //@TODO: set proper server state
+                } else {
+                    //@TODO:show error message
+                }
+                //@TODO:hide progress
+            });
+        };
+        $scope.immediateShutdownConfirm = function () {
+            if ($scope.confirm) {
+                return;
+            }
+            $scope.confirm = true;
+            $scope.immediately_confirm = true;
+        };
+
+    }]);
diff --git a/src/scss/components/_bmc-reboot.scss b/src/scss/components/_bmc-reboot.scss
index c9f207c..23d1167 100644
--- a/src/scss/components/_bmc-reboot.scss
+++ b/src/scss/components/_bmc-reboot.scss
@@ -1,10 +1,27 @@
 // BMC Reboot
 
 #bmc-reboot {
+  ul {
+    margin: 0;
+    padding: 0;
+    margin-left: 1.3em;
+  }
   .bmc-reboot__status-log {
     color: $darkgrey;
     font-weight: 500;
     margin-top: 1em;
     padding-bottom: .7em;
   }
+
+  .bmc-reboot-option {
+    position: relative;
+    overflow: hidden;
+    padding-top: 1.5em;
+    padding-left: 1.8em;
+    button {
+      margin-bottom: 1.5em;
+      margin-top: 1.5em;
+    }
+  }
+
 }