Bri Prebilic Cole

CORD GUI -- Users page has a panel with information about what each category blocks.

Change-Id: I035dbc139656abcb9f918a3197dda39aa05a0757
...@@ -78,10 +78,6 @@ th { ...@@ -78,10 +78,6 @@ th {
78 font-weight: lighter; 78 font-weight: lighter;
79 } 79 }
80 80
81 -div.container {
82 - min-height: 100%;
83 -}
84 -
85 button, 81 button,
86 input[type="button"], 82 input[type="button"],
87 input[type="reset"] { 83 input[type="reset"] {
...@@ -119,6 +115,7 @@ input[type="reset"][disabled]:hover { ...@@ -119,6 +115,7 @@ input[type="reset"][disabled]:hover {
119 div.container { 115 div.container {
120 width: 85%; 116 width: 85%;
121 margin: 0 auto; 117 margin: 0 auto;
118 + min-height: 100%;
122 } 119 }
123 div.main-left, div.main-right { 120 div.main-left, div.main-right {
124 float: left; 121 float: left;
...@@ -141,6 +138,9 @@ g.icon circle { ...@@ -141,6 +138,9 @@ g.icon circle {
141 g.icon use.glyph.checkMark { 138 g.icon use.glyph.checkMark {
142 fill: rgb(68, 189, 83) 139 fill: rgb(68, 189, 83)
143 } 140 }
141 +g.icon use.glyph.xMark {
142 + fill: #CE5650;
143 +}
144 144
145 th.user-pic { 145 th.user-pic {
146 background-color: white; 146 background-color: white;
......
1 +<!--Partial HTML for rating panel directive-->
2 +<div id="rating-panel">
3 + <div ng-cloak class="ng-hide ng-cloak panel" ng-show="ratingsShown">
4 + <table>
5 + <tr>
6 + <th class="title">Category</th>
7 + <th ng-repeat="rating in level_order">{{rating}}</th>
8 + </tr>
9 + <tr ng-repeat="cat in category_order">
10 + <td class="title">{{cat}}</td>
11 + <td ng-repeat="r in level_order">
12 + <div ng-if="prohibitedSites[r][cat]">
13 + <icon size="15" id="xMark"></icon>
14 + </div>
15 + <div ng-if="!prohibitedSites[r][cat]">
16 + <icon size="15" id="checkMark"></icon>
17 + </div>
18 + </td>
19 + </tr>
20 + </table>
21 + </div>
22 +</div>
...\ No newline at end of file ...\ No newline at end of file
...@@ -46,6 +46,11 @@ ...@@ -46,6 +46,11 @@
46 padding: 2% 1%; 46 padding: 2% 1%;
47 } 47 }
48 48
49 +#user span.help:hover {
50 + cursor: pointer;
51 + color: #CE5650;
52 +}
53 +
49 #user div.main-left.family table.user-info th, 54 #user div.main-left.family table.user-info th,
50 #user div.main-right.family table.user-form th { 55 #user div.main-right.family table.user-form th {
51 padding: 17px; 56 padding: 17px;
...@@ -109,3 +114,67 @@ ...@@ -109,3 +114,67 @@
109 #user td.buttons svg { 114 #user td.buttons svg {
110 vertical-align: middle; 115 vertical-align: middle;
111 } 116 }
117 +
118 +#rating-panel th,
119 +#rating-panel td {
120 + text-align: center;
121 + padding: 1%;
122 + font-weight: lighter;
123 +}
124 +
125 +#rating-panel th.title,
126 +#rating-panel td.title {
127 + width: 125px;
128 + text-align: left;
129 +}
130 +
131 +#rating-panel th {
132 + background-color: white;
133 + padding-top: 3%;
134 + border-bottom: 1px solid #CE5650;
135 + color: #3C3C3C;
136 + font-weight: normal;
137 +}
138 +
139 +#rating-panel tr th:first-child,
140 +#rating-panel tr td:first-child {
141 + padding-left: 5%;
142 +}
143 +#rating-panel tr th:last-child,
144 +#rating-panel tr td:last-child {
145 + padding-right: 5%;
146 +}
147 +
148 +div#rating-panel {
149 + position: relative;
150 + pointer-events: none;
151 +}
152 +
153 +#rating-panel div.ng-hide-add.ng-hide-add-active,
154 +#rating-panel div.ng-hide-remove.ng-hide-remove-active {
155 + -webkit-transition: all linear 0.75s;
156 + transition: all linear 0.75s;
157 +}
158 +
159 +#rating-panel div.panel {
160 + position: absolute;
161 + top: 0;
162 + left: -6%;
163 + height: 545px;
164 + overflow: auto;
165 + padding: 0;
166 + pointer-events: auto;
167 + box-shadow: 0 3px 23px 7px rgb(118, 118, 118);
168 + border-radius: 3px;
169 +}
170 +#rating-panel table {
171 + table-layout: fixed;
172 + width: 500px;
173 + background-color: white;
174 + opacity: 1;
175 +}
176 +
177 +#rating-panel div.ng-hide {
178 + opacity: 0;
179 + left: -55%;
180 +}
......
...@@ -23,7 +23,11 @@ ...@@ -23,7 +23,11 @@
23 name="changeLevels"> 23 name="changeLevels">
24 <table class="user-form"> 24 <table class="user-form">
25 <tr> 25 <tr>
26 - <th>Select Site Rating</th> 26 + <th>
27 + Select Site Rating
28 + <span class="help"
29 + ng-click="showRatings()"> (?)</span>
30 + </th>
27 </tr> 31 </tr>
28 <tr ng-repeat="user in users" class="options"> 32 <tr ng-repeat="user in users" class="options">
29 <td> 33 <td>
...@@ -49,5 +53,8 @@ ...@@ -49,5 +53,8 @@
49 </table> 53 </table>
50 </form> 54 </form>
51 </div> 55 </div>
56 + <div ng-if="isFamily">
57 + <ratings-panel></ratings-panel>
58 + </div>
52 </div> 59 </div>
53 </div> 60 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
30 $scope.isFamily = false; 30 $scope.isFamily = false;
31 $scope.newLevels = {}; 31 $scope.newLevels = {};
32 $scope.showCheck = false; 32 $scope.showCheck = false;
33 + $scope.ratingsShown = false;
33 34
34 // === Get data functions --- 35 // === Get data functions ---
35 36
...@@ -112,7 +113,53 @@ ...@@ -112,7 +113,53 @@
112 $scope.showCheck = false; 113 $scope.showCheck = false;
113 }; 114 };
114 115
116 + $scope.showRatings = function () {
117 + $scope.ratingsShown = !$scope.ratingsShown;
118 + };
119 +
115 $log.debug('Cord User Ctrl has been created.'); 120 $log.debug('Cord User Ctrl has been created.');
121 + }])
122 +
123 + .directive('ratingsPanel', ['$log', function ($log) {
124 + return {
125 + templateUrl: 'app/view/user/ratingPanel.html',
126 + link: function (scope, elem, attrs) {
127 + function fillSubMap(order, bool) {
128 + var result = {};
129 + $.each(order, function (index, cat) {
130 + result[cat] = bool;
131 + });
132 + return result;
133 + }
134 + function processSubMap(prhbSites) {
135 + var result = {};
136 + $.each(prhbSites, function (index, cat) {
137 + result[cat] = true;
138 + });
139 + return result;
140 + }
141 +
142 + function preprocess(data, order) {
143 + return {
144 + ALL: fillSubMap(order, false),
145 + G: processSubMap(data.G),
146 + PG: processSubMap(data.PG),
147 + PG_13: processSubMap(data.PG_13),
148 + R: processSubMap(data.R),
149 + NONE: fillSubMap(order, true)
150 + };
151 + }
152 +
153 + $.getJSON('/app/data/pc_cats.json', function (data) {
154 + scope.level_order = data.level_order;
155 + scope.category_order = data.category_order;
156 + scope.prohibitedSites = preprocess(
157 + data.prohibited, data.category_order
158 + );
159 + scope.$apply();
160 + });
161 + }
162 + };
116 }]); 163 }]);
117 164
118 }()); 165 }());
......