ONOS-1934 - CORD-GUI -- CSS for demo user page and navigation bar. Updated bundles page to use the new JSON format. WIP.

Change-Id: I8d6b8c5c5d3de0a23d9cb7e2ccf7529bb27de299
diff --git a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/available.html b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/available.html
index 912b9ac..ff75a2f 100644
--- a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/available.html
+++ b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/available.html
@@ -1,11 +1,5 @@
 <div id="available" ng-controller="CordAvailable as ctrl">
-    <h2>{{name}}</h2>
-    <table>
-        <tr ng-repeat="func in funcs">
-            <td class="icon">icon of function</td>
-            <td>{{func.name}}</td>
-            <td class="desc">{{func.desc}}</td>
-        </tr>
-    </table>
+    <h2>{{available.name}}</h2>
+    <p>{{available.desc}}</p>
     <button type="button">Apply</button>
 </div>
diff --git a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.html b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.html
index d8574b5..d74c0be 100644
--- a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.html
+++ b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.html
@@ -4,6 +4,7 @@
     <div class="main-left">
         <h3>You are subscribed to the</h3>
         <h2>{{name}}</h2>
+        <p>{{desc}}</p>
         <table>
             <tr ng-repeat="func in funcs">
                 <td class="icon">icon of function</td>
diff --git a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.js b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.js
index a65214b..c02af54 100644
--- a/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.js
+++ b/apps/demo/cord-gui/src/main/webapp/app/view/bundle/bundle.js
@@ -19,30 +19,12 @@
 
     var $log, $resource;
 
-    var before = 'http://localhost:8080/rs/bundle/0',
-        after = 'http://localhost:8080/rs/bundle/1';
+    var url = 'http://localhost:8080/rs/bundle';
 
-    var basic = 'Basic Bundle',
-        family = 'Family Bundle',
-        current, which,
-        avScope;
-
-    function getAvailable(scope) {
-        var AvailableData, resource;
-
-        AvailableData = $resource(which);
-        resource = AvailableData.get({},
-            // success
-            function () {
-                scope.name = resource.bundle.name;
-                scope.funcs = resource.bundle.functions;
-            },
-            // error
-            function () {
-                $log.error('Problem with resource', resource);
-            });
-        $log.debug('Resource received:', resource);
-    }
+    var basic = 'basic',
+        family = 'family',
+        current,
+        avCb;
 
     angular.module('cordBundle', [])
         .controller('CordBundleCtrl', ['$log', '$scope', '$resource',
@@ -52,29 +34,36 @@
                 $log = _$log_;
                 $resource = _$resource_;
 
-                BundleData = $resource(after);
+                BundleData = $resource(url);
                 resource = BundleData.get({},
                     // success
                     function () {
+                        current = resource.bundle.id;
                         $scope.name = resource.bundle.name;
-                        current = $scope.name;
+                        $scope.desc = resource.bundle.desc;
                         $scope.funcs = resource.bundle.functions;
-
-                        which = (current === basic) ? after : before;
-                        getAvailable(avScope);
+                        avCb(resource);
                     },
                     // error
                     function () {
                         $log.error('Problem with resource', resource);
                     });
-                $log.debug('Resource received:', resource);
 
                 $log.debug('Cord Bundle Ctrl has been created.');
         }])
 
         .controller('CordAvailable', ['$scope',
             function ($scope) {
-                avScope = $scope;
+                avCb = function (resource) {
+                    $scope.id = (current === basic) ? family : basic;
+                    $scope.bundles = resource.bundles;
+
+                    $scope.bundles.forEach(function (bundle) {
+                        if (bundle.id === $scope.id) {
+                            $scope.available = bundle;
+                        }
+                    });
+                };
 
                 $log.debug('Cord Available Ctrl has been created.');
         }])