added theme
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Thu, 20 Feb 2014 16:06:44 +0000 (17:06 +0100)
committerCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Thu, 20 Feb 2014 16:06:44 +0000 (17:06 +0100)
28 files changed:
.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
auth/static/js/logout.js
devel/server-loop.sh
myslice/configengine.py
portal/accountview.py
portal/adminview.py
portal/contactview.py
portal/dashboardview.py
portal/homeview.py
portal/joinview.py
portal/manageuserview.py
portal/platformsview.py
portal/platformview.py
portal/registrationview.py
portal/resourceview.py
portal/sliceview.py
portal/static/css/fed4fire.css [new file with mode: 0644]
portal/static/css/onelab.css
portal/static/img/f4f-logo.png [new file with mode: 0644]
portal/templates/fed4fire/_widget-login.html [new file with mode: 0644]
portal/templates/fed4fire/_widget-topmenu.html [new file with mode: 0644]
portal/templates/fed4fire/home-view.html [new file with mode: 0644]
portal/templates/home-view.html
portal/templates/onelab/_widget-topmenu.html
portal/templates/onelab/home-view.html [new file with mode: 0644]
portal/theme.py [new file with mode: 0644]
portal/validationview.py
ui/templates/base.html

diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644 (file)
index 0000000..2bdc157
--- /dev/null
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//portal/django_passresetview.py=utf-8
+encoding//portal/urls.py=utf-8
+encoding//portal/validationview.py=utf-8
+encoding//portal/views.py=utf-8
index c417bb5..9c9b453 100644 (file)
@@ -7,4 +7,4 @@ function logout () {
     if (confirm(msg)) window.location="/logout/";
 }
 /* attach this function to the logout button */
-$(document).ready(function() { $('#logout').click(logout); })
+$(document).ready(function() { $('#logout').click(logout); $('#logoutbtn').click(logout); });
index c77258f..49d433e 100755 (executable)
@@ -3,8 +3,8 @@ DIRNAME=$(dirname $0)
 cd $DIRNAME/..
 
 # default port : if hostname starts with z -> use 8080 ; otherwise take 80
-#hostname | grep -q '^z' && port=8080 || port=8080
-hostname | grep -q '^z' && port=8080 || port=80
+hostname | grep -q '^z' && port=8080 || port=8080
+#hostname | grep -q '^z' && port=8080 || port=80
 [[ -n "$@" ]] && port=$1
 
 while true; do 
index 8c98b4c..e512adf 100644 (file)
@@ -46,6 +46,10 @@ class ConfigEngine(object):
         parser.read (os.path.join(ROOT,'myslice/myslice.ini'))
         self.config_parser=parser
 
+    def __getattr__(self, section):
+        if self.config_parser.has_section(section):
+            return ConfigSection(self.config_parser, section)
+        
     def manifold_url (self):
         return self.config_parser.get('manifold','url')
 
@@ -59,3 +63,13 @@ class ConfigEngine(object):
     # exporting these details to js
     def manifold_js_export (self):
         return "var MANIFOLD_URL = '%s';\n"%self.manifold_url();
+
+class ConfigSection(object) :
+    
+    def __init__(self, parser, section):
+        self._parser = parser
+        self._section = section
+    
+    def __getattr__(self, key):
+        if self._parser.has_option(self._section, key):
+            return self._parser.get(self._section, key)
index 2a929bd..d4499a8 100644 (file)
@@ -12,11 +12,13 @@ from django.contrib                     import messages
 from django.contrib.auth.decorators     import login_required
 from django.core.mail                   import send_mail
 
+from theme import ThemeView
+
 #
 import json, os, re, itertools
 
 # requires login
-class AccountView(LoginRequiredAutoLogoutView):
+class AccountView(LoginRequiredAutoLogoutView, ThemeView):
     template_name = "account-view.html"
     def dispatch(self, *args, **kwargs):
         return super(AccountView, self).dispatch(*args, **kwargs)
@@ -200,6 +202,7 @@ class AccountView(LoginRequiredAutoLogoutView):
         context['topmenu_items'] = topmenu_items_live('My Account', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
+        context['theme'] = self.theme
 #        context ['firstname'] = config['firstname']
         prelude_env = page.prelude_env()
         context.update(prelude_env)
index 8a51da9..6560d9d 100644 (file)
@@ -6,11 +6,11 @@ from manifold.manifoldapi       import execute_admin_query
 
 from plugins.querytable         import QueryTable
 from unfold.loginrequired       import LoginRequiredAutoLogoutView
-
+from theme import ThemeView
 import json
 
 # View for platforms
-class AdminView(LoginRequiredAutoLogoutView):
+class AdminView(LoginRequiredAutoLogoutView, ThemeView):
     template_name = "adminview.html"
 
     def get_context_data(self, **kwargs):
@@ -80,7 +80,7 @@ class AdminView(LoginRequiredAutoLogoutView):
         context['topmenu_items'] = topmenu_items_live('Admin', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
-
+        context['theme'] = self.theme
         context.update(page.prelude_env())
 
         context['layout_1_or_2']="layout-unfold2.html" if not context['username'] else "layout-unfold1.html"
index caee44a..a97d697 100644 (file)
@@ -8,10 +8,12 @@ from ui.topmenu                 import topmenu_items, the_user
 
 from portal.forms               import ContactForm
 
+from theme import ThemeView
+
 # splitting the 2 functions done here
 # GET is for displaying the empty form
 # POST is to process it once filled - or show the form again if anything is missing
-class ContactView (FreeAccessView):
+class ContactView (FreeAccessView, ThemeView):
     def post (self, request):
         form = ContactForm(request.POST) # A form bound to the POST data
         if form.is_valid(): # All validation rules pass
@@ -31,7 +33,7 @@ class ContactView (FreeAccessView):
 
             msg = render_to_string('contact-support-email.txt', form.cleaned_data)
             send_mail("Onelab user %s submitted a query "%email, msg, email, recipients)
-            return render(request,'contact_sent.html') # Redirect after POST
+            return render(request,'contact_sent.html', { 'theme' : self.theme}) # Redirect after POST
         else:
             return self._display (request, form)
 
@@ -42,5 +44,6 @@ class ContactView (FreeAccessView):
         return render(request, 'contact.html', {
                 'form': form,
                 'topmenu_items': topmenu_items('Contact', request),
-                'username': the_user (request)
+                'username': the_user (request),
+                'theme' : self.theme
                 })
index dea1c74..3910726 100644 (file)
@@ -11,8 +11,10 @@ from unfold.loginrequired        import LoginRequiredAutoLogoutView
 
 from ui.topmenu                  import topmenu_items_live, the_user
 
+from theme import ThemeView
+
 #This view requires login 
-class DashboardView (LoginRequiredAutoLogoutView):
+class DashboardView (LoginRequiredAutoLogoutView, ThemeView):
 
     template_name = "dashboard.html"
     
@@ -75,6 +77,8 @@ class DashboardView (LoginRequiredAutoLogoutView):
         # so we can sho who is logged
         context['username'] = the_user(self.request) 
 
+        context['theme'] = self.theme
+        
         page.expose_js_metadata()
 
         # the page header and other stuff
index efdf71e..5704164 100644 (file)
@@ -4,6 +4,7 @@ from django.http import HttpResponseRedirect
 from django.contrib.auth import authenticate, login, logout
 from django.template import RequestContext
 from django.shortcuts import render_to_response
+from django.shortcuts import render
 
 from unfold.loginrequired import FreeAccessView
 
@@ -11,8 +12,11 @@ from manifold.manifoldresult import ManifoldResult
 from ui.topmenu import topmenu_items, the_user
 from myslice.configengine import ConfigEngine
 
-class HomeView (FreeAccessView):
+from theme import ThemeView
 
+class HomeView (FreeAccessView, ThemeView):
+    template_name = 'home-view.html'
+        
     # expose this so we can mention the backend URL on the welcome page
     def default_env (self):
         return { 
@@ -21,6 +25,7 @@ class HomeView (FreeAccessView):
 
     def post (self,request):
         env = self.default_env()
+        env['theme'] = self.theme
         username = request.POST.get('username')
         password = request.POST.get('password')
         
@@ -39,7 +44,7 @@ class HomeView (FreeAccessView):
             # let's use ManifoldResult.__repr__
             env['state']="%s"%manifoldresult
             env['layout_1_or_2']="layout-unfold2.html"
-            return render_to_response('home-view.html',env, context_instance=RequestContext(request))
+            return render_to_response(self.template,env, context_instance=RequestContext(request))
         # user was authenticated at the backend
         elif auth_result is not None:
             user=auth_result
@@ -50,21 +55,32 @@ class HomeView (FreeAccessView):
             else:
                 env['state'] = "Your account is not active, please contact the site admin."
                 env['layout_1_or_2']="layout-unfold2.html"
-                return render_to_response('home-view.html',env, context_instance=RequestContext(request))
+                return render_to_response(self.template,env, context_instance=RequestContext(request))
         # otherwise
         else:
             env['state'] = "Your username and/or password were incorrect."
             env['layout_1_or_2']="layout-unfold2.html"
-            return render_to_response('home-view.html',env, context_instance=RequestContext(request))
+            return render_to_response(self.template, env, context_instance=RequestContext(request))
 
     # login-ok sets state="Welcome to MySlice" in urls.py
     def get (self, request, state=None):
         env = self.default_env()
+
+        if request.user.is_authenticated(): 
+            env['person'] = self.request.user
+        else: 
+            env['person'] = None
+    
+        env['theme'] = self.theme
+    
+
         env['username']=the_user(request)
         env['topmenu_items'] = topmenu_items(None, request)
         if state: env['state'] = state
         elif not env['username']: env['state'] = None
         # use one or two columns for the layout - not logged in users will see the login prompt
         env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
-        return render_to_response('home-view.html',env, context_instance=RequestContext(request))
+        
+        
+        return render_to_response(self.template, env, context_instance=RequestContext(request))
 
index e513a60..5d2d363 100644 (file)
@@ -19,10 +19,12 @@ from manifold.core.query        import Query
 from portal.models              import PendingUser,PendingAuthority
 from portal.actions             import authority_get_pi_emails, manifold_add_user,manifold_add_account
 
+from theme import ThemeView
+
 # since we inherit from FreeAccessView we cannot redefine 'dispatch'
 # so let's override 'get' and 'post' instead
 #
-class JoinView (FreeAccessView):
+class JoinView (FreeAccessView, ThemeView):
 
     def post (self, request):
         return self.get_or_post (request, 'POST')
@@ -204,6 +206,7 @@ class JoinView (FreeAccessView):
           'root_authority_hrn': request.POST.get('root_authority_hrn', '').lower(),
           'root_authorities': root_authorities,
           'authorities': authorities,
+          'theme': self.theme
           }
         template_env.update(page.prelude_env ())
         return render(request, 'join_view.html',template_env)
index 59fc1d6..cbed7ab 100644 (file)
@@ -11,12 +11,12 @@ from django.http                        import HttpResponse, HttpResponseRedirec
 from django.contrib                     import messages
 from django.contrib.auth.decorators     import login_required
 from django.core.mail                   import send_mail
-
+from theme import ThemeView
 #
 import json, os, re, itertools
 
 # requires login
-class UserView(LoginRequiredAutoLogoutView):
+class UserView(LoginRequiredAutoLogoutView, ThemeView):
     template_name = "manageuserview.html"
     def dispatch(self, *args, **kwargs):
         return super(UserView, self).dispatch(*args, **kwargs)
@@ -208,6 +208,7 @@ class UserView(LoginRequiredAutoLogoutView):
         context['topmenu_items'] = topmenu_items_live('My Account', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
+        context['theme'] = self.theme
 #        context ['firstname'] = config['firstname']
         prelude_env = page.prelude_env()
         context.update(prelude_env)
index 8c7640b..eef773a 100644 (file)
@@ -5,9 +5,10 @@ from unfold.loginrequired       import FreeAccessView
 from ui.topmenu                  import topmenu_items_live, the_user
 
 from plugins.querytable          import QueryTable
+from theme import ThemeView
 
 # View for platforms
-class PlatformsView(FreeAccessView):
+class PlatformsView(FreeAccessView, ThemeView):
     template_name = "platforms.html"
 
     def get_context_data(self, **kwargs):
@@ -45,7 +46,7 @@ class PlatformsView(FreeAccessView):
         context['topmenu_items'] = topmenu_items_live('Platforms', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
-
+        context['theme'] = self.theme
         context.update(page.prelude_env())
 
         context['layout_1_or_2']="layout-unfold2.html" if not context['username'] else "layout-unfold1.html"
index a39fce9..d70c99b 100644 (file)
@@ -15,9 +15,10 @@ from ui.topmenu                  import topmenu_items_live, the_user
 from plugins.querytable          import QueryTable
 
 from myslice.configengine        import ConfigEngine
+from theme import ThemeView
 
 # View for 1 platform and its details
-class PlatformView(FreeAccessView):
+class PlatformView(FreeAccessView, ThemeView):
     template_name = "platform.html"
 
     def get_context_data(self, **kwargs):
@@ -140,7 +141,7 @@ class PlatformView(FreeAccessView):
         context['topmenu_items'] = topmenu_items_live('Platforms', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
-
+        context['theme'] = self.theme
         context.update(page.prelude_env())
 
         return context
index 455b175..e04652c 100644 (file)
@@ -19,10 +19,12 @@ from manifold.core.query        import Query
 from portal.models              import PendingUser
 from portal.actions             import authority_get_pi_emails, manifold_add_user,manifold_add_account
 
+from theme import ThemeView
+
 # since we inherit from FreeAccessView we cannot redefine 'dispatch'
 # so let's override 'get' and 'post' instead
 #
-class RegistrationView (FreeAccessView):
+class RegistrationView (FreeAccessView, ThemeView):
 
     def post (self, request):
         return self.get_or_post (request, 'POST')
@@ -193,6 +195,7 @@ class RegistrationView (FreeAccessView):
           'email': request.POST.get('email', ''),
           'password': request.POST.get('password', ''),           
           'authorities': authorities,
+          'theme': self.theme
           }
         template_env.update(page.prelude_env ())
         return render(request, 'registration_view.html',template_env)
index ac1813c..a407725 100644 (file)
@@ -10,9 +10,10 @@ from plugins.lists.simplelist   import SimpleList
 from plugins.slicestat          import SliceStat
 
 from myslice.configengine       import ConfigEngine
+from theme import ThemeView
 
 # View for 1 platform and its details
-class ResourceView(FreeAccessView):
+class ResourceView(FreeAccessView, ThemeView):
     template_name = "resource.html"
 
     def get_context_data(self, **kwargs):
@@ -88,7 +89,7 @@ class ResourceView(FreeAccessView):
         context['topmenu_items'] = topmenu_items_live(None, page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
-
+        context['theme'] = self.theme
         context.update(page.prelude_env())
 
         return context
index eaec3fa..a48b846 100644 (file)
@@ -31,6 +31,8 @@ from plugins.slicestat               import SliceStat
 
 from myslice.configengine            import ConfigEngine
 
+from theme import ThemeView
+
 tmp_default_slice='ple.upmc.myslicedemo'
 
 # temporary : turn off the users part to speed things up
@@ -46,7 +48,7 @@ insert_grid=False
 insert_messages=False
 #insert_messages=True
 
-class SliceView (LoginRequiredAutoLogoutView):
+class SliceView (LoginRequiredAutoLogoutView, ThemeView):
 
     def get (self,request, slicename=tmp_default_slice):
     
@@ -427,7 +429,9 @@ class SliceView (LoginRequiredAutoLogoutView):
         template_env [ 'topmenu_items' ] = topmenu_items_live('Slice', page) 
         # so we can sho who is logged
         template_env [ 'username' ] = the_user (request) 
-    
+        
+        template_env ['theme'] = self.theme
+        
         # don't forget to run the requests
         page.expose_js_metadata()
         # the prelude object in page contains a summary of the requirements() for all plugins
diff --git a/portal/static/css/fed4fire.css b/portal/static/css/fed4fire.css
new file mode 100644 (file)
index 0000000..a014b34
--- /dev/null
@@ -0,0 +1,628 @@
+/* @override unfold/static/css/plugin.css */
+/* GENERAL */
+body {
+    padding-top: 60px;
+    padding-bottom: 20px;
+}
+*/
+/* center the buttons vertically in the header */
+div.topmenu { padding-top: 40px; }
+ul.logged-in { 
+    padding-top: 12px; 
+}
+button.logged-in { 
+    font-size: small; 
+    margin-left: 5px;
+}
+li.username {
+    margin-bottom: 10px;
+    font-size: x-small; 
+}
+
+.logoTxt{
+    font-size: 35px;
+    position: absolute;
+    margin-left: 20px;
+    font-family: verdana,arial,sans-serif;
+    font-weight: bold;       
+}
+a{
+    color: #777777;
+    text-decoration: none;
+}
+a:hover{
+    color: red;
+    text-decoration: none;
+}
+.container {
+       padding: 0 !important;
+    color: black;
+    background-color: white;
+    margin: 0;
+    width: 100%;
+    max-width: 100%;
+    min-height: 100% !important;
+    height: 100% !important;
+    font-family: Ubuntu, Arial, sans-serif !important;
+}
+div.f4f-title{
+    margin-top:20px;
+    margin-bottom:20px;
+    text-align: center;
+    border: 1px solid #61210B;
+    background-color: orange;
+}
+.container h1 {
+    color: #777777;
+    margin-top: 5px;
+}
+table {
+   color:black;
+}
+
+.container h1, .container h2 {
+    color: #fff !important;
+}
+
+div.plugin-outline-complete, 
+div.plugin-outline-body {
+    border: 0px solid;
+    border-radius: 0;
+    border-color: #ccc;
+    -webkit-transition: padding 200ms ease-out;
+    -moz-transition: padding 200ms ease-out;
+    -o-transition: padding 200ms ease-out;
+    transition: padding 0.2s ease-out;
+    padding: 20px;
+    margin: 0;
+}
+/*
+div.plugin-outline-complete:hover, 
+div.plugin-outline-body:hover {
+    padding: 80px 80px 120px 80px; 
+}
+*/
+a.plugin-tooltip { 
+    font-size: 130%;
+    font-style: normal;
+    font-weight: bold;
+    padding: 5px;
+    color: #333;
+    font-family: Ubuntu, Arial, sans-serif;
+    text-transform: uppercase;
+}
+
+a.plugin-tooltip:hover { 
+    color: #fff; 
+    text-decoration: none;
+}
+
+
+
+/* LIST VIEW */
+
+h2.well.well-lg {
+    border-radius:0;
+    border: 0;
+    font-family: Ubuntu, arial, sans-serif;
+    /* text-transform: ; */
+    font-weight: normal;
+    font-size: 40px;
+    /* color: #30196d; */
+    color: white;
+    margin-bottom: 0px;
+    margin-top: 0;
+    padding: 40px;
+    opacity: 1;
+    text-align: center;
+    background-color: #30196d;
+}
+
+#complete-resources {
+/*    background-color: #92f79e ; */
+    background-color: #B8B2FF ;
+}
+
+#complete-filters {
+/*    background-color: #4af25d; */
+    background-color: #add7ff;
+}
+
+#complete-users {
+/*    background-color: #ff7394 ; */
+    background-color: #add7ff ;
+}
+/*
+#complete-measurements {
+    background-color: ;
+}
+*/
+#complete-pending {
+/*    background-color: #add7ff ; */
+    background-color: #B8B2FF ;
+
+}
+
+#complete-customize-resources {
+    background-color: #efdfdf;
+}
+
+#complete-msgs-pre {
+    background-color: #ccc;
+}
+
+#complete-resources, 
+#complete-filters, 
+#complete-users, 
+#complete-measurements,
+#complete-pending,
+#complete-customize-resources,
+#complete-msgs-pre {
+    opacity: 1;
+    text-align: center;
+    color: #333;
+}
+
+#complete-resources:hover, 
+#complete-filters:hover, 
+#complete-users:hover, 
+#complete-measurements:hover,
+#complete-pending:hover,
+#complete-customize-resources:hover,
+#complete-msgs-pre:hover {
+    opacity: 1;
+}
+
+.nav.nav-tabs {
+    font-family: Ubuntu, Arial, sans-serif;
+    border: 0 !important;
+    border-bottom: 3px solid #fff !important;
+    margin-bottom: 40px;
+}
+
+.nav.nav-tabs li.active a {
+    color: red;
+    border-left: 0px solid #572bc9;
+    border-top: 0px solid #572bc9;
+    border-right: 0px solid #572bc9;
+    background-color: orange;
+}
+
+.nav.nav-tabs li a {
+    color: #333;
+    border: 0 !important;
+    margin-right: 5px;
+}
+
+.nav.nav-tabs li a:hover {
+    color: #333;
+    background: red;
+    color: #fff;
+    border: 0 !important;
+}
+
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+    background-color: orange;
+}
+
+/* TOPMENU.CSS */
+
+body {
+       /* background: #30196d !important; */
+       /* background: black !important; */
+       background: white !important;
+    padding-top: 0px;
+    padding-bottom: 0px;
+}
+
+.navbar-fixed-top {
+    position: relative !important;
+}
+
+.navbar-nav li a:hover {
+    color: red !important;
+}
+
+.navbar-nav li.active a {
+    background: #eee !important;
+    background-color: orange;
+    color: #572bc9 ;
+}
+
+.navbar-nav li.active a {
+    background: #eee ;
+}
+
+/* Thierry : turning this off
+ul.logged-in { 
+    padding-top: 25px; 
+}
+Thierry */
+button.logged-in { 
+    font-size: 1em;
+    font-weight: bold; 
+    margin-left: 5px;
+    margin-top: -5px;
+    /* background: #572bc9; */
+    background: #FFD69B;
+    border: 1px solid orange;
+    color: #777777;
+    padding: 5px 15px;
+    border-radius:5px;
+}
+
+button.logged-in:hover { 
+    /* background: #4af25d; */
+    background: orange;
+    border: 1px solid #777777;
+    color: #777777;
+}
+li.username {
+    margin-bottom: 10px;
+    font-size: 0.8em;
+    text-transform: none;
+    font-weight: normal; 
+    color: #999;
+}
+
+
+/* BOOTSTRAP */
+
+
+ul.pagination li a {
+    /* background: ; */
+    color: #572bc9;
+    font-family: Ubuntu, Arial, sans-serif;
+}
+
+ul.pagination li.active a {
+    /* background: #572bc9; */
+    background: orange;
+    border: 1px solid red;
+}
+
+.btn.btn-default {
+    /* background: #572bc9; */
+    background: #FFD69B;
+    color: #777777;
+    font-family: Ubuntu, Arial, sans-serif;
+    font-weight: bold;
+    border-color: #eea236;
+}
+
+.btn.btn-default:hover {
+    /* background: #4af25d; */
+    /* background: #ff7394; */
+    background: orange;
+    color: #333;
+    font-family: Ubuntu, Arial, sans-serif;
+    font-weight: bold;
+    border-color: #927143;
+}
+
+input {
+    border-radius: 3px;
+    border: none;
+    border: 1px solid #ccc;
+}
+
+div.dataTables_length label, 
+div.dataTables_filter label,
+div.dataTables_info {
+    font-family: Ubuntu, Arial, sans-serif ;
+}
+
+
+
+
+/* QUERYTABLE */
+
+div.QueryTable table.dataTable th {
+    font: bold 12px/22px Ubuntu, Arial, sans-serif;
+    color: #333 ;
+    border-right: 0px solid #333 ;
+    border-bottom: 0px solid #C1DAD7 ;
+    border-top: 0px solid #C1DAD7 ;
+    letter-spacing: 1px;
+    text-transform: uppercase;
+    text-align: left;
+    padding: 8px 12px 4px 20px;
+    vertical-align:middle;
+    background: url('../img/tablesort-header.png') no-repeat ; 
+}
+
+div.QueryTable table.dataTable td, div.QueryTable table.dataTable textarea, div.QueryTable table.dataTable input [type="text"] {
+    font: normal 12px Ubuntu, Arial, Helvetica, sans-serif;
+    border-right: 0px solid #fff ;
+    border-bottom: 1px solid #fff ;
+}
+
+div.QueryTable table.dataTable thead { 
+    background: url('../img/tablesort-header.png') repeat-x ;
+    background-color: #caebea;
+}
+
+div.QueryTable table.dataTable tfoot { 
+    background: url('../img/tablesort-header.png') repeat-x ;
+    /* background-color: # ; */
+}
+
+
+/* QUERY EDITOR */
+
+table.query-editor {
+    margin: 40px auto ;
+    clear: both;
+    /* width: 80%;*/
+    width: 100% ;
+    font-family: Ubuntu;
+}
+
+.query-editor-spacer,
+.plugin.QueryUpdater,
+.plugin.Tabs {
+    margin-top: 60px !important;
+/* Thierry : turning this off
+.plugin.Tabs 
+Thierry */
+{
+    margin-top: 60px ;
+>>>>>>> 804932e8a431ddbf0d7c56457625457967b48d4c:portal/static/css/onelab_marko.css
+}
+
+table.query-editor td {
+    padding: 5px 5px ;
+    font: normal 12px Ubuntu, Arial, sans-serif ;
+}
+
+
+
+/* DASHBOARD */
+
+#ms-dashboard-profile,
+#ms-dashboard-testbeds,
+#ms-dashboard-slices {
+    -webkit-transition: all 50ms ease-out;
+    -moz-transition: all 50ms ease-out;
+    -o-transition: all 50ms ease-out;
+    transition: all 0.05s ease-out;
+    padding-top: 140px;
+    padding-bottom: 60px;
+    margin-top: 60px;
+    color: #777777;
+    font-family: Ubuntu, Arial, sans-serif;
+    text-align: center;
+       
+}
+
+#ms-dashboard-profile:hover,
+#ms-dashboard-testbeds:hover,
+#ms-dashboard-slices:hover {
+    margin-top: 65px;
+}
+
+#ms-dashboard-profile {
+    background: url("../img/icon_users_color.png") top center no-repeat;
+}
+
+#ms-dashboard-testbeds {
+    background: url("../img/icon_testbed_color.png") top center no-repeat;
+}
+
+#ms-dashboard-slices {
+    background: url("../img/icon_slices_color.png") top center no-repeat;
+}
+
+.ms-dashboard-content ul {
+    list-style-type: none ;
+    padding-left: 0;
+    text-align: center ;
+}
+
+.ms-dashboard-content {
+    padding: 0 !important;
+}
+
+.ms-dashboard-content a {
+/*    color: #ff7394 !important; */
+    color: orange !important;
+/* color: #ff0099 !important; */
+}
+
+.ms-dashboard-content a:hover {
+    color: red !important;
+}
+.ms-dashboard-caption h2 {
+    font-family: Ubuntu, Arial, sans-serif;
+    border-bottom: 0 !important;
+    text-transform: uppercase;
+    color: #777777 !important;
+}
+
+#ms-dashboard-profile>div.ms-dashboard-caption {
+    background: no-repeat url(#) ;
+    padding-left: 0 ;
+}   
+
+#ms-dashboard-testbeds>div.ms-dashboard-caption {
+    background: no-repeat url(#) ;
+    padding-left: 0 ;
+}   
+
+#ms-dashboard-slices>div.ms-dashboard-caption {
+    background: no-repeat url(#) ;
+    padding-left: 0 ;
+}   
+
+.simplelist {
+    font-size: 100%;
+    text-align: center !important;
+    margin: 0 auto;
+}
+
+/*** NEW CSS STYLES FOR ONLEAB ***/
+
+body {
+    background-color:white;
+    color:black;
+}
+div.wrapper {
+    width:980px;
+    margin:0 auto;
+    position:relative;
+}
+/* HEADER */
+div#header {
+    height:100px;
+    background-color:white;
+}
+
+div#secondary {
+    
+}
+
+div#secondary ul {
+    position:absolute;
+    top:20px;
+    right:0;
+}
+
+div#secondary li {
+    font-size:10pt;
+    float:left;
+    list-style:none;
+    margin-right:30px;
+}
+div#secondary li a {
+    color:black;
+}
+div#secondary li a:hover {
+    color:#270A5A;
+    text-decoration:none;
+}
+div#secondary li:last-child {
+    margin-right:0;
+}
+
+div#navigation {
+    background-color:black;
+    width:100%;
+    height:40px;
+}
+div#navigation div.wrapper {
+    text-align:center;
+}
+div#navigation ul {
+    margin:0;
+    padding:0;
+    display: inline-block;
+    list-style-type: none;
+    white-space: nowrap;
+}
+
+div#navigation li {
+    color:white;
+    font-family:helvetica, sans-serif;
+    font-size:10pt ;
+    font-weight:normal;
+    line-height:0.8em;
+    letter-spacing:0.6pt;
+    list-style:none;
+    float:left;
+    padding:0;
+    margin:15px 50px 0 0;
+}
+div#navigation li a {
+    color:white;
+}
+div#navigation li a:hover {
+    text-decoration:none;
+    color:#B8B2FF;
+}
+div#navigation li:last-child {
+    margin-right:0;
+}
+
+/* HOME DASHBOARD */
+div#home-dashboard {
+    color:black;
+    margin:25px 0;
+}
+div#home-dashboard table {
+    margin:25px;
+    width:100%;
+}
+div#home-dashboard table td {
+    text-align:center;
+    padding:15px 0;
+    width:33%;
+}
+div#home-dashboard table tr:first-child td {
+    font-size:12pt;
+    font-weight:bold;
+    color:#270A5A;
+}
+div#home-dashboard table tr:last-child td {
+    text-align:left;
+}
+div#home-dashboard table td.support {
+    font-size:14pt;
+    vertical-align:top;
+    padding-left:11%;
+}
+div#home-dashboard table td.support a {
+}
+div#home-dashboard table td.support a:hover {
+    text-decoration:none;
+}
+
+
+.login-submit {
+    vertical-align:middle;
+    padding:0;
+}
+.lost-password {
+    font-size:10pt;
+    color:#CCCCCC;
+    text-align:right;
+    padding:0px;
+}
+.lost-password a {
+}
+.login-signup {
+    border-top:1px solid #CCCCCC;
+    text-align:center;
+    margin-top:15px;
+    padding:5px 0 0 0;
+}
+/**/
+
+/* NAV TABS */
+
+.nav.nav-tabs {
+}
+
+.nav.nav-tabs li.active a {
+   
+}
+
+.nav.nav-tabs li a {
+}
+
+.nav.nav-tabs li a:hover {
+}
+
+/**/
+/* WELL */
+div.well {
+}
+/**/
+/* BUTTON */
+.btn.btn-default {
+    font-weight: bold;
+}
+
+.btn.btn-default:hover {
+    font-weight: bold;
+}
\ No newline at end of file
index 06925d3..d504755 100644 (file)
@@ -345,6 +345,12 @@ div.wrapper {
     position:relative;
 }
 
+span.label {
+    font-size:11pt;
+    color:gray;
+    font-weight:normal;
+    padding:0;
+}
 /***** Notifications *****/
 .warning {
     border: 1px solid red;
@@ -429,8 +435,7 @@ div#navigation li:last-child {
 /* HOME DASHBOARD */
 div#home-dashboard {
     color:black;
-    margin:25px 0;
-    border:1px red solid;
+    margin:25px auto;
 }
 div#home-dashboard table {
     margin:25px;
@@ -447,12 +452,21 @@ div#home-dashboard table tr:first-child td {
     color:#270A5A;
 }
 div#home-dashboard table tr:last-child td {
+    font-size:12pt;
+    vertical-align:top;
+    border-right:1px solid #DDDDDD;
+    padding:25px;
+}
+div#home-dashboard table tr:last-child td:first-child {
+}
+div#home-dashboard table tr:last-child td:last-child {
+    border-right:0;
+}
+div#home-dashboard table tr:last-child td div {
     text-align:left;
+    padding:25px 0;
 }
 div#home-dashboard table td.support {
-    font-size:14pt;
-    vertical-align:top;
-    padding-left:11%;
 }
 div#home-dashboard table td.support a {
 }
diff --git a/portal/static/img/f4f-logo.png b/portal/static/img/f4f-logo.png
new file mode 100644 (file)
index 0000000..8a72315
Binary files /dev/null and b/portal/static/img/f4f-logo.png differ
diff --git a/portal/templates/fed4fire/_widget-login.html b/portal/templates/fed4fire/_widget-login.html
new file mode 100644 (file)
index 0000000..db7245c
--- /dev/null
@@ -0,0 +1,26 @@
+<div class="well">
+       {% if state %}
+       <span class="help-block">{{ state }}</span>
+       {% endif %}
+       <form action="/login/" method="post" role="form">
+         {% csrf_token %}
+         {% if next %}
+         <input type="hidden" name="next" value="{{ next }}" />
+         {% endif %}
+       <div class="form-group">
+       <label for="username">Email address / Username</label>
+       <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
+       </div>
+       <div class="form-group">
+       <label for="password">Password</label>
+       <input type="password" class="form-control" name="password" placeholder="Password">
+       </div>
+       <div class="login-submit">
+               <input class="btn btn-default" type="submit" value="Sign In" />
+               <span class="lost-password">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="/portal/pass_reset/">Can't access your account?</a></span>
+       </div>
+       <div class="login-signup">
+               <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
+       </div>
+       </form>
+</div>
diff --git a/portal/templates/fed4fire/_widget-topmenu.html b/portal/templates/fed4fire/_widget-topmenu.html
new file mode 100644 (file)
index 0000000..4b2ae0e
--- /dev/null
@@ -0,0 +1,38 @@
+{% insert_str prelude "js/bootstrap.js" %}
+{% insert_str prelude "css/bootstrap.css" %}
+{% insert_str prelude "css/topmenu.css" %}
+{% insert_str prelude "js/logout.js" %}
+<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
+  <div class="navbar-header">
+    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-myslice-collapse">
+      <span class="sr-only">Toggle navigation</span>
+      <span class="icon-bar"></span>
+      <span class="icon-bar"></span>
+      <span class="icon-bar"></span>
+    </button>
+    <a class="navbar-brand" href="/"><img src="{{ STATIC_URL }}img/f4f-logo.png" height="30" alt="Fed4Fire logo" /></a>
+     <a href="/" alt="Home" class="logoTxt">Fed4Fire Portal</a>
+  </div>
+  <div class="collapse navbar-collapse navbar-myslice-collapse topmenu">
+    <ul class="nav navbar-nav">
+       {% for d in topmenu_items %} 
+       {% if d.dropdown %}
+       {% if d.is_active %} <li class='active'> {% else %} <li class='other'> {% endif %}
+         <a class="dropdown-toggle" data-toggle="dropdown" href="{{ d.href }}">{{ d.label }}<b class="caret"></b></a>
+         <ul class="dropdown-menu">
+           {% for dd in d.contents %}
+           <li class='{% if dd.is_active %}active{% else %}other{% endif %}{% if dd.disabled %} disabled{%endif%}'
+           {% if dd.domid %} id='{{dd.domid}}'{% endif %}>
+           <a href="{{ dd.href }}"> {{ dd.label }} </a> </li>
+           {% endfor %}
+         </ul>
+        </li>
+        {% else %} 
+       <li class='{% if d.is_active %}active{% else %}other{% endif %}{% if d.disabled %} disabled{%endif%}'
+       {% if d.domid %} id='{{d.domid}}'{% endif %}>
+       <a href="{{ d.href }}"> {{ d.label }} </a> </li>
+    {% endif %}
+    {% endfor %}
+</div>
+
+
diff --git a/portal/templates/fed4fire/home-view.html b/portal/templates/fed4fire/home-view.html
new file mode 100644 (file)
index 0000000..bc018a4
--- /dev/null
@@ -0,0 +1,19 @@
+{# fine for either layout-unfold1.html (logged in) or layout-unfold2.html (needs a login prompt) #}
+{% extends layout_1_or_2 %}
+{% block unfold_margin %}
+{% include 'fed4fire/_widget-login.html' %}
+{% endblock unfold_margin %}
+
+{% block unfold_main %}
+<div class='well-lg f4f-title'>
+  <h2 style="font-weight: bold;">Welcome to Fed4Fire portal !</h2>
+  <h4>New to Fed4fire? Please <a href="/portal/register">register</a> or learn more about <a href="http://fed4fire.eu/" target="_blank">the project</a>.</h3>
+</div>
+<div class='well'>
+<p>
+A federation of experimentation facilities will significantly accelerate Future Internet research. Fed4FIRE will deliver open and easily accessible facilities to the FIRE experimentation communities, which focus on fixed and wireless infrastructures, services and applications, and combinations thereof. 
+</p>
+<p>This UI server is connected to the manifold backend running at <code>{{ MANIFOLD_URL }}</code>.</p>
+</div>
+{% endblock unfold_main %}
index cfd63a8..a2f6c67 100644 (file)
@@ -10,7 +10,7 @@
        <div id="user">
                <table>
                        <tr>
-                               <td>PROFILE</td>
+                               <td>ACCOUNT</td>
                                <td>SLICES</td>
                                <td>SUPPORT</td>
                        </tr>
                        </tr>
                        <tr>
                                <td>
-                                       {% block unfold_margin %}
-                                       {% include 'widget-login.html' %}
-                                       {% endblock unfold_margin %}
-
+                                       {% include 'onelab/_widget-login-user.html' %}
+                               </td>
+                               <td>
+                                       
                                </td>
-                               <td></td>
                                <td class="support">
                                        <div><a href="/portal/contact">Contact</a></div>
                                        <div><a href="">Documentation</a></div>
                </table>
        </div>
        <div id="manager">
-               
+               <table>
+                       <tr>
+                               <td>INSTITUTION</td>
+                               <td>SLICES</td>
+                               <td>SUPPORT</td>
+                       </tr>
+                       <tr>
+                               <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       {% include 'onelab/_widget-login-manager.html' %}
+                               </td>
+                               <td>
+                                       
+                               </td>
+                               <td class="support">
+                                       <div><a href="/portal/contact">Contact</a></div>
+                                       <div><a href="">Documentation</a></div>
+                               </td>
+                       </tr>
+               </table>
        </div>
 </div>
 {% endblock unfold_main %}
index cf0f32c..100b87b 100644 (file)
@@ -2,9 +2,6 @@
 {% insert_str prelude "css/bootstrap.css" %}
 {% insert_str prelude "css/topmenu.css" %}
 {% insert_str prelude "js/logout.js" %}
-
-
-
 <div id="header">
        <div class="wrapper">
                <div class="logo">
@@ -31,7 +28,7 @@
                        <li><a href="/portal/contact/">SUPPORT</a></li>
                        <li>|</li>
                        <li><a href="/portal/account">{{ username }}</a></li>
-                       <li><a id="logout" data-username="{{ username }}">LOGOUT</a></li>
+                       <li><a id="logout" style="cursor:pointer;" data-username="{{ username }}">LOGOUT</a></li>
                </ul>
                </div>
        </div>
@@ -40,6 +37,4 @@
                <div class="wrapper"></div>
        </div>
        {% endif %}
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/portal/templates/onelab/home-view.html b/portal/templates/onelab/home-view.html
new file mode 100644 (file)
index 0000000..a6430ea
--- /dev/null
@@ -0,0 +1,97 @@
+{% extends "layout-unfold1.html" %}
+
+{% block unfold_main %}
+<div class="wrapper" id="home-dashboard">
+       <ul class="nav nav-tabs">
+         <li class="active"><a class="home-tab" data-panel="user" href="#">USER</a></li>
+         <li><a class="home-tab" data-panel="manager" href="#">MANAGER</a></li>
+       </ul>
+       <div class="home-panel" id="user">
+               <table>
+                       <tr>
+                               <td>ACCOUNT</td>
+                               <td>SLICES</td>
+                               <td>SUPPORT</td>
+                       </tr>
+                       <tr>
+                               <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></td>
+                       </tr>
+                       <tr>
+                               <td>
+                               {% if person %}
+                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                                       <div>
+                                       {% if person.last_name %}
+                                               {{person.first_name}} {{person.last_name}}<br />
+                                       {% endif %}
+                                       <span class="label">Email:</span> <a href='mailto:{{person.email}}'>{{person.email}}</a>
+                               </div>
+                               {% else %}
+                                       {% include 'onelab/_widget-login-user.html' %}
+                               {% endif %}
+                               </td>
+                               <td>
+                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request a Slice</button>
+                               </td>
+                               <td class="support">
+                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+                                       <div>
+                                               <a href="/portal/contact">Contact</a> <br />
+                                               <a href="">Documentation</a>
+                                       </div>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+       <div class="home-panel" id="manager">
+               <table>
+                       <tr>
+                               <td>INSTITUTION</td>
+                               <td>SLICES</td>
+                               <td>REQUESTS</td>
+                       </tr>
+                       <tr>
+                               <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+                               <td><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></td>
+                       </tr>
+                       <tr>
+                               <td>
+                               {% if person %}
+                                       {% if person.last_name %}
+                                       <div><span id='username'>{{person.first_name}} {{person.last_name}}</span></div> {% endif %}
+                               <div><b>Email: </b><a href='mailto:{{person.email}}'>{{person.email}}</a></div>
+                               {% else %}
+                                       {% include 'onelab/_widget-login-manager.html' %}
+                               {% endif %}
+                               </td>
+                               <td>
+                                       
+                               </td>
+                               <td class="support">
+                                       <div><a href=""></a></div>
+                                       <div><a href=""></a></div>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+</div>
+<script>
+       $(document).ready(function() {
+               $('a.home-tab').click(function() {
+                       $('ul.nav-tabs li').removeClass('active');
+                       $(this).parent().addClass('active');
+                       $('div.home-panel').hide();
+                       $('div#'+$(this).data('panel')).show();
+               });
+               $('button#ticketbtn').click(function() {
+                       window.location="/portal/contact/";
+               })
+               ;$('button#slicerequestbtn').click(function() {
+                       window.location="/portal/slice_request/";
+               });
+       });
+</script>
+{% endblock unfold_main %}
diff --git a/portal/theme.py b/portal/theme.py
new file mode 100644 (file)
index 0000000..7d988b1
--- /dev/null
@@ -0,0 +1,13 @@
+from myslice.configengine import ConfigEngine
+
+class ThemeView (object):
+    
+    @property
+    def theme(self):
+        self.config = ConfigEngine()
+        if self.config.myslice.theme :
+            return self.config.myslice.theme
+    
+    @property
+    def template(self):
+        return self.theme + '/' + self.template_name
\ No newline at end of file
index 23909b4..3daeaf8 100644 (file)
@@ -44,8 +44,9 @@ from portal.actions             import get_requests
 from manifold.manifoldapi       import execute_query
 from manifold.core.query        import Query
 from unfold.page                import Page
+from theme import ThemeView
 
-class ValidatePendingView(FreeAccessView):
+class ValidatePendingView(FreeAccessView, ThemeView):
     template_name = "validate_pending.html"
 
     def get_context_data(self, **kwargs):
@@ -259,7 +260,9 @@ class ValidatePendingView(FreeAccessView):
         context['topmenu_items'] = topmenu_items_live('Validation', page) 
         # so we can sho who is logged
         context['username'] = the_user(self.request) 
-
+        
+        context['theme'] = self.theme
+        
         # XXX We need to prepare the page for queries
         #context.update(page.prelude_env())
 
index f29b71b..a344206 100644 (file)
@@ -9,7 +9,7 @@
 <style type="text/css">{# In case we need to add raw css code #}{% container prelude_css %}</style>
 {{ header_prelude }}
 {% block head %} {% endblock head %}
-</head>{# let's add these ones no matter what #}
+{# let's add these ones no matter what #}
 {% insert_str prelude "js/jquery.min.js" %}
 {% insert_str prelude "js/jquery.html5storage.min.js" %}
 {% insert_str prelude "js/messages-runtime.js" %}
 {% insert_str prelude "css/layout-unfold.css" %}
 {% insert_str prelude "css/manifold.css" %}
 {% insert_str prelude "css/plugin.css" %}
-{% insert_str prelude "css/onelab_marko.css" %}
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/{{ theme }}.css">
+</head>
 <body>
 {% block container %}
   {% block topmenu %}
-  {% include 'widget-topmenu.html' %}
+  {% include theme|add:"/_widget-topmenu.html" %}
   {% endblock topmenu %}
 {% include 'messages-transient.html' %}
 <div class="container"> <div class="row">