From e187276bb5da1d4e7195fd9aea066ae3b34b2df4 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Thu, 13 Mar 2014 19:05:53 +0100 Subject: [PATCH] institution style --- portal/static/css/onelab.css | 14 +- portal/static/js/institution.js | 46 ++--- portal/templates/institution.html | 169 +++++++++--------- .../templates/onelab/onelab_slice-view.html | 2 +- .../onelab/onelab_widget-slice-sections.html | 6 +- portal/templates/supportview.html | 2 +- 6 files changed, 124 insertions(+), 115 deletions(-) diff --git a/portal/static/css/onelab.css b/portal/static/css/onelab.css index 1d739426..e61d07a0 100644 --- a/portal/static/css/onelab.css +++ b/portal/static/css/onelab.css @@ -339,24 +339,24 @@ div#ticket-request p { } /* SLICE VIEW */ -ul.nav-sliceview {} -ul.nav-sliceview li { +ul.nav-tabs {} +ul.nav-tabs li { } -ul.nav-sliceview li a { +ul.nav-tabs li a { border-bottom:0; } -ul.nav-sliceview li:first-child { +ul.nav-tabs li:first-child { padding:0; } -ul.nav-sliceview li:first-child a { +ul.nav-tabs li:first-child a { font-weight:bold; padding:6px 15px 4px 15px; } -ul.nav-sliceview li:first-child.active a { +ul.nav-tabs li:first-child.active a { padding:6px 15px 3px 15px; } -ul.nav-sliceview li:first-child img { +ul.nav-tabs li:first-child img { margin:0 4px 1px 0; padding:0; } diff --git a/portal/static/js/institution.js b/portal/static/js/institution.js index 1ddb3e3f..e8c863ee 100644 --- a/portal/static/js/institution.js +++ b/portal/static/js/institution.js @@ -1,24 +1,20 @@ $(document).ready(function() { - $('li#nav-institution').addClass("active"); - - $('a.home-tab').click(function() { - $('ul.nav-tabs li').removeClass('active'); - $(this).parent().addClass('active'); - $('div.home-panel').hide(); - $('div#'+$(this).data('panel')).show(); - }); - var url = window.location; - if(url.hash) { - // Fragment exists - tab = url.href.split("#")[1]; - tab_exists = $('div#'+tab).length; - if (tab_exists) { - $('ul.nav-tabs li').removeClass('active'); - $('li#'+tab+'-tab').addClass('active'); - $('div.home-panel').hide(); - $('div#'+tab).show(); - } - } + loadedTabs = []; + + $('.nav-tabs a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + id = $(this).attr('href').substr(1); + if (!(id in loadedTabs)) { + switch(id) { + case 'users': + loadUsers(); + loadedTabs[id] = true; + break; + } + } + + }); /* TODO: factorize into functions */ $('button#deleteusers').click(function() { @@ -86,3 +82,13 @@ $(document).ready(function() { */ }); }); + +function loadUsers() { + $('div#users table').load('/table/user/', + { + 'fields' : [ 'user_hrn', 'user_first_name', 'user_last_name', 'user_email', 'user_phone' ], + 'filters' : { 'parent_authority' : $('div#users').data('authority') }, + 'options' : [ 'checkbox' ] + } + ); +} diff --git a/portal/templates/institution.html b/portal/templates/institution.html index ca9fe5a6..79b7361c 100644 --- a/portal/templates/institution.html +++ b/portal/templates/institution.html @@ -1,70 +1,70 @@ -{% extends "layout.html" %} +{% extends "layout_wide.html" %} + {% block head %} {% endblock head %} + {% block content %} -
-

Institution: {{user_details.parent_authority}}

+ -
- -
-
Loading Authority
- -
- - +
+
+
+
Loading Authority
+ +
+
+ +
+
+
Loading Slices
+
+ +
+
+
+
+ +
Loading Slices
+ +
{% endblock %} diff --git a/portal/templates/onelab/onelab_slice-view.html b/portal/templates/onelab/onelab_slice-view.html index 0444a823..cf9ee7d8 100644 --- a/portal/templates/onelab/onelab_slice-view.html +++ b/portal/templates/onelab/onelab_slice-view.html @@ -6,7 +6,7 @@ {% block content %} -
+
{% include theme|add:"_widget-slice-sections.html" %} diff --git a/portal/templates/onelab/onelab_widget-slice-sections.html b/portal/templates/onelab/onelab_widget-slice-sections.html index 6a98632d..30881589 100644 --- a/portal/templates/onelab/onelab_widget-slice-sections.html +++ b/portal/templates/onelab/onelab_widget-slice-sections.html @@ -1,5 +1,5 @@ {% if section == "resources" %} -