From 43ffc7e16e545e7e50af060791d1c71d29669e59 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Wed, 21 Jan 2015 18:42:48 +0100 Subject: [PATCH] fixed styles and js --- portal/static/css/fed4fire.css | 26 ++--- portal/static/js/myslice.js | 45 +++++---- portal/templates/fed4fire/fed4fire_about.html | 1 + .../fed4fire/fed4fire_registration_view.html | 98 +++++++++---------- .../fed4fire/fed4fire_widget-topmenu.html | 95 ++++++++---------- 5 files changed, 126 insertions(+), 139 deletions(-) diff --git a/portal/static/css/fed4fire.css b/portal/static/css/fed4fire.css index cba7715c..b088b228 100644 --- a/portal/static/css/fed4fire.css +++ b/portal/static/css/fed4fire.css @@ -13,10 +13,9 @@ a, a:active, a:focus { h1 { border-bottom:1px solid #DDDDDD; - padding:0 0 0 0; - margin:0 0 0 0; + padding:0; + margin:25px 0; font-size:14pt; - margin-top: 12px; } h1 img { vertical-align:middle; @@ -70,13 +69,10 @@ div#header { } div#secondary { - } div#secondary ul { - position:absolute; - top:20px; - right:0; + float:right; } div#secondary li { @@ -100,6 +96,7 @@ div#navigation { background-color:orange; width:100%; height:40px; + text-align: center; } div#navigation div.wrapper { text-align:center; @@ -115,21 +112,26 @@ div#navigation ul { div#navigation li { color:white; font-family:helvetica, sans-serif; - font-size:10pt ; - font-weight:normal; + font-size:9pt ; + font-weight:bold; line-height:0.8em; letter-spacing:0.6pt; list-style:none; float:left; padding:0; - margin:15px 25px 0 0; + margin:16px 25px 0 0; } div#navigation li a { - color:white; + color:#003333; +} +div#navigation .iconlogout { + margin-top:-10px; + margin-right:2px; + color:#003333; } div#navigation li a:hover { text-decoration:none; - color:black; + color:white; } div#navigation li:last-child { margin-right:0; diff --git a/portal/static/js/myslice.js b/portal/static/js/myslice.js index aa5df439..40cf8a2f 100644 --- a/portal/static/js/myslice.js +++ b/portal/static/js/myslice.js @@ -172,10 +172,12 @@ var myslice = { if($.isEmptyObject(user)){ // REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) { - localStorage.setItem('user', JSON.stringify(data[0])); - myslice.loadSlices(data[0].slices); - if(isFunction(fn)){ - fn(); + if (data.length > 0) { + localStorage.setItem('user', JSON.stringify(data[0])); + myslice.loadSlices(data[0].slices); + if(isFunction(fn)){ + fn(); + } } }); }else{ @@ -186,24 +188,27 @@ var myslice = { }, loadProjects: function(fn) { - user = JSON.parse(localStorage.getItem('user')); - projects = localStorage.getItem('projects'); - if($.isEmptyObject(projects)){ - if($.isEmptyObject(user) || $.isEmptyObject(user.parent_authority)){ - $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'},'fields':['parent_authority']}, function( data ) { - parent_authority = data[0].parent_authority; - + var u = localStorage.getItem('user'); + if (u !== 'undefined') { + user = JSON.parse(u); + projects = localStorage.getItem('projects'); + if($.isEmptyObject(projects)){ + if($.isEmptyObject(user) || $.isEmptyObject(user.parent_authority)){ + $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'},'fields':['parent_authority']}, function( data ) { + parent_authority = data[0].parent_authority; + + }); + }else{ + parent_authority = user.parent_authority; + } + // REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 + $.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+parent_authority}}, function( data ) { + localStorage.setItem('projects', JSON.stringify(data)); }); }else{ - parent_authority = user.parent_authority; - } - // REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - $.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+parent_authority}}, function( data ) { - localStorage.setItem('projects', JSON.stringify(data)); - }); - }else{ - if(isFunction(fn)){ - fn(); + if(isFunction(fn)){ + fn(); + } } } diff --git a/portal/templates/fed4fire/fed4fire_about.html b/portal/templates/fed4fire/fed4fire_about.html index b0c3b6d7..2c53cb65 100644 --- a/portal/templates/fed4fire/fed4fire_about.html +++ b/portal/templates/fed4fire/fed4fire_about.html @@ -16,6 +16,7 @@
+

The Fed4Fire portal

Fed4FIRE Portal is a central place to get acess to all Fed4FIRE testbeds.In order to get access to the portal, an experimenter needs to register to the portal. The portal administrative body diff --git a/portal/templates/fed4fire/fed4fire_registration_view.html b/portal/templates/fed4fire/fed4fire_registration_view.html index 6c4bee37..ebfb4e62 100644 --- a/portal/templates/fed4fire/fed4fire_registration_view.html +++ b/portal/templates/fed4fire/fed4fire_registration_view.html @@ -23,14 +23,14 @@

{% endif %} -
+
-
+

{% csrf_token %} -

-
+

+

-

-

- +

If your organization does not deploy a Fed4FIRE authority itself, you can use the
default one called "fed4fire.global". If your organization however does provide a
Fed4FIRE authority itself, please make sure to select it here. If you start typing
your organization's name, it will pop up.

-
- -
+

-

+

+

-

-
+

+

-

-
+

+

-

+

-
+

-

- -
-
- -
-
+

+

+ +

+

+ +

+

-

-