From 7be53c6362c016ae34052a8a751ca11a975b0bd0 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Mon, 16 Feb 2015 15:46:13 +0100 Subject: [PATCH] Testbed/Facility selection --- plugins/testbeds/static/js/testbeds.js | 48 +++++++------- plugins/testbeds/templates/testbeds.html | 59 ++++++++--------- portal/static/css/onelab.css | 77 +++++++++++++---------- portal/static/icons/IoTLab.png | Bin 0 -> 427 bytes portal/static/icons/PlanetLab.png | Bin 0 -> 446 bytes portal/static/icons/Wireless.png | Bin 0 -> 299 bytes 6 files changed, 96 insertions(+), 88 deletions(-) create mode 100644 portal/static/icons/IoTLab.png create mode 100644 portal/static/icons/PlanetLab.png create mode 100644 portal/static/icons/Wireless.png diff --git a/plugins/testbeds/static/js/testbeds.js b/plugins/testbeds/static/js/testbeds.js index e628a679..1050f548 100644 --- a/plugins/testbeds/static/js/testbeds.js +++ b/plugins/testbeds/static/js/testbeds.js @@ -58,30 +58,34 @@ { 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) @@ -240,7 +244,7 @@ _get_scope : function() { - return angular.element('[ng-controller=TestbedsCtrl]').scope() + return angular.element('[ng-controller=TestbedsCtrl]').scope(); }, /* diff --git a/plugins/testbeds/templates/testbeds.html b/plugins/testbeds/templates/testbeds.html index 296e5efb..6ee26f2a 100644 --- a/plugins/testbeds/templates/testbeds.html +++ b/plugins/testbeds/templates/testbeds.html @@ -1,34 +1,27 @@ -
- -
Facilities
- -
- - {[{ facility_name }]} - -
- -   {[{testbed_name}]} - -
-
- - + diff --git a/portal/static/css/onelab.css b/portal/static/css/onelab.css index 27c6b47a..ef5d3e39 100644 --- a/portal/static/css/onelab.css +++ b/portal/static/css/onelab.css @@ -82,6 +82,10 @@ span.version { 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; @@ -378,45 +382,52 @@ div.container-resource, div.container-slice { 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; diff --git a/portal/static/icons/IoTLab.png b/portal/static/icons/IoTLab.png new file mode 100644 index 0000000000000000000000000000000000000000..56a8e56448a1c9d67263d6901c5f05e283464f3c GIT binary patch literal 427 zcmV;c0aX5pP)sW>@ia1v)n zaVR046V8i)V%rOcd*8k1+;?+djDdNc7sJgR$H~nW6K5_>V|PG_;`t5@$SI|%Z{LIa z1|~regzyX3b=M|QZXwQunp%sFmpD}Lr$C=E$QLLchFXDr8tWCwOq%}7@BuV1K&wzK4pKSx>jcPM-D{0M@#?EomK=B#I&TRw4N6cxO zf%Z|=S{(KfthiO*_qoslxgO#}+ki21tck-HSV>zOm-U0hvA&PXy>0D)v0;rIa-}i$ zDLd>AVz2db1@I;mt^c5&M4CTCcfZx}M7KW)m2zv`|Ngd7>jms*jJExywWVq5!hHfS zS(b$aW9C%bY*o5WKJ49fw8WM1r*he}Gtth=oPUD@7!Q1nZQN#=;_4SXfzIZDkRxtWpFE%W#Ac zL`1|Yh=^E-#F;Qp&!|;A7bzlHz zh$Em2M%j>XJLGCCSyDO0^UY!+v-Dg$pr9lwTW`$wMB$rU{m4Il8n<;iYoH8;s$Rh}$(o{Cq|bD$t)K&44!`P9YQH(=!ef`+bq1C)zO1;6P|=W0T(&X>yg1FoRhU ojtT0t(U)80#<{%x&QzG literal 0 HcmV?d00001 diff --git a/portal/static/icons/Wireless.png b/portal/static/icons/Wireless.png new file mode 100644 index 0000000000000000000000000000000000000000..4db0aa370aabb722caa6b402a99f48473a249d20 GIT binary patch literal 299 zcmV+`0o4A9P)R)PcmxYi;4!>}m6fruvf==Q5KrI{C_Dg#p|UbMqZ9I?f|N`$ z+0E?id&^sl85}&%8#|7(Lb?Hu;)WV)t&Ohh&Jc3&4nA7QS}yM!zVD9^b|1zoSbzty zkY;;!>NS}qo-yho3`75OLTaqhWBD@!G2!Wm>nMs`8JFN5`iW#tjWv4cRZsFdJqUtW z?=VLwJKms_r|D@Rp_1{2(^K9grqooczM8E~aHI_Dn*3NVwM?FF;B{l%x