{
var selected, prev_selected, num, num_selected, num_prev_selected, filter;
- prev_selected = $.map($scope.facility_names, function(x, i) {
- return $scope.is_facility_active(x) ? x : null;
- });
+ // prev_selected = $.map($scope.facility_names, function(x, i) {
+ // return $scope.is_facility_active(x) ? x : null;
+ // });
$scope.set_facility_active(facility, ! $scope.is_facility_active(facility));
-
- selected = $.map($scope.facility_names, function(x, i) {
- return $scope.is_facility_active(x) ? x : null;
+
+ $.each($scope.testbed_names[facility], function(j, testbed_name) {
+ $scope.select_testbed(facility, testbed_name);
});
-
- num = $scope.facility_names.length;
- prev_num_selected = prev_selected.length;
- num_selected = selected.length;
-
- if ((prev_num_selected != 0) && (prev_num_selected != num)) {
- // Remove previous filter
- filter = ['facility_name', 'included', prev_selected];
- manifold.raise_event($scope.instance.options.query_uuid, FILTER_REMOVED, filter);
- }
-
- if (num_selected != num) {
- filter = ['facility_name', 'included', selected];
- manifold.raise_event($scope.instance.options.query_uuid, FILTER_ADDED, filter);
- }
+ console.log($scope);
+ // selected = $.map($scope.facility_names, function(x, i) {
+ // return $scope.is_facility_active(x) ? x : null;
+ // });
+
+ // num = $scope.facility_names.length;
+ // prev_num_selected = prev_selected.length;
+ // num_selected = selected.length;
+
+ // if ((prev_num_selected != 0) && (prev_num_selected != num)) {
+ // // Remove previous filter
+ // filter = ['facility_name', 'included', prev_selected];
+ // manifold.raise_event($scope.instance.options.query_uuid, FILTER_REMOVED, filter);
+ // }
+//
+ // if (num_selected != num) {
+ // filter = ['facility_name', 'included', selected];
+ // manifold.raise_event($scope.instance.options.query_uuid, FILTER_ADDED, filter);
+ // }
};
$scope.select_testbed = function(facility, testbed)
_get_scope : function()
{
- return angular.element('[ng-controller=TestbedsCtrl]').scope()
+ return angular.element('[ng-controller=TestbedsCtrl]').scope();
},
/*
-<div id={{ domid }} ng-controller="TestbedsCtrl">
-
-<div class="list-group-item sl-platform"><span class="list-group-item-heading">Facilities</span></div>
-
-<div ng-repeat="facility_name in facility_names">
- <a href="#"
- class="list-group-item sl-platform"
- ng-class="{active: is_facility_active(facility_name)}"
- id="facility-filter_{[{ facility_name }]}"
- ng-click="select_facility(facility_name)"
- data-platform="{[{ facility_name }]}">
- <span class="list-group-item-heading">{[{ facility_name }]}</span>
- </a>
- <div ng-repeat="testbed_name in testbed_names[facility_name]">
- <a href="#"
- class="list-group-item sl-platform"
- ng-class="{active: is_testbed_active(facility_name, testbed_name)}"
- id="testbeds-filter_{[{ testbed_name }]}"
- ng-click="select_testbed(facility_name, testbed_name)"
- data-platform="{[{ testbed_name }]}">
- <span class="list-group-item-heading"> {[{testbed_name}]}</span>
- </a>
- </div>
-</div>
-
-<!--
-<style>
-a.sl-platform {
- text-transform: uppercase;
-}
-
-</style>
--->
+<div id="{{ domid }}" class="sl-filter-facilities" ng-controller="TestbedsCtrl">
+ <h4>
+ Facilities
+ </h4>
+ <div>
+ <div class="sl-facilities" ng-repeat="facility_name in facility_names">
+ <a href="#"
+ class="sl-facility"
+ ng-class="{active: is_facility_active(facility_name)}"
+ id="facility-filter_{[{ facility_name }]}"
+ ng-click="select_facility(facility_name)"
+ data-platform="{[{ facility_name }]}">
+ <img class="sl-image" src="/static/icons/{[{ facility_name }]}.png" /> {[{ facility_name }]}
+ </a>
+ <div class="sl-testbeds" ng-repeat="testbed_name in testbed_names[facility_name]">
+ <a href="#"
+ class="sl-testbed"
+ ng-class="{active: is_testbed_active(facility_name, testbed_name)}"
+ id="testbeds-filter_{[{ testbed_name }]}"
+ ng-click="select_testbed(facility_name, testbed_name)"
+ data-platform="{[{ testbed_name }]}">
+ <input ng-checked="is_testbed_active(facility_name, testbed_name)" type="checkbox"> {[{testbed_name}]}
+ </a>
+ </div>
+ </div>
+ </div>
</div>
font-size:8pt;
color:#888888;
}
+input[type=checkbox] {
+ min-width:5px !important;
+ margin-left:0 !important;
+}
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], select, option {
min-width:260px;
padding:6px;
div#slice-view {
margin:0;
}
-div.list-group-item {
- border:0;
- -moz-border-radius: 0;
- border-radius: 0;
- background-color:white;
- font-weight:bold;
- padding-left:0;
+div.sl-filter-facilities {
+ padding:0 5px;
}
-a.list-group-item {
- -moz-border-radius: 0;
- border-radius: 0;
- border:0;
- background-color:white;
- padding:3px 2px 3px 10px;
- border-left:2pt white solid;
+div.sl-filter-facilities h4 {
+ margin-bottom:15px;
+
+}
+img.sl-image {
+ margin:0 5px 5px 0;
+ padding:0;
+ vertical-align:middle;
+}
+a.sl-facility {
+ color:gray;
+ text-decoration:none;
+}
+a.sl-facility:hover {
+ color:#342961;
}
-a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus {
- -moz-border-radius: 0;
- border-radius: 0;
- font-weight: bold;
+a.sl-facility.active {
color:black;
- background-color:#F5F5F5;
- border-left:2pt blue solid;
+ text-decoration:none;
}
-
-a.list-group-item:hover {
- -moz-border-radius: 0;
- border-radius: 0;
- border-left:2pt blue solid;
+a.sl-facility::before {
+ content: " ";
}
-a.list-group-item p.list-group-item-text {
- -moz-border-radius: 0;
- border-radius: 0;
- font-size:9pt;
- font-style:italic;
- font-weight: normal;
- color: black !important;
+div.sl-facilities {
+ border-bottom:#CCCCCC 1px solid;
+ padding-bottom:15px;
+ margin-bottom:15px;
+}
+div.sl-facilities:last-child {
+ border:0;
+}
+a.sl-testbed {
+ color:gray;
+ text-decoration:none;
+ margin-left:25px;
+ margin-bottom:5px;
+}
+a.sl-testbed:hover {
+ color:#342961;
+}
+a.sl-testbed.active {
+ color:black;
}
-
span.sl-resources {
font-size:9pt;
color:gray;