Bri Prebilic Cole

CORD GUI -- Bundle Icons added to git. Login/logout functionality added.

Change-Id: I291b8e3106db3f47c5a9d9b4d06403b35e53d635
...@@ -35,7 +35,11 @@ div.mast { ...@@ -35,7 +35,11 @@ div.mast {
35 35
36 .mast div.right { 36 .mast div.right {
37 right: 7%; 37 right: 7%;
38 - width: 30%; 38 + width: 37%;
39 +}
40 +
41 +.mast h1 {
42 + font-size: 250%;
39 } 43 }
40 44
41 .mast a, 45 .mast a,
...@@ -47,8 +51,21 @@ div.mast { ...@@ -47,8 +51,21 @@ div.mast {
47 .mast svg { 51 .mast svg {
48 position: absolute; 52 position: absolute;
49 top: -1px; 53 top: -1px;
50 - left: 88px; 54 + left: 106px;
51 } 55 }
52 .mast g.icon use.glyph.bird { 56 .mast g.icon use.glyph.bird {
53 fill: #CE5650; 57 fill: #CE5650;
54 } 58 }
59 +
60 +.mast li.logout {
61 + list-style-type: none;
62 + position: absolute;
63 + right: 0;
64 + top: 50%;
65 + transform: translate(0, -50%);
66 +}
67 +.mast li.logout:hover {
68 + border-bottom: 2px solid #CE5650;
69 + list-style-type: none;
70 + cursor: pointer;
71 +}
......
1 <!--Mast HTML--> 1 <!--Mast HTML-->
2 2
3 -<div class="mast"> 3 +<div class="mast" ng-controller="CordMastCtrl">
4 <div class="left"> 4 <div class="left">
5 <a href="#/home" class="logo"><h1>CORD</h1></a> 5 <a href="#/home" class="logo"><h1>CORD</h1></a>
6 - <icon size="25px" id="bird"></icon> 6 + <icon size="30" id="bird"></icon>
7 </div> 7 </div>
8 8
9 <div class="right"> 9 <div class="right">
10 <nav ng-show="page.curr !== 'login'"></nav> 10 <nav ng-show="page.curr !== 'login'"></nav>
11 + <li class="logout"
12 + ng-show="page.curr !== 'login'"
13 + ng-click="logout()">Logout</li>
11 </div> 14 </div>
12 </div> 15 </div>
......
...@@ -14,10 +14,33 @@ ...@@ -14,10 +14,33 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -angular.module('cordMast', []) 17 +(function () {
18 - .directive('mast', function () { 18 + 'use strict';
19 - return { 19 +
20 - restrict: 'E', 20 + var urlSuffix = '/rs/logout';
21 - templateUrl: 'app/fw/mast/mast.html' 21 +
22 - }; 22 + angular.module('cordMast', [])
23 - }); 23 + .controller('CordMastCtrl',
24 + ['$log','$scope', '$resource', '$location', '$window',
25 + function ($log, $scope, $resource, $location, $window) {
26 + var LogoutData, resource;
27 +
28 + $scope.logout = function () {
29 + $log.debug('Logging out...');
30 + LogoutData = $resource($scope.shared.url + urlSuffix);
31 + resource = LogoutData.get({},
32 + function () {
33 + $location.path('/login');
34 + $window.location.href = $location.absUrl();
35 + $log.debug('Resource received:', resource);
36 + });
37 + };
38 + }])
39 +
40 + .directive('mast', function () {
41 + return {
42 + restrict: 'E',
43 + templateUrl: 'app/fw/mast/mast.html'
44 + };
45 + });
46 +}());
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 display: table; 18 display: table;
19 table-layout: fixed; 19 table-layout: fixed;
20 list-style-type: none; 20 list-style-type: none;
21 - width: 100%; 21 + width: 80%;
22 } 22 }
23 23
24 .nav li { 24 .nav li {
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
18 display: none !important; 18 display: none !important;
19 } 19 }
20 20
21 +html, body, div#frame, div#view {
22 + height: 100%;
23 +}
24 +
21 head, body, footer, 25 head, body, footer,
22 h1, h2, h3, h4, h5, h6, p, 26 h1, h2, h3, h4, h5, h6, p,
23 a, ul, li, div, 27 a, ul, li, div,
...@@ -74,6 +78,10 @@ th { ...@@ -74,6 +78,10 @@ th {
74 font-weight: lighter; 78 font-weight: lighter;
75 } 79 }
76 80
81 +div.container {
82 + min-height: 100%;
83 +}
84 +
77 button, 85 button,
78 input[type="button"], 86 input[type="button"],
79 input[type="reset"] { 87 input[type="reset"] {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 width: 42%; 23 width: 42%;
24 } 24 }
25 #home div.move-down { 25 #home div.move-down {
26 - margin-top: 10%; 26 + margin-top: 5%;
27 } 27 }
28 28
29 #home div.image-holder { 29 #home div.image-holder {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
7 <div class="main-right"> 7 <div class="main-right">
8 <div class="move-down"> 8 <div class="move-down">
9 <div class="bundle-title"> 9 <div class="bundle-title">
10 + <h4>Welcome {{shared.login}}!</h4>
10 <h5>You are subscribed to the</h5> 11 <h5>You are subscribed to the</h5>
11 <h3>{{bundle}}</h3> 12 <h3>{{bundle}}</h3>
12 </div> 13 </div>
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
20 var urlSuffix = '/rs/dashboard'; 20 var urlSuffix = '/rs/dashboard';
21 21
22 function randomDate(start, end) { 22 function randomDate(start, end) {
23 - return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); 23 + return new Date(
24 + start.getTime() + Math.random() * (end.getTime() - start.getTime())
25 + );
24 } 26 }
25 27
26 angular.module('cordHome', []) 28 angular.module('cordHome', [])
...@@ -38,12 +40,13 @@ ...@@ -38,12 +40,13 @@
38 40
39 if ($.isEmptyObject($scope.shared.userActivity)) { 41 if ($.isEmptyObject($scope.shared.userActivity)) {
40 $scope.users.forEach(function (user) { 42 $scope.users.forEach(function (user) {
41 - var date = randomDate(new Date(2015, 0, 1), new Date()); 43 + var date = randomDate(new Date(2015, 0, 1),
44 + new Date());
42 45
43 - $scope.shared.userActivity[user.id] = $filter('date')(date, 'mediumTime'); 46 + $scope.shared.userActivity[user.id] =
47 + $filter('date')(date, 'mediumTime');
44 }); 48 });
45 } 49 }
46 -
47 }, 50 },
48 // error 51 // error
49 function () { 52 function () {
......
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 +div#login{
18 + /*background: url("/imgs/login.png") no-repeat;*/
19 + height: 100%;
20 +}
21 +
17 div#login-wrapper { 22 div#login-wrapper {
18 text-align: center; 23 text-align: center;
19 } 24 }
...@@ -28,21 +33,10 @@ div#login-wrapper { ...@@ -28,21 +33,10 @@ div#login-wrapper {
28 top: -140px; 33 top: -140px;
29 } 34 }
30 35
31 -div#login-logo { 36 +div#login-form {
32 - margin-top: 13%;
33 - width: 217px;
34 -}
35 -div#login-logo, div#login-form {
36 display: inline-block; 37 display: inline-block;
37 } 38 }
38 39
39 -#login-logo use.glyph.bird {
40 - fill: #CE5650;
41 -}
42 -#login-logo circle {
43 - fill: none;
44 -}
45 -
46 #login div.outline { 40 #login div.outline {
47 position: absolute; 41 position: absolute;
48 border: 1px solid rgba(115, 115, 115, 0.7); 42 border: 1px solid rgba(115, 115, 115, 0.7);
...@@ -57,12 +51,13 @@ div#login-form { ...@@ -57,12 +51,13 @@ div#login-form {
57 margin-left: 2.5%; 51 margin-left: 2.5%;
58 position: relative; 52 position: relative;
59 width: 255px; 53 width: 255px;
54 + margin-top: 30%;
60 } 55 }
61 56
62 #login-form form { 57 #login-form form {
63 line-height: 250%; 58 line-height: 250%;
64 -
65 } 59 }
60 +
66 #login-form input { 61 #login-form input {
67 display: block; 62 display: block;
68 height: 40px; 63 height: 40px;
...@@ -112,3 +107,8 @@ div#login-form { ...@@ -112,3 +107,8 @@ div#login-form {
112 color: white; 107 color: white;
113 background-color: rgb(122, 188, 229); 108 background-color: rgb(122, 188, 229);
114 } 109 }
110 +
111 +#login-form input.ng-invalid.ng-touched {
112 + background-color: #CE5650;
113 + color: white;
114 +}
......
1 <!-- Login page partial html --> 1 <!-- Login page partial html -->
2 <div id="login" class="container"> 2 <div id="login" class="container">
3 <div id="login-wrapper"> 3 <div id="login-wrapper">
4 - <div id="login-logo">
5 - <icon size="125" id="bird"></icon>
6 - </div>
7 -
8 <div id="login-form"> 4 <div id="login-form">
9 <div class="outline"></div> 5 <div class="outline"></div>
10 <h2>Subscriber Portal</h2> 6 <h2>Subscriber Portal</h2>
11 <form> 7 <form>
12 - <input ng-model="email" type="text" placeholder="email"> 8 + <input ng-model="email" type="text" placeholder="email" required>
13 - <input type="password" placeholder="password"> 9 + <input ng-model="password" type="password" placeholder="password" required>
14 - <a href="#/home"> 10 + <input ng-click="login()" type="button" value="Log In">
15 - <input ng-click="login()" type="button" value="Log In">
16 - </a>
17 </form> 11 </form>
18 </div> 12 </div>
19 </div> 13 </div>
......
...@@ -19,20 +19,28 @@ ...@@ -19,20 +19,28 @@
19 var urlSuffix = '/rs/login'; 19 var urlSuffix = '/rs/login';
20 20
21 angular.module('cordLogin', []) 21 angular.module('cordLogin', [])
22 - .controller('CordLoginCtrl', ['$log', '$scope', '$resource', 22 + .controller('CordLoginCtrl',
23 - function ($log, $scope, $resource) { 23 + ['$log', '$scope', '$resource', '$location', '$window',
24 + function ($log, $scope, $resource, $location, $window) {
24 var LoginData, resource; 25 var LoginData, resource;
25 $scope.page.curr = 'login'; 26 $scope.page.curr = 'login';
26 27
28 + function getResource(email) {
29 + LoginData = $resource($scope.shared.url + urlSuffix + '/' + email);
30 + resource = LoginData.get({},
31 + function () {
32 + $location.url('/home');
33 + $window.location.href = $location.absUrl();
34 + });
35 + }
36 +
27 $scope.login = function () { 37 $scope.login = function () {
28 - var email; 38 +
29 - if (!$scope.email) { 39 + if ($scope.email && $scope.password) {
30 - email = 'mom@user.org'; 40 + getResource($scope.email);
31 - } else {
32 - email = $scope.email;
33 } 41 }
34 - LoginData = $resource($scope.shared.url + urlSuffix + '/' + email); 42 +
35 - resource = LoginData.get(); 43 + $scope.shared.login = $scope.email;
36 }; 44 };
37 45
38 $log.debug('Cord Login Ctrl has been created.'); 46 $log.debug('Cord Login Ctrl has been created.');
......