From 54aab2f417e26c5c2d1a4377c2f8eac661a8b188 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Fri, 28 Mar 2014 18:10:55 +0100 Subject: [PATCH] resources all/reserved/pending side menu with pending number --- plugins/querytable/static/js/querytable.js | 15 ++-- portal/static/css/onelab.css | 11 +-- .../static/js/onelab_slice-resource-view.js | 7 ++ portal/templates/base.html | 2 +- .../onelab/onelab_slice-resource-view.html | 73 ------------------- portal/templates/slice-resource-view.html | 17 ++--- 6 files changed, 29 insertions(+), 96 deletions(-) delete mode 100644 portal/templates/onelab/onelab_slice-resource-view.html diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index b182a1aa..375aa8f3 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -403,10 +403,15 @@ switch(data.request) { case FIELD_REQUEST_ADD: case FIELD_REQUEST_ADD_RESET: + // update pending number + $("#badge-pending").data('number', $("#badge-pending").data('number') + 1 ); + $("#badge-pending").text($("#badge-pending").data('number')); this.set_checkbox_from_data(data.value, true); break; case FIELD_REQUEST_REMOVE: case FIELD_REQUEST_REMOVE_RESET: + $("#badge-pending").data('number', $("#badge-pending").data('number') - 1 ); + $("#badge-pending").text($("#badge-pending").data('number')); this.set_checkbox_from_data(data.value, false); break; default: @@ -451,18 +456,18 @@ on_all_query_done: function() { - if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); - this.table.fnAddData (this.buffered_lines); - this.buffered_lines=[]; + if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); + this.table.fnAddData (this.buffered_lines); + this.buffered_lines=[]; var self = this; // if we've already received the slice query, we have not been able to set // checkboxes on the fly at that time (dom not yet created) $.each(this.buffered_records_to_check, function(i, record) { - if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); + if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); self.set_checkbox_from_record(record, true); }); - this.buffered_records_to_check = []; + this.buffered_records_to_check = []; this.received_all_query = true; // unspin once we have received both diff --git a/portal/static/css/onelab.css b/portal/static/css/onelab.css index 469a215e..e5fdda5b 100644 --- a/portal/static/css/onelab.css +++ b/portal/static/css/onelab.css @@ -353,7 +353,6 @@ ul.nav-resources a { padding: 4px 10px 5px 10px; } - /* SLICE VIEW */ @@ -369,18 +368,16 @@ div.list-group-item { a.list-group-item { border:0; background-color:white; - padding:3px 0 3px 10px; + padding:3px 2px 3px 10px; border-left:2pt white solid; } -a.list-group-item.active, a.list-group-item.active:hover { +a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { font-weight: bold; color:black; - background-color:transparent; + background-color:#F5F5F5; border-left:2pt blue solid; } -a.list-group-item.active:hover { - background-color:#dddddd; -} + a.list-group-item:hover { border-left:2pt blue solid; } diff --git a/portal/static/js/onelab_slice-resource-view.js b/portal/static/js/onelab_slice-resource-view.js index 93e6866d..1f997d06 100644 --- a/portal/static/js/onelab_slice-resource-view.js +++ b/portal/static/js/onelab_slice-resource-view.js @@ -19,6 +19,13 @@ $(document).ready(function() { } */ }); + $('div.list-resources a').click(function() { + $('div.list-resources a').removeClass('active'); + $(this).addClass('active'); + $('div.panel').hide(); + $('div#'+$(this).data('panel')).show(); + + }); $.get("/rest/network", function(data) { var list = '
Testbeds
'; diff --git a/portal/templates/base.html b/portal/templates/base.html index 6dc48e73..29d1b3fe 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -9,7 +9,7 @@ - + diff --git a/portal/templates/onelab/onelab_slice-resource-view.html b/portal/templates/onelab/onelab_slice-resource-view.html deleted file mode 100644 index 8cb357b8..00000000 --- a/portal/templates/onelab/onelab_slice-resource-view.html +++ /dev/null @@ -1,73 +0,0 @@ -{% extends "layout_wide.html" %} - -{% block head %} - - - -{% endblock %} - -{% block content %} -
-
-
- - - -
-
-
- {% include theme|add:"_widget-slice-sections.html" %} -
- -
- {% if msg %} -

{{ msg }}

- {% endif %} -
-
- -
-
-
- {{list_resources}} - -
- - - -
-
-{% endblock %} diff --git a/portal/templates/slice-resource-view.html b/portal/templates/slice-resource-view.html index 3831a5e0..11a20179 100644 --- a/portal/templates/slice-resource-view.html +++ b/portal/templates/slice-resource-view.html @@ -14,13 +14,12 @@ {{filter_testbeds}} - +
+ Resources + All + Reserved + Pending +
@@ -51,8 +50,6 @@
  • Resources
  • Map
  • Scheduler
  • -
  • Pending
  • -
  • @@ -64,7 +61,7 @@ {{map_resources}}