Merging with OneLab latest
authorLoic & Edelberto <loic.baron@lip6.fr>
Wed, 23 Apr 2014 13:38:33 +0000 (10:38 -0300)
committerLoic & Edelberto <loic.baron@lip6.fr>
Wed, 23 Apr 2014 13:38:33 +0000 (10:38 -0300)
71 files changed:
.settings/org.eclipse.core.resources.prefs
README
auth/static/js/logout.js
debian/control
debian/deb-cheat-sheet
debian/unfold.install
manifoldapi/manifoldapi.py
manifoldapi/static/js/manifold.js
plugins/googlemap/static/js/googlemap.js
plugins/querytable/__init__.py
plugins/querytable/static/css/querytable.css
plugins/querytable/static/js/querytable.js
plugins/querytable/templates/querytable.html
plugins/queryupdater/static/js/queryupdater.js
plugins/scheduler2/asdf.txt [changed mode: 0644->0755]
portal/about.py
portal/accountview.py
portal/contactview.py
portal/dashboardview.py
portal/django_passresetview.py
portal/documentationview.py
portal/institution.py
portal/joinview.py
portal/manageuserview.py
portal/platformsview.py
portal/platformview.py
portal/resourceview.py
portal/slicerequestview.py
portal/sliceresourceview.py
portal/slicetabexperiment.py
portal/slicetabinfo.py
portal/slicetabtestbeds.py
portal/sliceview.py
portal/sliceviewold.py
portal/static/css/fed4fire.css
portal/static/css/onelab.css
portal/static/js/institution.js
portal/static/js/myslice.js
portal/static/js/onelab_slice-resource-view.js
portal/supportview.py
portal/templates/about.html
portal/templates/account-view.html
portal/templates/contact_sent.html
portal/templates/home-view.html
portal/templates/institution.html
portal/templates/join_view.html
portal/templates/manageuserview.html
portal/templates/onelab/onelab_slice-user-view.html
portal/templates/onelab/onelab_slice-view.html
portal/templates/onelab/onelab_widget-slice-sections.html
portal/templates/password_reset_complete.html
portal/templates/password_reset_confirm.html
portal/templates/password_reset_done.html
portal/templates/password_reset_form.html
portal/templates/slice-request-ack-view.html
portal/templates/slice-tab-info.html
portal/templates/slice-tab-testbeds.html
portal/templates/slice_request_email.html
portal/templates/slice_request_email.txt
portal/templates/slicerequest_view.html
portal/templates/supportview.html
portal/templates/user_register_complete.html
portal/templates/user_request_email.html
portal/templates/user_request_email.txt
portal/templates/validate_pending.html
portal/urls.py
portal/usersview.py
portal/validationview.py
rest/__init__.py
rest/create.py
rest/update.py

index 2bdc157..f73c991 100644 (file)
@@ -1,5 +1,8 @@
 eclipse.preferences.version=1
 encoding//portal/django_passresetview.py=utf-8
+encoding//portal/forms.py=utf-8
+encoding//portal/migrations/0002_extend_slice.py=utf-8
+encoding//portal/models.py=utf-8
 encoding//portal/urls.py=utf-8
 encoding//portal/validationview.py=utf-8
 encoding//portal/views.py=utf-8
diff --git a/README b/README
index 78ffe6c..2ce4669 100644 (file)
--- a/README
+++ b/README
@@ -60,6 +60,14 @@ when you just need to hit ^C yourself when your static files need to be refreshe
 $ pip install -r path/to/requirements/file.txt
 Note. not quite sure what this is about, I could not spot this file..
 
+=====APACHE Config=====
+if are running apache please do:
+
+$ chown www-data:www-data /var/myslice-f4f
+
+otherwise you may get the following error:
+"DatabaseError: unable to open database file"
+
 ==================== Status
 
 *** Authentication ***
index 9c9b453..593eb58 100644 (file)
@@ -4,7 +4,10 @@ function logout () {
     var username=$(this).data('username');
     var msg="Are you sure you want to logout as " + username + " ?";
     /* redirect to /logout, see urls.py */
-    if (confirm(msg)) window.location="/logout/";
+    if (confirm(msg)){
+        localStorage.removeItem('user');
+        window.location="/logout/";
+    }
 }
 /* attach this function to the logout button */
 $(document).ready(function() { $('#logout').click(logout); $('#logoutbtn').click(logout); });
index 4a4eb05..0230abd 100644 (file)
@@ -3,16 +3,19 @@ Maintainer: Thierry Parmentelat <Thierry.Parmentelat@inria.fr>
 Section: misc
 Priority: optional
 Standards-Version: 3.9.2
+# hopefully we do not need manifold at build-time 
 Build-Depends: devscripts, debhelper (>=7.0.50~), debconf, dpatch, python-setuptools, make, python-django
 X-Python-Version: >= 2.7
 
-Package: myslice
-Architecture: any
-Depends: unfold, python-django-south
-Description: Myslice plugins, based on django and unfold frontend
-
 # Thierry: the recipe I'm using somehow only works with several packages
 Package: unfold
 Architecture: any
 Depends: python, python-django, python-pyparsing, apache2, libapache2-mod-wsgi, openssl
 Description: Generic django-based frontend for manifold backends
+
+#
+Package: myslice
+Architecture: any
+Depends: python-django-south, unfold, manifold
+Description: Myslice plugins, based on django and unfold frontend
+
index 8524fb8..182c3d3 100644 (file)
@@ -16,3 +16,8 @@ dpkg-deb -c myslice_0.2.4.lxc.2013.11.26_amd64.deb
 dpkg -s myslice
 dpkg --info -c myslice_0.2.4.lxc.2013.11.26_amd64.deb
 
+--- install from a local .deb 
+dpkg -i foo.deb
+- or, if this has deps that need to be pulled through apt-get:
+gdebi foo.deb
+(install with apt-get install -y gdebi-core)
index fb54250..f058d15 100644 (file)
@@ -1,6 +1,5 @@
 usr/lib*/python*/dist-packages/auth
 usr/lib*/python*/dist-packages/insert_above
-usr/lib*/python*/dist-packages/manifold
 usr/lib*/python*/dist-packages/plugins
 usr/lib*/python*/dist-packages/unfold
 usr/lib*/python*/dist-packages/ui
index b1a1a0c..b105bf3 100644 (file)
@@ -152,7 +152,9 @@ def _execute_query(request, query, manifold_api_session_auth):
 def execute_query(request, query):
     if not 'manifold' in request.session or not 'auth' in request.session['manifold']:
         request.session.flush()
-        raise Exception, "User not authenticated"
+        #raise Exception, "User not authenticated"
+        host = request.get_host()
+        return redirect(host)
     manifold_api_session_auth = request.session['manifold']['auth']
     return _execute_query(request, query, manifold_api_session_auth)
 
index 3d526a6..f0bbc8a 100644 (file)
@@ -699,6 +699,7 @@ var manifold = {
         if (data.code == 2) { // ERROR
             // We need to make sense of error codes here
             alert("Your session has expired, please log in again");
+            localStorage.removeItem('user');
             window.location="/logout/";
             if (manifold.asynchroneous_debug) {
                 duration=new Date()-start;
@@ -908,9 +909,7 @@ var manifold = {
                 break;
 
             case FILTER_ADDED: 
-// Thierry - this is probably wrong but intended as a hotfix 
-// http://trac.myslice.info/ticket/32
-//                manifold.raise_query_event(query_uuid, event_type, value);
+                manifold.raise_query_event(query_uuid, event_type, value);
                 break;
             case FILTER_REMOVED:
                 manifold.raise_query_event(query_uuid, event_type, value);
@@ -945,7 +944,11 @@ var manifold = {
         }
         // We need to inform about changes in these queries to the respective plugins
         // Note: query, main_query & update_query have the same UUID
-        manifold.raise_query_event(query_uuid, event_type, value);
+
+        // http://trac.myslice.info/ticket/32
+        // Avoid multiple calls to the same event
+        //manifold.raise_query_event(query_uuid, event_type, value);
+
         // We are targeting the same object with get and update
         // The notion of query is bad, we should have a notion of destination, and issue queries on the destination
         // NOTE: Editing a subquery == editing a local view on the destination
index 6db222d..8a740b2 100644 (file)
@@ -94,6 +94,8 @@
             //create empty LatLngBounds object in order to automatically center the map on the displayed objects
             this.bounds = new google.maps.LatLngBounds();
             var center = new google.maps.LatLng(this.options.latitude, this.options.longitude);
+
+            console.log("GoogleMap zoom = "+this.options.zoom);
             var myOptions = {
                 zoom: this.options.zoom,
                 center: center,
index 6a2bb29..5a80bb9 100644 (file)
@@ -71,7 +71,7 @@ Current implementation makes the following assumptions
             aoColumnDefs = self.datatables_options.setdefault ('aoColumnDefs',[])
             # here 'checkbox' is the class that we give to the <th> dom elem
             # dom-checkbox is a sorting type that we define in querytable.js
-            aoColumnDefs.append ( {'aTargets': ['checkbox'], 'sSortDataType': 'dom-checkbox' } )
+            #aoColumnDefs.insert (0, {'aTargets': ['checkbox'], 'sSortDataType': 'dom-checkbox' } )
 
     def template_file (self):
         return "querytable.html"
@@ -95,7 +95,7 @@ Current implementation makes the following assumptions
             'css_files': [ #"css/dataTables.bootstrap.css",
                            # hopefully temporary, when/if datatables supports sPaginationType=bootstrap3
                            # for now we use full_numbers, with our own ad hoc css 
-                           "css/dataTables.full_numbers.css",
+                           #"css/dataTables.full_numbers.css",
                            #"css/querytable.css" , 
                            ],
             }
index edbc683..a42ab1f 100644 (file)
@@ -16,7 +16,6 @@ div.QueryTable table.dataTable th {
 }
 
 div.QueryTable table.dataTable th.checkbox {
-    padding-left: 14px;
 }
 
 div.QueryTable table.dataTable td, div.QueryTable table.dataTable textarea, div.QueryTable table.dataTable input [type="text"] {
index 15ee6f1..5e734a1 100644 (file)
@@ -91,7 +91,8 @@
             var actual_options = {
                 // Customize the position of Datatables elements (length,filter,button,...)
                 // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time
-                sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
+                //sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
+                sDom: "<'row'<'col-xs-5'f><'col-xs-1'r><'col-xs-6 columns_selector'>>t<'row'<'col-xs-5'l><'col-xs-7'p>>",
                // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now
                // hopefully this would come with dataTables v1.10 ?
                // in any case, search for 'sPaginationType' all over the code for more comments
                 //manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field);
                 self.hide_column(field);
             });
+            $(".dataTables_filter").append("<div style='display:inline-block;height:27px;width:27px;padding-left:6px;padding-top:4px;'><span class='glyphicon glyphicon-search'></span></div>");
+            $(".dataTables_filter input").css("width","100%");
         }, // initialize_table
 
         /**
             var colnames = cols.map(function(x) {return x.sTitle})
             var nb_col = cols.length;
             /* if we've requested checkboxes, then forget about the checkbox column for now */
-            if (this.options.checkboxes) nb_col -= 1;
-
+            //if (this.options.checkboxes) nb_col -= 1;
+                       // catch up with the last column if checkboxes were requested 
+            if (this.options.checkboxes) {
+                // Use a key instead of hostname (hard coded...)
+                line.push(this.checkbox_html(record));
+               }
+               
             /* fill in stuff depending on the column name */
-            for (var j = 0; j < nb_col; j++) {
+            for (var j = 1; j < nb_col; j++) {
                 if (typeof colnames[j] == 'undefined') {
                     line.push('...');
                 } else if (colnames[j] == 'hostname') {
                     }
                     /* XXX TODO: Remove this and have something consistant */
                     if(obj=='resource'){
-                        line.push('<a href="../'+obj+'/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                        //line.push('<a href="../'+obj+'/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
                     }else{
-                        line.push('<a href="../'+obj+'/'+record[this.init_key]+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                        //line.push('<a href="../'+obj+'/'+record[this.init_key]+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
                     }
+                    line.push(record[this.init_key]);
                 } else {
                     if (record[colnames[j]])
                         line.push(record[colnames[j]]);
                 }
             }
     
-            // catch up with the last column if checkboxes were requested 
-            if (this.options.checkboxes) {
-                // Use a key instead of hostname (hard coded...)
-                line.push(this.checkbox_html(record));
-               }
+            
     
            // adding an array in one call is *much* more efficient
                // this.table.fnAddData(line);
         {
             // Remove corresponding filters
             this.filters = $.grep(this.filters, function(x) {
-                return x != filter;
+                return x == filter;
             });
             this.redraw_table();
         },
             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:
             switch(data.request) {
                 case FIELD_REQUEST_ADD:
                 case FIELD_REQUEST_ADD_RESET:
-                    this.set_checkboxfrom_data(data.value, true);
+                    this.set_checkbox_from_data(data.value, true);
                     break;
                 case FIELD_REQUEST_REMOVE:
                 case FIELD_REQUEST_REMOVE_RESET:
 
         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
                 if (op == '=' || op == '==') {
                     if ( col_value != value || col_value==null || col_value=="" || col_value=="n/a")
                         ret = false;
+                }else if (op == 'included') {
+                    $.each(value, function(i,x) {
+                      if(x == col_value){
+                          ret = true;
+                          return false;
+                      }else{
+                          ret = false;
+                      }
+                    });
                 }else if (op == '!=') {
                     if ( col_value == value || col_value==null || col_value=="" || col_value=="n/a")
                         ret = false;
      was in fact given as a third argument, and not second 
      as the various online resources had it - go figure */
     $.fn.dataTableExt.afnSortData['dom-checkbox'] = function  ( oSettings, _, iColumn ) {
-       return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) {
-           return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
-       );
-    }
+               return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) {
+                   return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
+               });
+    };
 
 })(jQuery);
 
index bc9cc03..d0f18c0 100644 (file)
@@ -1,19 +1,19 @@
-<div id='main-{{ domid }}' class='querytable-spacer'>
-  <table class='table table-striped table-bordered dataTable' id='{{domid}}__table' width='100%'>
+<div id="main-{{ domid }}" class="">
+  <table class="table dataTable" id="{{domid}}__table" width="100%">
     <thead>
       <tr>
+       {% if checkboxes %}<th class="checkbox">+/-</th>{% endif %}
         {% for column in columns %} <th>{{ column }}</th> {% endfor %} 
-        {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %} 
-        {% if checkboxes %} <th class="checkbox">+/-</th> {% endif %}
+        {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %}
       </tr>
     </thead> 
     <tbody>
     </tbody>
     <tfoot>
       <tr>
+       {% if checkboxes %} <th>+/-</th> {% endif %}
         {% for column in columns %} <th>{{ column }}</th> {% endfor %} 
         {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %} 
-        {% if checkboxes %} <th>+/-</th> {% endif %}
       </tr>
     </tfoot> 
   </table>
index b00f04f..89afdf3 100644 (file)
            // make sure the change is visible : toggle on the whole plugin
            // this might have to be made an 'auto-toggle' option of this plugin..
            // also it might be needed to be a little finer-grained here
-           this.toggle_on();
+
+        // XXX we don't want to show automaticaly the pending when a checkbox is checked
+           //this.toggle_on();
            
             switch(data.request) {
                 case FIELD_REQUEST_ADD_RESET:
old mode 100644 (file)
new mode 100755 (executable)
index 49a890b..99434a7 100644 (file)
@@ -12,7 +12,7 @@ from manifoldapi.manifoldresult import ManifoldResult
 from ui.topmenu import topmenu_items, the_user
 from myslice.configengine import ConfigEngine
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class AboutView (FreeAccessView, ThemeView):
     template_name = 'about.html'
@@ -37,7 +37,7 @@ class AboutView (FreeAccessView, ThemeView):
             env['person'] = None
     
         env['theme'] = self.theme
-    
+        env['section'] = "About"
 
         env['username']=the_user(request)
         env['topmenu_items'] = topmenu_items(None, request)
index 9b0c466..67c765d 100644 (file)
@@ -11,7 +11,7 @@ from django.http                        import HttpResponse, HttpResponseRedirec
 from django.contrib                     import messages
 from django.contrib.auth.decorators     import login_required
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 #
 import json, os, re, itertools
@@ -203,6 +203,7 @@ class AccountView(LoginRequiredAutoLogoutView, ThemeView):
         # so we can sho who is logged
         context['username'] = the_user(self.request)
         context['theme'] = self.theme
+        context['section'] = "User account"
 #        context ['firstname'] = config['firstname']
         prelude_env = page.prelude_env()
         context.update(prelude_env)
index 13450df..44c151c 100644 (file)
@@ -7,7 +7,7 @@ from ui.topmenu                 import topmenu_items, the_user
 
 from portal.forms               import ContactForm
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 # splitting the 2 functions done here
 # GET is for displaying the empty form
@@ -50,7 +50,7 @@ class ContactView (FreeAccessView, ThemeView):
                 else:
                     sender = email
         
-                msg = EmailMultiAlternatives(subject, text_content, sender, [recipients])
+                msg = EmailMultiAlternatives(subject, text_content, sender, recipients)
                 msg.attach_alternative(html_content, "text/html")
                 msg.send()
             except Exception, e:
@@ -77,4 +77,5 @@ class ContactView (FreeAccessView, ThemeView):
                 'topmenu_items': topmenu_items('Contact', request),
                 'theme' : self.theme,
                 'username': username,
+                'section': "Contact"
                 })
index 2b0ab82..06f02f8 100644 (file)
@@ -11,7 +11,7 @@ from unfold.loginrequired        import LoginRequiredAutoLogoutView
 
 from ui.topmenu                  import topmenu_items_live, the_user
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 #This view requires login 
 class DashboardView (LoginRequiredAutoLogoutView, ThemeView):
index 7d7f52e..a0018b0 100644 (file)
@@ -87,7 +87,7 @@ from portal.actions             import manifold_update_user
 from portal.forms               import PassResetForm
 from portal.actions             import manifold_update_user
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 # 4 views for password reset:
 # - password_reset sends the mail
index 6a75a62..ccd42fa 100644 (file)
@@ -12,7 +12,7 @@ from manifoldapi.manifoldresult import ManifoldResult
 from ui.topmenu import topmenu_items, the_user
 from myslice.configengine import ConfigEngine
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class DocumentationView (FreeAccessView, ThemeView):
     template_name = 'documentationview.html'
index 9bc0a86..c53318b 100644 (file)
@@ -5,7 +5,7 @@ from django.template                import RequestContext
 from django.shortcuts               import render_to_response
 from django.shortcuts               import render
 
-from unfold.loginrequired           import FreeAccessView
+from unfold.loginrequired           import LoginRequiredAutoLogoutView
 
 from manifold.core.query            import Query
 from manifoldapi.manifoldapi        import execute_query
@@ -13,9 +13,10 @@ from manifoldapi.manifoldresult     import ManifoldResult
 from ui.topmenu                     import topmenu_items, the_user
 from myslice.configengine           import ConfigEngine
 
-from theme                          import ThemeView
+from myslice.theme                          import ThemeView
+import json
 
-class InstitutionView (FreeAccessView, ThemeView):
+class InstitutionView (LoginRequiredAutoLogoutView, ThemeView):
     template_name = 'institution.html'
         
     # expose this so we can mention the backend URL on the welcome page
@@ -40,11 +41,42 @@ class InstitutionView (FreeAccessView, ThemeView):
                 env['user_details'] = user_details[0]
             except Exception,e:
                 env['error'] = "Please check your Credentials"
+            
+            try:
+                user_local_query  = Query().get('local:user').select('config').filter_by('email','==',str(env['person']))
+                user_local_details = execute_query(self.request, user_local_query)
+                user_local = user_local_details[0]            
+                user_local_config = user_local['config']
+                user_local_config = json.loads(user_local_config)
+                user_local_authority = user_local_config.get('authority')
+                if 'user_details' not in env or 'parent_authority' not in env['user_details'] or env['user_details']['parent_authority'] is None:
+                    env['user_details'] = {'parent_authority': user_local_authority}
+            except Exception,e:
+                env['error'] = "Please check your Manifold user config"
+            ## check user is pi or not
+            platform_query  = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled')
+            account_query  = Query().get('local:account').select('user_id','platform_id','auth_type','config')
+            platform_details = execute_query(self.request, platform_query)
+            account_details = execute_query(self.request, account_query)
+            for platform_detail in platform_details:
+                for account_detail in account_details:
+                    if platform_detail['platform_id'] == account_detail['platform_id']:
+                        if 'config' in account_detail and account_detail['config'] is not '':
+                            account_config = json.loads(account_detail['config'])
+                            if 'myslice' in platform_detail['platform']:
+                                acc_auth_cred = account_config.get('delegated_authority_credentials','N/A')
+            # assigning values
+            if acc_auth_cred == {}:
+                pi = "is_not_pi"
+            else:
+                pi = "is_pi"
+
         else: 
             env['person'] = None
     
         env['theme'] = self.theme
-    
+        env['section'] = "Institution"
+        env['pi'] = pi 
         env['username']=the_user(request)
         env['topmenu_items'] = topmenu_items(None, request)
         if state: env['state'] = state
index abe73f3..c128db3 100644 (file)
@@ -19,7 +19,7 @@ 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
+from myslice.theme import ThemeView
 
 # since we inherit from FreeAccessView we cannot redefine 'dispatch'
 # so let's override 'get' and 'post' instead
@@ -205,7 +205,7 @@ class JoinView (FreeAccessView, ThemeView):
                     sender =  render_to_string(theme.template, ctx)
                     sender = sender.replace('\n', '')
             
-                    msg = EmailMultiAlternatives(subject, text_content, sender, [recipients])
+                    msg = EmailMultiAlternatives(subject, text_content, sender, recipients)
                     msg.attach_alternative(html_content, "text/html")
                     msg.send()
     
index 369d6e9..7687d34 100644 (file)
@@ -10,7 +10,7 @@ from ui.topmenu                         import topmenu_items_live, the_user
 from django.http                        import HttpResponse, HttpResponseRedirect
 from django.contrib                     import messages
 from django.contrib.auth.decorators     import login_required
-from theme import ThemeView
+from myslice.theme import ThemeView
 #
 import json, os, re, itertools
 
index eef773a..c31cd17 100644 (file)
@@ -5,7 +5,7 @@ from unfold.loginrequired       import FreeAccessView
 from ui.topmenu                  import topmenu_items_live, the_user
 
 from plugins.querytable          import QueryTable
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 # View for platforms
 class PlatformsView(FreeAccessView, ThemeView):
index d70c99b..b0fc3ec 100644 (file)
@@ -15,7 +15,7 @@ from ui.topmenu                  import topmenu_items_live, the_user
 from plugins.querytable          import QueryTable
 
 from myslice.configengine        import ConfigEngine
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 # View for 1 platform and its details
 class PlatformView(FreeAccessView, ThemeView):
index a407725..d670645 100644 (file)
@@ -10,7 +10,7 @@ from plugins.lists.simplelist   import SimpleList
 from plugins.slicestat          import SliceStat
 
 from myslice.configengine       import ConfigEngine
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 # View for 1 platform and its details
 class ResourceView(FreeAccessView, ThemeView):
index dfa4658..213fd31 100644 (file)
@@ -1,4 +1,6 @@
 from django.shortcuts           import render
+from django.contrib.sites.models import Site
+
 
 from unfold.page                import Page
 
@@ -10,7 +12,7 @@ from portal.forms               import SliceRequestForm
 from unfold.loginrequired       import LoginRequiredAutoLogoutView
 from ui.topmenu                 import topmenu_items_live, the_user
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 import json, time
 
@@ -63,6 +65,11 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView):
 
         if method == 'POST':
             # The form has been submitted
+
+            # get the domain url
+            current_site = Site.objects.get_current()
+            current_site = current_site.domain
+
             slice_request = {
                 'type'              : 'slice',
                 'id'                : None,
@@ -73,6 +80,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView):
                 'number_of_nodes'   : wsgi_request.POST.get('number_of_nodes', ''),
                 'type_of_nodes'     : wsgi_request.POST.get('type_of_nodes', ''),
                 'purpose'           : wsgi_request.POST.get('purpose', ''),
+                'current_site'      : current_site
             }
             
             authority_hrn = slice_request['authority_hrn']
@@ -110,7 +118,8 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView):
             'user_hrn': user_hrn,
             'cc_myself': True,
             'authorities': authorities,
-            'theme': self.theme
+            'theme': self.theme,
+            'section': "Slice request"
         }
         template_env.update(slice_request)
         template_env.update(page.prelude_env())
index 520a72e..b02b0ca 100644 (file)
@@ -11,15 +11,16 @@ from django.http import HttpResponse
 from django.shortcuts import render
 
 from unfold.page                     import Page
-from manifold.core.query             import Query, AnalyzedQuery
-from manifoldapi.manifoldapi         import execute_query
 
 from myslice.configengine            import ConfigEngine
 from plugins.querytable              import QueryTable
 from plugins.googlemap               import GoogleMap
 from plugins.queryupdater            import QueryUpdater
+from plugins.testbeds                import TestbedsPlugin
+from plugins.scheduler2              import Scheduler2
+from plugins.columns_editor          import ColumnsEditor
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class SliceResourceView (LoginRequiredView, ThemeView):
     template_name = "slice-resource-view.html"
@@ -49,7 +50,7 @@ class SliceResourceView (LoginRequiredView, ThemeView):
                 'resource.hostname', 'resource.type',
                 'resource.network_hrn',
                 'lease.urn',
-                'user.user_hrn',
+                #'user.user_hrn',
                 #'application.measurement_point.counter'
         )
         # for internal use in the querytable plugin;
@@ -57,13 +58,23 @@ class SliceResourceView (LoginRequiredView, ThemeView):
         main_query_init_key = 'urn'
         aq = AnalyzedQuery(main_query, metadata=metadata)
         page.enqueue_query(main_query, analyzed_query=aq)
+        sq_resource    = aq.subquery('resource')
+        sq_lease       = aq.subquery('lease')
 
         query_resource_all = Query.get('resource').select(resource_fields)
         page.enqueue_query(query_resource_all)
 
-        sq_resource    = aq.subquery('resource')
-        sq_lease       = aq.subquery('lease')
+        # leases query
+        lease_md = metadata.details_by_object('lease')
+        lease_fields = [column['name'] for column in lease_md['column']]
 
+        query_all_lease = Query.get('lease').select(lease_fields)
+        page.enqueue_query(query_all_lease)
+
+        # --------------------------------------------------------------------------
+        # ALL RESOURCES LIST
+        # resources as a list using datatable plugin
         list_resources = QueryTable(
             page       = page,
             domid      = 'resources-list',
@@ -79,8 +90,41 @@ class SliceResourceView (LoginRequiredView, ThemeView):
                 },
         )
 
+
         # --------------------------------------------------------------------------
-        # RESOURCES
+        # RESERVED RESOURCES LIST
+        # resources as a list using datatable plugin
+        list_reserved_resources = QueryTable(
+            page       = page,
+            domid      = 'resources-reserved-list',
+            title      = 'List view',
+            query      = sq_resource,
+            query_all  = sq_resource,
+            init_key   = "urn",
+            checkboxes = True,
+            datatables_options = {
+                'iDisplayLength': 25,
+                'bLengthChange' : True,
+                'bAutoWidth'    : True,
+                },
+        )
+
+        # --------------------------------------------------------------------------
+        # COLUMNS EDITOR
+        # list of fields to be applied on the query 
+        # this will add/remove columns in QueryTable plugin
+        filter_column_editor = ColumnsEditor(
+            page  = page,
+            query = sq_resource, 
+            query_all = query_resource_all,
+            title = "Select Columns",
+            domid = 'select-columns',
+        )
+
+        # --------------------------------------------------------------------------
+        # RESOURCES MAP
         # the resources part is made of a Tabs (Geographic, List), 
 
         map_resources  = GoogleMap(
@@ -99,7 +143,21 @@ class SliceResourceView (LoginRequiredView, ThemeView):
             # center on Paris
             latitude   = 49.,
             longitude  = 9,
-            zoom       = 4,
+            zoom       = 8,
+        )
+
+        # --------------------------------------------------------------------------
+        # LEASES Nitos Scheduler
+        # Display the leases reservation timeslots of the resources
+
+        resources_as_scheduler2 = Scheduler2( 
+            page       = page,
+            domid      = 'scheduler',
+            title      = 'Scheduler',
+            # this is the query at the core of the slice list
+            query = sq_resource,
+            query_all_resources = query_resource_all,
+            query_lease = query_all_lease,
         )
 
         # --------------------------------------------------------------------------
@@ -116,9 +174,41 @@ class SliceResourceView (LoginRequiredView, ThemeView):
             outline_complete    = True,
         )
 
+        # --------------------------------------------------------------------------
+        # NETWORKS
+        # testbeds as a list of filters 
+
+        network_md = metadata.details_by_object('network')
+        network_fields = [column['name'] for column in network_md['column']]
+
+        query_network = Query.get('network').select(network_fields)
+        page.enqueue_query(query_network)
+
+        filter_testbeds = TestbedsPlugin(
+            page          = page,
+            domid         = 'testbeds-filter',
+            title         = 'Filter by testbeds',
+            query         = sq_resource,
+            query_all     = query_resource_all,
+            query_network = query_network,
+            init_key      = "network_hrn",
+            checkboxes    = True,
+            datatables_options = {
+                'iDisplayLength': 25,
+                'bLengthChange' : True,
+                'bAutoWidth'    : True,
+                },
+        )
+
         template_env = {}
         template_env['list_resources'] = list_resources.render(self.request)
+#         template_env['list_reserved_resources'] = list_reserved_resources.render(self.request)
+
+        template_env['columns_editor'] = filter_column_editor.render(self.request)
+
+        template_env['filter_testbeds'] = filter_testbeds.render(self.request)
         template_env['map_resources'] = map_resources.render(self.request)
+        template_env['scheduler'] = resources_as_scheduler2.render(self.request)
         template_env['pending_resources'] = pending_resources.render(self.request)
         template_env["theme"] = self.theme
         template_env["username"] = request.user
index f13c9d8..cca8afb 100644 (file)
@@ -12,10 +12,10 @@ from manifoldapi.manifoldresult import ManifoldResult
 from ui.topmenu import topmenu_items, the_user
 from myslice.configengine import ConfigEngine
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class ExperimentView (FreeAccessView, ThemeView):
-    template_name = 'experimentview.html'
+    template_name = 'slice-tab-experiment.html'
 
     def get (self, request, slicename, state=None):
         
index 7e7b78e..fc7fa29 100644 (file)
@@ -14,7 +14,7 @@ from unfold.page                     import Page
 from manifold.core.query             import Query, AnalyzedQuery
 from manifoldapi.manifoldapi         import execute_query
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class SliceInfoView (LoginRequiredView, ThemeView):
     template_name = "slice-tab-info.html"
index a93f678..abd6ce6 100644 (file)
@@ -3,7 +3,7 @@ from django.shortcuts                import render_to_response
 
 from unfold.loginrequired           import LoginRequiredView
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class SliceTabTestbeds (LoginRequiredView, ThemeView):
     template_name = "slice-tab-testbeds.html"
index 008222c..e79b48e 100644 (file)
@@ -14,10 +14,10 @@ from unfold.page                     import Page
 from manifold.core.query             import Query, AnalyzedQuery
 from manifoldapi.manifoldapi         import execute_query
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class SliceView (LoginRequiredView, ThemeView):
     template_name = "slice-view.html"
     
     def get(self, request, slicename):
-        return render_to_response(self.template, {"slice": slicename, "theme": self.theme, "username": request.user, "section":"slice"}, context_instance=RequestContext(request))
+        return render_to_response(self.template, {"slice": slicename, "theme": self.theme, "username": request.user, "section": "Slice %s" % slicename }, context_instance=RequestContext(request))
index e799153..7cf80f9 100644 (file)
@@ -31,7 +31,7 @@ from plugins.slicestat               import SliceStat
 
 from myslice.configengine            import ConfigEngine
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 tmp_default_slice='ple.upmc.myslicedemo'
 
index a014b34..e8a798c 100644 (file)
-/* @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 */
+html { height: 100% }
 
 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;
+    background-color:white;
+    color:black;
+    margin:0;
+    padding:0;
+    height: 100%;
 }
-
-input {
-    border-radius: 3px;
-    border: none;
-    border: 1px solid #ccc;
+a, a:active, a:focus {
+    outline: 0;
 }
 
-div.dataTables_length label, 
-div.dataTables_filter label,
-div.dataTables_info {
-    font-family: Ubuntu, Arial, sans-serif ;
+h1 {
+    border-bottom:1px solid #DDDDDD;
+    padding:0 0 0 0;
+    margin:0 0 0 0;
+    font-size:18pt;
 }
-
-
-
-
-/* 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;
+h1 img {
     vertical-align:middle;
-    background: url('../img/tablesort-header.png') no-repeat ; 
+    margin-bottom:6px;
 }
-
-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 ;
+h2 {
+    font-size:14pt;
+    color:#333333;
 }
-
-div.QueryTable table.dataTable thead { 
-    background: url('../img/tablesort-header.png') repeat-x ;
-    background-color: #caebea;
+h3 {
+    font-size:13pt;
+    color:#201E62;
 }
 
-div.QueryTable table.dataTable tfoot { 
-    background: url('../img/tablesort-header.png') repeat-x ;
-    /* background-color: # ; */
+div.wrapper {
+    width:980px;
+    margin:0 auto;
+    position:relative;
 }
-
-
-/* QUERY EDITOR */
-
-table.query-editor {
-    margin: 40px auto ;
-    clear: both;
-    /* width: 80%;*/
-    width: 100% ;
-    font-family: Ubuntu;
+div.container {
+    width:980px;
+    margin:25px auto;
 }
-
-.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
+div.wide {
+    margin:25px auto;
+    padding:0 25px;
 }
 
-table.query-editor td {
-    padding: 5px 5px ;
-    font: normal 12px Ubuntu, Arial, sans-serif ;
+span.label {
+    font-size:11pt;
+    color:gray;
+    font-weight:normal;
+    padding:0;
 }
-
-
-
-/* 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;
+/***** Notifications *****/
+.warning {
+    border: 1px solid red;
+    margin: 20px 60px;
+    padding: 10px 20px;
+    color: red;
+    background-color: #f2dbdb;
     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 {
@@ -506,7 +93,7 @@ div#secondary li:last-child {
 }
 
 div#navigation {
-    background-color:black;
+    background-color:orange;
     width:100%;
     height:40px;
 }
@@ -544,10 +131,47 @@ div#navigation li:last-child {
     margin-right:0;
 }
 
+div#navigation li.active {
+       padding:5px;
+    padding-top: 15px;
+    min-height: 40px;
+    margin-top: 0px;
+       background-color:gray;
+       color:#FF0000;
+}
+div#navigation li.slices {
+    position:relative;
+    cursor:pointer;
+}
+div#navigation .dropdown-menu {
+    color:white;
+    padding:0 15px 15px 15px;
+    margin-top:5px;
+    margin-left:-16px;
+    background-color:orange;
+}
+div#navigation .dropdown-menu a {
+    color:white;
+}
+
+div#menu-slice-list{
+    display:none;
+    position:absolute;
+    background-color:orange;
+    padding:15px;
+    left:-15px;
+    z-index:10;
+}
+
+div#navigation .dropdown-menu li:first-child {
+    border-bottom:1px solid white;
+    padding-bottom:5px;
+     
+}
 /* HOME DASHBOARD */
 div#home-dashboard {
     color:black;
-    margin:25px 0;
+    margin:0 auto 25px auto;
 }
 div#home-dashboard table {
     margin:25px;
@@ -564,12 +188,34 @@ div#home-dashboard table tr:first-child td {
     color:#270A5A;
 }
 div#home-dashboard table tr:last-child td {
+    vertical-align:top;
+    padding:25px 0;
+}
+div#home-dashboard table tr:last-child td.logged-in {
+    border-right:1px solid #DDDDDD;
+    padding:25px;
+}
+div#home-dashboard table tr:last-child td.support {
+    border-left: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.logged-in div {
     text-align:left;
+    padding:25px 0;
+}
+div#home-dashboard table tr:last-child td.support div {
+    text-align:left;
+    padding:25px 0;
+}
+div#home-dashboard div.login-widget {
+    padding:20px;
 }
 div#home-dashboard table td.support {
-    font-size:14pt;
-    vertical-align:top;
-    padding-left:11%;
 }
 div#home-dashboard table td.support a {
 }
@@ -577,6 +223,23 @@ div#home-dashboard table td.support a:hover {
     text-decoration:none;
 }
 
+div#home-dashboard div#manager {
+    display:none;
+}
+
+div#home-dashboard div#home-slice-list {
+    margin:25px 0;
+    padding:0 25px;
+    text-align:left;
+}
+div#home-dashboard div#home-slice-list ul {
+    list-style: none;
+    padding:0;
+    margin:0;
+}
+div#home-dashboard div#home-slice-list li {
+    
+}
 
 .login-submit {
     vertical-align:middle;
@@ -598,31 +261,222 @@ div#home-dashboard table td.support a:hover {
 }
 /**/
 
-/* NAV TABS */
+/**/
+/* WELL */
+div.well {
+}
+/**/
+/* BUTTON */
+.btn.btn-default {
+    font-weight: bold;
+}
+
+.btn.btn-default:hover {
+    font-weight: bold;
+}
+/**/
+/* TABLE */
+table.table {
+    margin:0;
+}
+table.table thead {
+    padding:0;
+}
+table.table tbody {
+    padding:0;
+}
+table.table tr {
+    padding:0;
+}
+table.table td {
+    padding:0;
+}
+/* INSTITUTION */
+div#institution {
+    color:black;
+}
+.form-hint {
+    font-size:11pt;
+    font-style:italic;
+    color:gray;
+}
+
 
-.nav.nav-tabs {
+.form-hint {
+    font-size:11pt;
+    font-style:italic;
+    color:gray;
 }
 
-.nav.nav-tabs li.active a {
-   
+
+
+/* TICKET REQUEST */
+div#ticket-request {
+    color:black;
+}
+.form-hint {
+    font-size:11pt;
+    font-style:italic;
+    color:gray;
+}
+div#ticket-request p {
+    margin:20px 0;
 }
 
-.nav.nav-tabs li a {
+ul.nav-tabs {}
+ul.nav-tabs ul {}
+ul.nav-tabs li {}
+
+ul.nav-section li a {
+    border-bottom:0;
+}
+ul.nav-section li:first-child {
+    padding:0;
+}
+ul.nav-section li:first-child a {
+    font-weight:bold;
+    padding:6px 15px 4px 15px;
+}
+ul.nav-section li:first-child.active a {
+    padding:6px 15px 3px 15px;
+}
+ul.nav-section li:first-child img {
+    margin:0 4px 1px 0;
+    padding:0;
 }
 
-.nav.nav-tabs li a:hover {
+ul.nav-resources {
+    margin:15px 0;
+}
+ul.nav-resources a {
+    padding: 4px 10px 5px 10px;
 }
 
-/**/
-/* WELL */
-div.well {
+
+/* SLICE VIEW */
+
+
+div#slice-view {
+    margin:0;
 }
-/**/
-/* BUTTON */
-.btn.btn-default {
+div.list-group-item {
+    border:0;
+    background-color:white;
+    font-weight:bold;
+    padding-left:0;
+}
+a.list-group-item {
+    border:0;
+    background-color:white;
+    padding:3px 0 3px 10px;
+    border-left:2pt white solid;
+}
+a.list-group-item.active, a.list-group-item.active:hover {
     font-weight: bold;
+    color:black;
+    background-color:transparent;
+    border-left:2pt blue solid;
+}
+a.list-group-item.active:hover {
+    background-color:#dddddd;
+}
+a.list-group-item:hover {
+    border-left:2pt blue solid;
+}
+a.list-group-item p.list-group-item-text {
+    font-size:9pt;
+    font-style:italic;
+    font-weight: normal;
+    color: black !important;
+}
+
+div#slice-info {
+    margin-top:25px;
+}
+div#slice-info table {
+    width:100%;
+    margin:0 auto;
+}
+div#slice-info table td:first-child {
+    text-align:right;
+    font-weight:bold;
+    padding-right:15px;
+}
+div#slice-info td {
+    padding:5px;
+}
+
+/* SLICE VIEW sections */
+.slice-sections, .slice-pending {
+    margin:0;
+    padding:0;
+}
+.slice-sections ul, .slice-pending ul {
+    margin:0;
+    padding:0;
+}
+.slice-pending ul {
+    width:400px;
+    margin:0 auto 15px auto;
+}
+.slice-sections li {
+    text-align:left;
+    margin:0;
+    padding:0;
+}
+.slice-pending li {
+    padding-right:15px;
+}
+.slice-sections li a, .slice-pending li a {
+    font-size:14px;
+    color:black;
+    padding:0;
+}
+.slice-sections li.active a, .slice-pending li.active a  {
+    color:#201E62;
+    background-color:#EFEFEF;
+    text-decoration:underline;
+    padding:0;
+}
+.slice-sections ul.nav-pills li a:hover, .slice-pending ul.nav-pills li a:hover {
+    text-decoration:underline;
+    background-color:#EFEFEF;
+    color:black;
+}
+.slice-sections ul.nav-pills li.active, .slice-pending ul.nav-pills li.active {
+
+}
+.slice-sections li:first-child, .slice-sections li:first-child a {
+    color:#201E62;
+    font-weight:bold;
+}
+.slice-experiment {
+    text-align:right;
+    padding:0;
+}
+.slice-experiment button {
+    margin:3px 0 0 0;
+    background-color:#CC4125;
+    color:white;
+}
+
+.slice-pending {
+}
+.slice-pending button {
+    font-size:9pt;
+    margin:-2px 0 0 0;
+    padding:3px 5px;
+}
+.slice-pending button.apply {
+}
+.slice-pending button.clear {
+}
+tr.active, tr.active td {
+    background-color:#FFFFCC !important;
+}
+
+div.dataTables_filter label{
+    float:left;
+    width:400px;
 }
 
-.btn.btn-default:hover {
-    font-weight: bold;
-}
\ No newline at end of file
index c39de29..0a0559a 100644 (file)
@@ -15,11 +15,12 @@ h1 {
     border-bottom:1px solid #DDDDDD;
     padding:0 0 0 0;
     margin:0 0 0 0;
-    font-size:18pt;
+    font-size:14pt;
 }
 h1 img {
     vertical-align:middle;
-    margin-bottom:6px;
+    margin-bottom:4px;
+    margin-right:10px;
 }
 h2 {
     font-size:14pt;
@@ -261,21 +262,6 @@ div#home-dashboard div#home-slice-list li {
 }
 /**/
 
-/* 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 {
@@ -338,19 +324,24 @@ div#ticket-request p {
     margin:20px 0;
 }
 
-/* SLICE VIEW */
-ul.nav-sliceview {}
-ul.nav-sliceview li {
-    
+ul.nav-tabs {}
+ul.nav-tabs ul {}
+ul.nav-tabs li {}
+
+ul.nav-section li a {
+    border-bottom:0;
 }
-ul.nav-sliceview li:first-child {
+ul.nav-section li:first-child {
     padding:0;
 }
-ul.nav-sliceview li:first-child a {
+ul.nav-section li:first-child a {
     font-weight:bold;
     padding:6px 15px 4px 15px;
 }
-ul.nav-sliceview li:first-child img {
+ul.nav-section li:first-child.active a {
+    padding:6px 15px 3px 15px;
+}
+ul.nav-section li:first-child img {
     margin:0 4px 1px 0;
     padding:0;
 }
@@ -362,7 +353,7 @@ ul.nav-resources a {
     padding: 4px 10px 5px 10px;
 }
 
-
+/* SLICE VIEW */
 
 
 div#slice-view {
@@ -370,22 +361,57 @@ div#slice-view {
 }
 div.list-group-item {
     border:0;
+    -moz-border-radius: 0;
+    border-radius: 0;
     background-color:white;
     font-weight:bold;
     padding-left:0;
 }
 a.list-group-item {
+    -moz-border-radius: 0;
+    border-radius: 0;
     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:hover {
+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;
+    color:black;
+    background-color:#F5F5F5;
+    border-left:2pt blue solid;
+}
+
+a.list-group-item:hover {
+    -moz-border-radius: 0;
+    border-radius: 0;
     border-left:2pt blue solid;
 }
 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#slice-info {
+    margin-top:25px;
+}
+div#slice-info table {
+    width:100%;
+    margin:0 auto;
+}
+div#slice-info table td:first-child {
+    text-align:right;
+    font-weight:bold;
+    padding-right:15px;
+}
+div#slice-info td {
+    padding:5px;
 }
 
 /* SLICE VIEW sections */
@@ -456,3 +482,7 @@ a.list-group-item p.list-group-item-text {
 tr.active, tr.active td {
     background-color:#FFFFCC !important;
 }
+div.dataTables_filter label{
+    float:left;
+    width:400px;
+}
index 1ddb3e3..5595b3e 100644 (file)
@@ -1,42 +1,22 @@
 $(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() {
-        $('input:checkbox.user').each(function (index) {
-            if(this.checked){
-                var record_id = this.id;
-                $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
-                    if(data.success){
-                        $('tr[id="'+record_id+'"]').fadeOut("slow");
-                        $('tr[id="'+record_id+'"]').remove();
-                    }else{
-                        alert("Rest Error for "+record_id+": "+data.error);
-                    }
-                });
-                
-            }
-        });
-    });
     $('button#deleteslices').click(function() {
         $('input:checkbox.slice').each(function (index) {
             if(this.checked){
@@ -86,3 +66,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' ]
+               }
+       );
+}*/
index 7038e53..2f86655 100644 (file)
@@ -6,24 +6,6 @@ function list() {
        this.elements = [];
 }
 
-list.prototype.save = function() {
-       for (var prop in this) {
-      if (typeof this[prop] != 'function') {
-        console.log("prop: " + prop);
-      } else {
-       console.log("func: " + prop);
-      }
-    }
-       //localStorage.setItem(name, JSON.stringify(value));
-};
-
-list.prototype.load = function(name) {
-       this.pending = JSON.parse(localStorage.getItem(name));
-       if (!this.pending) {
-               this.pending = [];
-       }
-};
-
 list.prototype.add = function(element) {
        if (!this.has(element)) {
                this.elements.push(element);
@@ -60,14 +42,14 @@ function resources() {
        };
 };
 
-function users() {
+function leases() {
        this.pending = {
                toremove: new list(),
                toadd: new list(),
        };
 };
 
-function leases() {
+function users() {
        this.pending = {
                toremove: new list(),
                toadd: new list(),
@@ -83,27 +65,19 @@ function slice(name) {
        this.users = new users();
        this.leases = new leases();
        
-};
-slice.prototype.pending = function() {
-       
-};
-slice.prototype.reserve = function() {
-       
-};
-slice.prototype.unreserve = function() {
-       
 };
 
+
 /*
  * User
  */
-function user(u) {
-       this.u = u;
-       this.testbeds = {};
-       this.slices = {};
+function user(user) {
+       this.user = user;
+       this.testbeds = new list();
+       this.slices = new list();
        
-       for (i = 0; i < this.u.slices.length; i++) {
-               this.slices[this.u.slices[i]] = new slice(this.u.slices[i]);
+       for (i = 0; i < this.user.slices.length; i++) {
+               this.slices[this.user.slices[i]] = new slice(this.user.slices[i]);
        }
 };
 
@@ -113,7 +87,7 @@ user.prototype.slice = function(name) {
 
 user.prototype.list = function() {
     for (s in this.slices) {
-       for (o in s) {
+    for (o in s) {
       if (typeof o != 'function') {
         console.log(o);
       } else {
@@ -128,7 +102,25 @@ user.prototype.list = function() {
  */
 var myslice = {
        user: {},
-    
+       
+       user: function() {
+               if ($.isEmptyObject(this.user)) {
+                       //this.login(function() { return this.user; });
+                       this.user = JSON.parse(localStorage.getItem('user'));
+               }
+               return this.user;
+       },
+
+       login: function(fn) {
+        user = localStorage.getItem('user');
+        if($.isEmptyObject(user)){
+                   $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+                           //myslice.user = new user(data[0]);
+                           localStorage.setItem('user', JSON.stringify(data[0]));
+                   });
+        }
+       },
+
     getSlices: function(name) {
        
     },
@@ -197,6 +189,8 @@ var myslice = {
 
 
 $(document).ready(function() {
+       //console.log(myslice.user().slices);
+       
        // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function(data) {
                // myslice.user = new user(data[0]);
                // console.log(myslice.user.slices);
index a418093..1f997d0 100644 (file)
@@ -3,6 +3,11 @@ $(document).ready(function() {
         $('.'+this.id).trigger('show');
     });
 
+    $('a.sl-platform').click(function (e) {
+        $('.'+this.id).trigger('show');
+    });
+
+
        $('ul.nav-resources a').click(function() {
         $('ul.nav-resources li').removeClass('active');
         $(this).parent().addClass('active');
@@ -14,11 +19,18 @@ $(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 = '<div class="list-group-item sl-platfrom"><span class="list-group-item-heading">Testbeds</span></div>';
+               var list = '<div class="list-group-item sl-platform"><span class="list-group-item-heading">Testbeds</span></div>';
                for(i=0; i<data.length;i++) {
-                       list += '<a href="#" class="list-group-item sl-platfrom" data-platform="'+data[i].network_hrn+'"><span class="list-group-item-heading">'+data[i].network_longname+'</span><p class="list-group-item-text">'+data[i].network_hrn+'</p></a>';
+                       list += '<a href="#" class="list-group-item sl-platform" data-platform="'+data[i].network_hrn+'"><span class="list-group-item-heading">'+data[i].network_longname+'</span><p class="list-group-item-text">'+data[i].network_hrn+'</p></a>';
                }
                $('#select-platform').html(list);
        }).done(function() {
index bbb5b49..5bd0d75 100644 (file)
@@ -12,7 +12,7 @@ from manifoldapi.manifoldresult import ManifoldResult
 from ui.topmenu import topmenu_items, the_user
 from myslice.configengine import ConfigEngine
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 
 class SupportView (FreeAccessView, ThemeView):
     template_name = 'supportview.html'
@@ -33,7 +33,7 @@ class SupportView (FreeAccessView, ThemeView):
             env['person'] = None
     
         env['theme'] = self.theme
-    
+        env['section'] = "Support"
 
         env['username']=the_user(request)
 
index 9b124f2..4c4817a 100644 (file)
@@ -1,41 +1,99 @@
-{% extends "layout.html" %}
+{% extends "layout_wide.html" %}
 
 {% block content %}
-<div class="row">
-       <h1><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> About</h1>
+<div class="container">
+    <div class="row">
+        <div class="col-md-12">
+            <ul class="nav nav-tabs nav-section">
+                <li class="active"><a href="#about"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About" />About</a></li>
+                <li><a href="#components">Underlying technologies</a></li>
+            </ul>
+        </div>
+    </div>
 </div>
 
-<div class="row">
-       <h3>A ready-made and easily customisable user interface for your testbed.</h3>
-
-       <p>
-               MySlice is an ambitious project aiming to support researchers throughout the lifecycle of experiments that can run on a variety 
-               of testbeds spanning different administrative domains and networking technologies. Its basic principle is to bring together 
-               available resources with useful information (characteristics, performance, network measurements).
-       </p>
-       <p>
-       MySlice inititiave started in Janury 2011 by offering annotation services for the first ederated experimental resources. Today, 
-       MySlice has taken a big step toward becoming a tand-alone web framework, which will present all available resources from testbeds 
-       across the world, interconnected through the Slice-based Facility Architecture (SFA) and annotated by the TopHat measurement system.
-       </p>
-       <p>
-       Our framework is built with standard programming tools (php and javascript for the front-end and python for the back-end) 
-       and has a modular structure based on the concept of plugins for implementing different core functionalities (query editing, 
-       data display, and resource allocation).
-       </p>
-       <p>
-       The goal is to enable developers with expertise on different testbed technologies and different experimental 
-       practices to work in parallel for optimizing the tools presented to the users allowing them for a wide range of choices 
-       according to their own requirements. Opening in this way the development of web-based user tools for experimentation and 
-       sharing effort and information can increase significantly the chances for the achievement of our challenging objective.
-       </p>
-       <p>
-       You can access the code at git.myslice.info. If you need write access to the git repository you need first to send
-        your public key to <a href="mailto:support@myslice.info">support@myslice.info</a>. 
-       </p>
-       <p>
-               Go to the <a href ="http://myslice.info">MySlice web site</a> or the <a href ="http://onelab.eu">OneLab public web site</a>
-       </p>
+
+<div class="container tab-content">
+    <div class="tab-pane active row" id="about">
+               <div class="col-md-12">
+                       <p>
+                               OneLab Portal is a central place to get acess to all OneLab testbeds.In order to get access to the portal,
+                               an experimenter needs to  <a href="/portal/register">register</a> to the portal. The portal administrative body
+                               is responsible to accept or reject newly registered users.   
+                       </p>
+                       <p>
+                               To learn more about OneLab visit:  <a href="http://onelab.eu/" target="_blank">http://onelab.eu/</a>                    
+                       </p>
+                       <p>
+                               If you have any questions regarding using the portal visit: <a href="/portal/support">OneLab support</a>
+                       </p>
+                       <p>
+                               OneLab portal is a community effot. To get more information about OneLab portal team visit: 
+                               <a href="http://myslice.info/community" target="_blank">http://myslice.info/community</a>
+                       </p>
+               </div>
+       </div>
+       <div class="tab-pane row" id="components">
+               <div class="col-md-12">
+                       <h3>A ready-made and easily customisable user interface for your testbed.</h3>
+                               <p>
+                                       MySlice is an ambitious project aiming to support researchers throughout the lifecycle of experiments that can run on a variety 
+                                       of testbeds spanning different administrative domains and networking technologies. Its basic principle is to bring together 
+                                       available resources with useful information (characteristics, performance, network measurements).
+                               </p>
+                               <p>
+                                       MySlice inititiave started in Janury 2011 by offering annotation services for the first ederated experimental resources. Today, 
+                                       MySlice has taken a big step toward becoming a tand-alone web framework, which will present all available resources from testbeds 
+                                       across the world, interconnected through the Slice-based Facility Architecture (SFA) and annotated by the TopHat measurement system.
+                               </p>
+                               <p>
+                                       Our framework is built with standard programming tools (python and javascript for the front-end and python for the back-end) 
+                                       and has a modular structure based on the concept of plugins for implementing different core functionalities (query editing, 
+                                       data display, and resource allocation).
+                               </p>
+                               <p>
+                                       The goal is to enable developers with expertise on different testbed technologies and different experimental 
+                                       practices to work in parallel for optimizing the tools presented to the users allowing them for a wide range of choices 
+                                       according to their own requirements. Opening in this way the development of web-based user tools for experimentation and 
+                                       sharing effort and information can increase significantly the chances for the achievement of our challenging objective.
+                               </p>
+               </div>
+               <div class="col-md-12">
+                       <h3>Portal Components</h3>
+                               <h5>Myslice (Web Frontend)</h5>
+                                       <p>
+                                               MySlice is an ambitious project aiming to support researchers throughout the 
+                                               lifecycle of experiments that can run on a variety of testbeds spanning different 
+                                               administrative domains and networking technologies. Its basic principle is to bring 
+                                               together available <b>resources</b> with <b>useful information</b> (characteristics, performance, network measurements).
+                                       </p>
+                                       <p> More Info: <a href="http://myslice.info/" target="_blank">http://myslice.info/</a></p>
+                                       <p> Code: <a href="http://git.onelab.eu/?p=myslice.git;a=summary" target="_blank">Git Repository</a> (read only)</p> 
+                                       <p> 
+                                               If you need write access to the git repository you need first to send your public key to <a href="mailto:support@myslice.info">support@myslice.info</a>.
+                                       </p>
+
+
+                               <h5>Manifold (Portal backend)</h5>
+                                       <p>Manifold is the backend that is running behind the portal.</p>
+                                       <p> Documentation: <a href="http://trac.myslice.info/" target="_blank">http://trac.myslice.info/</a></p>
+                                       <p> Code: <a href="https://git.top-hat.info/?p=tophat.git;a=shortlog;h=refs/heads/devel" target="_blank">Git Repository</a> (read only)</p>     
+
+                               <h5>OneLab Registry</h5>
+                                       <p>It's a SFA registry. SFA Registry is a specific installation mode of the SFAWrapper (Registry Only mode).</p>
+                                       <p> More Info: <a href="http://svn.planet-lab.org/wiki/SfaDeveloperRegistryTutorial#RunninginRegistry-Onlymode" target="_blank">SFA Registry</a></p>
+       </div>
+   </div>
 </div>
 
+<script>
+$(document).ready(function() {
+    $('.nav-tabs a').click(function (e) {
+        e.preventDefault();
+        $(this).tab('show');
+    });
+});
+</script>
+
+
 {% endblock %}
index f435500..353a83c 100644 (file)
@@ -1,4 +1,4 @@
-{% extends "layout.html" %}
+{% extends "layout_wide.html" %}
 {% block content %}
 
 
     {% endfor %}
 </ul>
 {% endif %}
-
-<div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="" /> User Account</h1>
+<div class="container">
+       <div class="row">
+               <div class="col-md-12">
+                       <ul class="nav nav-tabs nav-section">
+                               <li class="active"><a href="#profile"><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Account" /> User Profile</a></li>
+                               <li><a href="#account">Account</a></li>
+                               <li><a href="#access">Testbed Access</a></li>
+                       </ul>
+           </div>
+       </div>
 </div>
+<div class="container tab-content">
+       <div class="tab-pane active row" id="profile">
+               
+               <div class="col-md-12">
 
-<div class="row">
-    <ul class="nav nav-tabs">
-      <li class="active"><a class="account-tab" data-panel="user_profile" href="#">User Profile</a></li>
-      <li><a class="account-tab" data-panel="principal_acc" href="#">User Account</a></li>
-      <li><a class="account-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
-    </ul>
-       
-       <div class="account-panel" id="user_profile">
-       <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
-       <div>
-               {% csrf_token %}
-                       <table class="profile">          
-                       <tr>
-                               <td colspan="2">
-                                               <div>Platform: Myslice</div>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td class="key">Email</td>
-                               <td class="value">
-                                               <span id="emailval" class="value" >{{ person.email }}</span>
-                                               <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert();"  title="To change your affiliation please contact the administrator">
-                                               <span class="glyphicon glyphicon-question-sign"></span> Edit
-                                               </button>
-                                       </td>
-                       </tr>
-                       <tr class="odd">
-                                       <td class="key">Password</td>
-                                       <td class="value"> 
-                                               <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
-                                                       <span class="glyphicon glyphicon-edit"></span> Edit
-                                               </button>
-                                               <span id="passval"class="value">******** </span>
-                                               <span class="hide_this" id="span_pass">
-                                               <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
-                                               <div style='display:none;' id="pass_form">
-                                               <input type='hidden'  value='' /></div>
-                                               <table id="edit_password">
-                                                       <tr>
-                                                                       <td>Enter password: </td>
-                                                                       <td class="field"> <input type="password" name="password" id="password" /> </td>
-                                                               </tr>
-                                                               <tr>
-                                                                       <td>Confirm password: </td>
-                                                                       <td class="field"> 
-                                                                               <input type="password" name="confirmpassword" id="confirmpassword" /> 
-                                                                               <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/> 
-                                                                       </td>
-                                                       </tr>
-                                               </table>
-                                               </span> 
-                                       </td>
-                       </tr>
-                       <tr class="even">
-                                       <td class="key">Full Name</td>
-                                       <td class="value">
-                                               <span id="nameval" class="value" >{{ fullname }} </span>
-                                               <span class="hide_this" id="span_name">
-                                               <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
-                                               <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
-                                               <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
-                                               <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
-                                               <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
-                                               </span>
-                                               <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
-                                                       <span class="glyphicon glyphicon-edit"></span> Edit
-                                               </button>
-                                       </td>
-                       </tr>
-                       <tr class="odd">
-                                       <td class="key">Authority</td>
-                                       <td class="value">
-                                               <span id="affval" class="value">{{ authority }}</span>
-                                                <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()"  title="To change your authority please contact the administrator">
-                                               <span class="glyphicon glyphicon-question-sign"></span> Edit
-                                                </button>
-                                       </td>
-                               </tr>
-                               {%if 'Enabled'  in user_status %}
-                               <tr class="even">
-                                       <td class="key">Generate Keys</td>
-                                       <td>
-                                               <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
-                                                          onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');" 
-                                                          title="It will generate a new key Pair and your current credentials will be overwritten."/>
-                               </td> 
-                       </tr>
-                       <tr class="odd">
-                               <td class="key">Public Key</td>
-                               <td class="value">
-                                               <span id="keyval" class="value">******** </span>
-                                               <span class="hide_this" id="span_upload">
-                                                       <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
-                                                       <div style='display:none;'>
-                                                               <input type='hidden'  name='upload'  /></div>
-                                                               <input type="file" name="pubkey" class="required" id="pubkey"/>  
-                                                               <input class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Upload your public key" value="Upload"
-                                                                  onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
-                                               </span>
-                                               <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
-                                               <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
-                                                       <span class="glyphicon glyphicon-download"></span> Download
-                                               </button>
-                                               <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
-                                                       <span class="glyphicon glyphicon-upload"></span> Upload
-                                               </button>       
-                               </td>
-                       </tr>
-                       <tr class="even" id="pkey_row">
-                                {%if 'N/A' not in user_private_key%}
-                               <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
-                               <td class="value">********<a href="#">
-                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
-                                                       <span class="glyphicon glyphicon-download"></span> Download     
-                                               </button>
-                                       <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
-                                                               onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
-                               </td>
-                                 {%else%}
-                                       <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
-                                       <td class="value">********<a href="#">
-                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
-                                               <span class="glyphicon glyphicon-download"></span> Download 
-                                       </button>
-                                       <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
-                                       </td>
-                                {%endif%}              
-                               </tr>
-                               <tr class="odd">
-                               <td colspan="2">
-                                       <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
-                                                       <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
-                                                       <b>Security:</b> Manual account delegation. Download & Delete private key.
-                                               </p>
-                               </td>
-                               </tr>
-                               {%endif%}
-                       </table>
+                       <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
+                               {% csrf_token %}
+                                       <table class="profile">          
+                                       <tr>
+                                               <td colspan="2">
+                                                               <div>Platform: Myslice</div>
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td class="key">Email</td>
+                                               <td class="value">
+                                                               <span id="emailval" class="value" >{{ person.email }}</span>
+                                                               <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert();"  title="To change your affiliation please contact the administrator">
+                                                               <span class="glyphicon glyphicon-question-sign"></span> Edit
+                                                               </button>
+                                                       </td>
+                                       </tr>
+                                       <tr class="odd">
+                                                       <td class="key">Password</td>
+                                                       <td class="value"> 
+                                                               <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
+                                                                       <span class="glyphicon glyphicon-edit"></span> Edit
+                                                               </button>
+                                                               <span id="passval"class="value">******** </span>
+                                                               <span class="hide_this" id="span_pass">
+                                                               <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
+                                                               <div style='display:none;' id="pass_form">
+                                                               <input type='hidden'  value='' /></div>
+                                                               <table id="edit_password">
+                                                                       <tr>
+                                                                                       <td>Enter password: </td>
+                                                                                       <td class="field"> <input type="password" name="password" id="password" /> </td>
+                                                                               </tr>
+                                                                               <tr>
+                                                                                       <td>Confirm password: </td>
+                                                                                       <td class="field"> 
+                                                                                               <input type="password" name="confirmpassword" id="confirmpassword" /> 
+                                                                                               <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/> 
+                                                                                       </td>
+                                                                       </tr>
+                                                               </table>
+                                                               </span> 
+                                                       </td>
+                                       </tr>
+                                       <tr class="even">
+                                                       <td class="key">Full Name</td>
+                                                       <td class="value">
+                                                               <span id="nameval" class="value" >{{ fullname }} </span>
+                                                               <span class="hide_this" id="span_name">
+                                                               <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
+                                                               <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
+                                                               <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
+                                                               <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
+                                                               <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
+                                                               </span>
+                                                               <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
+                                                                       <span class="glyphicon glyphicon-edit"></span> Edit
+                                                               </button>
+                                                       </td>
+                                       </tr>
+                                       <tr class="odd">
+                                                       <td class="key">Authority</td>
+                                                       <td class="value">
+                                                               <span id="affval" class="value">{{ authority }}</span>
+                                                                <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()"  title="To change your authority please contact the administrator">
+                                                               <span class="glyphicon glyphicon-question-sign"></span> Edit
+                                                                </button>
+                                                       </td>
+                                               </tr>
+                                               {%if 'Enabled'  in user_status %}
+                                               <tr class="even">
+                                                       <td class="key">Generate Keys</td>
+                                                       <td>
+                                                               <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
+                                                                          onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');" 
+                                                                          title="It will generate a new key Pair and your current credentials will be overwritten."/>
+                                               </td> 
+                                       </tr>
+                                       <tr class="odd">
+                                               <td class="key">Public Key</td>
+                                               <td class="value">
+                                                               <span id="keyval" class="value">******** </span>
+                                                               <span class="hide_this" id="span_upload">
+                                                                       <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
+                                                                       <div style='display:none;'>
+                                                                               <input type='hidden'  name='upload'  /></div>
+                                                                               <input type="file" name="pubkey" class="required" id="pubkey"/>  
+                                                                               <input class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Upload your public key" value="Upload"
+                                                                                  onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
+                                                               </span>
+                                                               <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
+                                                               <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
+                                                                       <span class="glyphicon glyphicon-download"></span> Download
+                                                               </button>
+                                                               <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
+                                                                       <span class="glyphicon glyphicon-upload"></span> Upload
+                                                               </button>       
+                                               </td>
+                                       </tr>
+                                       <tr class="even" id="pkey_row">
+                                                {%if 'N/A' not in user_private_key%}
+                                               <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
+                                               <td class="value">********<a href="#">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
+                                                                       <span class="glyphicon glyphicon-download"></span> Download     
+                                                               </button>
+                                                       <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
+                                                                               onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
+                                               </td>
+                                                 {%else%}
+                                                       <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
+                                                       <td class="value">********<a href="#">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
+                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                                       </button>
+                                                       <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
+                                                       </td>
+                                                {%endif%}              
+                                               </tr>
+                                               <tr class="odd">
+                                               <td colspan="2">
+                                                       <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
+                                                                       <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
+                                                                       <b>Security:</b> Manual account delegation. Download & Delete private key.
+                                                               </p>
+                                               </td>
+                                               </tr>
+                                               {%endif%}
+                                       </table>
+                       
                </div>
        </div>
 
-       <div class="account-panel" id="principal_acc" style="display:none;">
-
-       <h3>Principal Account <small>Account used for delegating credentials</small></h3>
-       <div class="raw">
+       <div class="tab-pane row" id="account">
+               <div class="col-md-12">
+       
+               <h3>Principal Account <small>Account used for delegating credentials</small></h3>
                <table class="table"> 
                        <tr class="odd"> 
                        <th>Platform</th> 
                </tr> 
                        {%endfor%}               
                </table>
-       </div>
-
-
+       
+               </div>
+       
 
        {%if 'Enabled'  in user_status %}
-       <div class="row">
+               <div class="col-md-12">
                <h3>Credentials <small>Delegated to Principal Account</small></h3>
                        <table class="table">
                                        <caption><b>Delegated User Credential</b></caption> 
                                {%endif%}
                </div>
        </div>
-       
-
 
-       <div class="account-panel" id="ref_acc" style="display:none;">
+       <div class="tab-pane row" id="access">
+               <div class="col-md-12">
+       
                <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
-               <div class="row">
-                       <table class="mytable table table-bordered table-hover"> 
-                           <tr class="odd"> 
-                               <th>Platform</th> 
-                               <th>Account Type</th>
-                                               <th>Reference to</th>
-                                               <th>Remove Account</th>
-                           </tr>   
-                           {% for row in ref_acc %}         
-                           <tr class="border_bottom">
-                               <td class="odd"> {{ row.platform_name }} </td>
-                               <td class="odd"> {{ row.account_type }} </td>
-                                               <td class="odd"> {{ row.account_reference }} </td>
-                                               <td class="odd">
-                                               <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
-                                                               <span class="glyphicon glyphicon-minus"></span>
-                                                       </button>
-                                               </td>
-                           </tr> 
-                           {%endfor%}               
-                       </table>
-               </div>
-               
+        <table class="mytable table table-bordered table-hover"> 
+            <tr class="odd"> 
+                <th>Platform</th> 
+                <th>Account Type</th>
+                               <th>Reference to</th>
+                               <th>Remove Account</th>
+            </tr>   
+            {% for row in ref_acc %}         
+            <tr class="border_bottom">
+                <td class="odd"> {{ row.platform_name }} </td>
+                <td class="odd"> {{ row.account_type }} </td>
+                               <td class="odd"> {{ row.account_reference }} </td>
+                               <td class="odd">
+                               <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
+                                               <span class="glyphicon glyphicon-minus"></span>
+                                       </button>
+                               </td>
+            </tr> 
+            {%endfor%}               
+        </table>               
                
                
                <h3>Add reference account to the following testbeds</h3>
-               <div class="row">
-                       <table class="mytable table table-bordered table-hover"> 
-                           <tr class="odd"> 
-                               <th>Platforms</th> 
-                               <th>Add Account</th>
-                           </tr>   
-                           {% for platform in platform_list %}         
-                           <tr class="border_bottom">
-                               <td class="odd"> {{ platform.platform_no_access }} </td>
-                               <td class="odd">
-                                                       <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
-                                                               <span class="glyphicon glyphicon-plus"></span>
-                                                       </button>
-                                               </td>
-                           </tr> 
-                           {%endfor%}               
-                       </table>
-               </div>
+        <table class="mytable table table-bordered table-hover"> 
+            <tr class="odd"> 
+                <th>Platforms</th> 
+                <th>Add Account</th>
+            </tr>   
+            {% for platform in platform_list %}         
+            <tr class="border_bottom">
+                <td class="odd"> {{ platform.platform_no_access }} </td>
+                <td class="odd">
+                                       <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
+                                               <span class="glyphicon glyphicon-plus"></span>
+                                       </button>
+                               </td>
+            </tr> 
+            {%endfor%}               
+        </table>
        </div>
 {%endif%} 
+</div>
 </form>
 </div>
 
 <script>
     $(document).ready(function() {
-               $('li#nav-account').addClass("active");
-
-        $('a.account-tab').click(function() {
-            $('ul.nav-tabs li').removeClass('active');
-            $(this).parent().addClass('active');
-            $('div.account-panel').hide();
-            $('div#'+$(this).data('panel')).show();
-        });
+       $('.nav-tabs a').click(function (e) {
+                       e.preventDefault();
+                       $(this).tab('show');
+                       id = $(this).attr('href').substr(1);
+               
+               });
+               
         $('button#createslice').click(function() {
             window.location="/portal/slice_request/";
         });
index c1d0d7d..430658c 100644 (file)
@@ -2,13 +2,17 @@
 
 {% block content %}
 <div class="row">
+       <div class="col-md-12">
        <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
+       </div>
 </div>
 <div class="row">
+       <div class="col-md-12">
        <h2>Query Received !</h2>
        <p>
        We will study your problem and get back to you as soon as possible.
        </p>
+       </div>
 </div>
 {% endblock %}
 
index c88902d..c008692 100644 (file)
@@ -1,13 +1,16 @@
 {% extends "layout.html" %}
+{% load portal_filters %}
 
 {% block content %}
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
-<div id="home-dashboard">
+<div class="row">
+{% widget '_widget_news.html' %}
+</div>
+<div class="row" id="home-dashboard">
        <ul class="nav nav-tabs">
-         <li class="active"><a href="#">USER</a></li>
-         <li><a href="#">MANAGER</a></li>
+         <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 id="user">
+       <div class="home-panel" id="user">
                <table>
                        <tr>
                                <td>ACCOUNT</td>
                                <td>SUPPORT</td>
                        </tr>
                        <tr>
-                               <td><a href="/portal/account"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a></td>
-                               <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+                               <td><a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a></td>
+                               <td><a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
                                <td><a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a></td>
                        </tr>
                        <tr>
-                               <td>
-                                       {% include '_widget-login-user.html' %}
+                               {% if person %}
+                               <td class="logged-in">
+                                       <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='/portal/account/'>{{person.email}}</a>
+                               </div>
+                               {% else %}
+                               <td>
+                                       {% widget '_widget-login-user.html' %}
+                               {% endif %}
                                </td>
                                <td>
-                                       
+                               {% if person %}
+                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+                                       <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+                               {% else %}
+                                       <button id="signupbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> Sign Up</button>
+                               {% endif %}
                                </td>
                                <td class="support">
-                                       <div><a href="/portal/contact">Contact</a></div>
-                                       <div><a href="">Documentation</a></div>
+                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
                                </td>
                        </tr>
                </table>
        </div>
-       <div id="manager">
+       <div class="home-panel" id="manager">
                <table>
                        <tr>
                                <td>INSTITUTION</td>
                                <td>SLICES</td>
-                               <td>SUPPORT</td>
+                               <td>REQUESTS</td>
                        </tr>
                        <tr>
                                <td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
-                               <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
-                               <td><a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a></td>
+                               <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
+                               <td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
                        </tr>
                        <tr>
-                               <td>
-                                       {% include '_widget-login-manager.html' %}
+                               {% if person %}
+                               <td class="logged-in">
+                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                               {% else %}
+                               <td>
+                                       {% widget '_widget-login-manager.html' %}
+                               {% endif %}
                                </td>
                                <td>
-                                       
+                                       {% if person %}
+                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
+                                       {% endif %}
                                </td>
                                <td class="support">
-                                       <div><a href="/portal/contact">Contact</a></div>
-                                       <div><a href="">Documentation</a></div>
+                                       {% if person %}
+                                   <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+                                       {% endif %}
                                </td>
                        </tr>
                </table>
        </div>
 </div>
+<script type="text/javascript">
+       $(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#validaterequestbtn').click(function() {
+                       window.location="/portal/validate/";
+               });
+               $('button#ticketbtn').click(function() {
+                       window.location="/portal/contact/";
+               });
+               $('button#signupbtn').click(function() {
+                       window.location="/portal/register/";
+               });
+               $('button#slicerequestbtn').click(function() {
+                       window.location="/portal/slice_request/";
+               });
+/*-------
+List of slices has been moved in 
+portal/templates/base.html
+This should go into session
+--------*/
+});
+</script>
 {% endblock %}
index ca9fe5a..8ec395b 100644 (file)
@@ -1,70 +1,74 @@
-{% extends "layout.html" %}
+{% extends "layout_wide.html" %}
+
 {% block head %} 
 <script type="text/javascript" src="{{STATIC_URL}}/js/institution.js"></script>
 {% endblock head %}
+
 {% block content %}
-<div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Institution: {{user_details.parent_authority}}</h1>
+<div class="container">
+       <div class="row">
+               <div class="col-md-12">
+                       <ul class="nav nav-tabs nav-section">
+                               <li class="active"><a href="#info"><img src="{{ STATIC_URL }}icons/authority-xs.png" alt="Institution" /> Institution {{user_details.parent_authority}}</a></li>
+                               <li><a href="#users">Users</a></li>
+                               <li><a href="#slices">Slices</a></li>
+                       </ul>
+           </div>
+       </div>
 </div>
-<div class="row" id="institution">
-    <ul class="nav nav-tabs">
-      <li class="active" id="authority-tab"><a class="home-tab" data-panel="institution" href="#">INFO</a></li>
-      <li id="users-tab"><a class="home-tab" data-panel="users" href="#">USERS</a></li>
-      <li id="slices-tab"><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
-    </ul>
-    <div class="home-panel" id="institution">
-        <div id="authority-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Authority" /></div>
-        <div id="authority-tab-loaded" style="display:none;">
-            <div id="authority-data" style="float:left; width:50%;"></div>
-            <div id="onelab_membership" style="float:right; width:50%;">
-                <img src="{{ STATIC_URL }}img/onelab-logo.png" alt="" /><br>
-                <div id="onelab-data"></div>
-            </div>
-        </div>
-    </div>
-    <div class="home-panel" id="users" style="display:none;">
-        <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-        <div id="user-tab-loaded" style="display:none;">
-            <table id="user-tab">
-                <tr>
-                    <th>+/-</th>
-                    <th>Email</th>
-                    <th>user_hrn</th>
-                    <th>First name</th>
-                    <th>Last name</th>
-                    <th>Enabled</th>
-                </tr>
-            </table>
-            <br>
-            <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
-        </div>
-       </div>
-    <div class="home-panel" id="slices" style="display:none;">
-        <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> create slice</button>
-        <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-        <div id="slice-tab-loaded" style="display:none;">
-            <table id="slice-tab">
-                <tr>
-                    <th>+/-</th>
-                    <th>slice_hrn</th>
-                    <th>users</th>
-                    <th>url</th>
-                    <th>nodes</th>
-                    <th>expiration</th>
-                </tr>
-            </table>
-            <br>
-            <div>
-                <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
-                <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
-            </div>
-        </div>
-    </div>
+<div class="container tab-content">
+       <div class="tab-pane active row" id="info">
+               <div class="col-md-12">
+                       <div id="authority-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Authority" /></div>
+                   <div id="authority-tab-loaded" style="display:none;">
+                       <div id="authority-data"></div>
+                   </div>
+          </div>
+       </div>
+       
+       <div class="tab-pane row" id="users" data-authority="{{user_details.parent_authority}}">
+               <div class="col-md-12">
+                       <table class="table"><tr><td><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></td></tr></table>
+                       {%if 'is_pi'  in pi %}  
+                       <div>
+                               <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
+                       </div>
+                       {%endif%}
+               </div>
+       </div>
+       <div class="tab-pane row" id="slices">
+               {%if 'is_pi'  in pi %}
+               <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> create slice</button>
+               {%else%}
+               <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> request slice</button>
+               {%endif%}
+           <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+           <div id="slice-tab-loaded" style="display:none;">
+               <table id="slice-tab">
+                   <tr>
+                       <th>+/-</th>
+                       <th>slice_hrn</th>
+                       <th>users</th>
+                       <th>url</th>
+                       <th>nodes</th>
+                       <th>expiration</th>
+                   </tr>
+               </table>
+               <br>
+                       {%if 'is_pi'  in pi %}
+               <div>
+                   <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
+                   <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
+               </div>
+                       {%endif%} 
+           </div>
+       </div>
 </div>
 <script>
     $(document).ready(function() {
         {% if person %}
         {% if user_details.parent_authority %}
+        
         $.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
             var authority_data = [];
             var onelab_data = [];
                 authority_row = "<img src='{{ STATIC_URL }}img/institutions/{{user_details.parent_authority}}.gif' alt='' /><br>";
                 authority_row += "<br>";
                 authority_row += "<b>authority:</b> "+val.authority_hrn+"<br>";
-                authority_row += "<br>";
-                authority_row += "<b>"+val.name+"</b><br>";
-                authority_row += "<br>";
-                authority_row += "<b>Address:</b> "+val.address+"<br>";
-                authority_row += "<b>City:</b> "+val.postcode+" "+val.city+"<br>";
-                authority_row += "<br>";
-                authority_row += "<b>Country:</b> "+val.country+"<br>";
-                authority_row += "<br>";
-                authority_row += "<br>";
-                authority_row += "<h2>Contacts</h2>";
-                authority_row += "<b>Legal:</b> ";
-                /*
-
-                TODO: find a way to express JSON correctly given the constrains: CSV / JSON
-
-                legal = jQuery.parseJSON(val.legal);
-                if($.isArray(legal)){
-                    $.each(legal, function(k,v){
-                        authority_row += k+" "+v+"<br>";
-                    });
-                }else{
-                */
-                    authority_row += val.legal+"<br>";
-                //}
-                authority_row += "<br>";
-                authority_row += "<b>Scientific:</b> ";
-                /*
-                scientific = jQuery.parseJSON(val.scientific);
-                if($.isArray(scientific)){
-                    $.each(scientific, function(v){
-                        authority_row += v+", ";
-                    });
-                }else{
-                */
-                    authority_row += val.scientific+"<br>";
-                //}
-                onelab_membership = "<b>Status: </b>"+val.onelab_membership;
-                onelab_data.push(onelab_membership);
                 authority_data.push(authority_row);
             });
             $("div#authority-data").html(authority_data.join( "" ));
         $.post("/rest/slice/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
             var list_slices = [];
             var table_slices = [];
-            /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+            /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
             $.each( data, function( key, val ) {
                 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
                 if(val.nodes=="undefined" || val.nodes==null){
                 }else{
                     nodes_length=val.nodes.length;
                 }
-
-                if(val.user=="undefined" || val.user==null){
-                    user_length=0;
+                if(val.users=="undefined" || val.users==null){
+                    users_length=0;
                 }else{
-                    user_length=val.user.length;
+                    users_length=val.users.length;
                 }
 
                 if(val.slice_url=="undefined" || val.slice_url==null){
                 slice_row = "<tr id='"+val.slice_hrn+"'>";
                 slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
                 slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
-                slice_row += "<td>"+user_length+"</td>";
+                slice_row += "<td>"+users_length+"</td>";
                 slice_row += "<td>"+slice_url+"</td>";
                 slice_row += "<td>"+nodes_length+"</td>";
                 slice_row += "<td>"+val.slice_expires+"</td>";
             $("div#slice-tab-loaded").css("display","block");
             $("div#slice-tab-loading").css("display","none");
         });
-
-        $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
-            var list_users = [];
-            var table_users = [];
-                       /* Available fields
-                       user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
-                       user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
-                       */
-            $.each( data, function( key, val ) {
-                list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
-
-                user_row = "<tr id='"+val.user_hrn+"'>";
-                user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
-                user_row += "<td>"+val.user_email+"</td>";
-                user_row += "<td>"+val.user_hrn+"</td>";
-                user_row += "<td>"+val.user_first_name+"</td>";
-                user_row += "<td>"+val.user_last_name+"</td>";
-                               user_row += "<td>"+val.user_enabled+"</td>";
-                user_row += "</tr>";
-                table_users.push(user_row);
-                
-            });
-            $("table#user-tab tr:last").after(table_users.join( "" ));
-            $("div#user-tab-loaded").css("display","block");
-            $("div#user-tab-loading").css("display","none");
-         });
+               
+               
+        // $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
+            // var list_users = [];
+            // var table_users = [];
+                       // /* Available fields
+                       // user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
+                       // user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
+                       // */
+            // $.each( data, function( key, val ) {
+                // list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+// 
+                // user_row = "<tr id='"+val.user_hrn+"'>";
+                // user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
+                // user_row += "<td>"+val.user_email+"</td>";
+                // user_row += "<td>"+val.user_hrn+"</td>";
+                // user_row += "<td>"+val.user_first_name+"</td>";
+                // user_row += "<td>"+val.user_last_name+"</td>";
+                               // user_row += "<td>"+val.user_enabled+"</td>";
+                // user_row += "</tr>";
+                // table_users.push(user_row);
+//                 
+            // });
+            // $("table#user-tab tr:last").after(table_users.join( "" ));
+            // $("div#user-tab-loaded").css("display","block");
+            // $("div#user-tab-loading").css("display","none");
+         // });
          {% endif %}
          {% endif %}
     });
+
+
 </script>
 {% endblock %}
index 576458a..8576d1a 100644 (file)
@@ -4,17 +4,22 @@
 
 
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="Join Federation" /> Join the OneLab Federation</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/testbed-xs.png" alt="Join Federation" /> Join the OneLab Federation</h1>
+       </div>
 </div>
 <div class="row">
-       
-       <p>
+       <div class="col-md-12">
+       <h3>
        OneLab welcomes companies, universities, and research laboratories to join the OneLab Federation of Testbeds. <br>
+       </h3>
+       <p>
        We are supported by the European Commision through its 7th Framework Programs and FIRE initiative (Future Internet Research and Experimentation), as well as by other national and international funding initiatives.
        </p>
        <p>
        If you wish to become a new member of OneLab Federation, you should first consult the Membership Agreement.
        </p>
+       </div>
 </div>
 
 {% if errors %}
     </ul>
 </div>
 {% endif %}
-  
+<form id="joinForm" method="post">
 <div class="row">
-  <form action="" id="joinForm" method="post">
+  
   {% csrf_token %}
-    <fieldset>
-      <table>
-        <tr><td colspan="2"><h4>Site Information</h4></td></tr>
-        <tr>
-          <th><label for="site_name">Site name: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_name" name="site_name" value="{{ site_name }}" size="20" maxlength="40" class="form-control" required> </td>
-        </tr>
-       <tr>
-          <th><label for="root_authority_hrn">Root authority: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td> 
-               <select id="root_authority_hrn" name="root_authority_hrn" class="form-control" required>
-               {% if root_authorities %}
-                    {% for root_auth in root_authorities %}
-               <option>{{ root_auth.authority_hrn }}</option>
-                    {% endfor %}
-               {% endif %}
-               </select>
+  <div class="col-md-6">
+       <h3>Site Information</h3>
+       
+       <div class="form-group">
+               <label for="site_name">Site name:</label>
+       <input type="text" id="site_name" name="site_name" value="{{ site_name }}" maxlength="40" class="form-control" required>
+    </div>
+       <div class="form-group">
+       <label for="root_authority_hrn">Root authority:</label>
+           <select id="root_authority_hrn" name="root_authority_hrn" class="form-control" required>
+                  {% if root_authorities %}
+                       {% for root_auth in root_authorities %}
+                  <option>{{ root_auth.authority_hrn }}</option>
+                       {% endfor %}
+                  {% endif %}
+               </select>
 <!--
                <div class="ui-widget">
                    <input id="root_authority_hrn" name="root_authority_hrn" class="form-control" value="{{ root_authority_hrn }}" required>
                </div>
 -->
-          </td>
-        </tr>
-        <tr>
-          <th><label for="site_authority">Site authority: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_authority" name="site_authority" value="{{ site_authority }}" size="10" maxlength="16" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="site_abbreviated_name">Abbreviated name: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_abbreviated_name" name="site_abbreviated_name" value="{{ site_abbreviated_name }}" size="20" maxlength="40" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="site_url">URL: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_url" name="site_url" value="{{ site_url }}" size="30" maxlength="128" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="site_latitude">Latitude: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_latitude" name="site_latitude" value="{{ site_latitude }}" size="10" maxlength="10" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="site_longitude">Longitude: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="site_longitude" name="site_longitude" value="{{ site_longitude }}" size="10" maxlength="10" class="form-control" required> </td>
-        </tr>
-        <tr><td colspan="2">&nbsp;</td></tr>
-        <tr><td colspan="2"><h4>Principal Investigator Information</h4></td></tr>
-        <tr>
-          <th><label for="pi_first_name">PI First Name: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="pi_first_name" name="pi_first_name" value="{{ pi_first_name }}" size="20" maxlength="20" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="pi_last_name">PI Last Name: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="pi_last_name" name="pi_last_name" value="{{ pi_last_name }}" size="20" maxlength="20" class="form-control" required> </td>
-        </tr>
+       </div>
+       <div class="form-group">
+               <label for="site_authority">Site authority:</label>
+               <input type="text" id="site_authority" name="site_authority" value="{{ site_authority }}" maxlength="16" class="form-control" required>
+    </div>
+       <div class="form-group">  
+        <label for="site_abbreviated_name">Abbreviated name:</label>
+        <input type="text" id="site_abbreviated_name" name="site_abbreviated_name" value="{{ site_abbreviated_name }}" maxlength="40" class="form-control" required>
+    </div>
+       <div class="form-group">  
+        <label for="site_url">URL:</label>
+        <input type="text" id="site_url" name="site_url" value="{{ site_url }}" maxlength="128" class="form-control" required>
+    </div>
+       <div class="form-group"> 
+        <label for="site_latitude">Latitude:</label>
+        <input type="text" id="site_latitude" name="site_latitude" value="{{ site_latitude }}" maxlength="10" class="form-control" required>
+    </div>
+       <div class="form-group"> 
+        <label for="site_longitude">Longitude:</label>
+        <input type="text" id="site_longitude" name="site_longitude" value="{{ site_longitude }}" maxlength="10" class="form-control" required>
+    </div>
+  </div>
+  
+  <div class="col-md-6">
+       <h3>Postal address</h3>
+
+       <div class="form-group">
+               <label class="" for="address_line1">Address: </label>
+        <input type="text" id="address_line1" name="address_line1" value="{{ address_line1 }}" maxlength="40" class="form-control">
+    </div>
+       <div class="form-group"> 
+        <label class="" for="address_line2">Address (2): </label>
+        <input type="text" id="address_line2" name="address_line2" value="{{ address_line2 }}" maxlength="40" class="form-control">
+    </div>
+       <div class="form-group"> 
+        <label class="" for="address_line3">Address (3): </label>
+        <input type="text" id="address_line3" name="address_line3" value="{{ address_line3 }}" maxlength="40" class="form-control">
+    </div>
+       <div class="form-group"> 
+        <label class="" for="address_city">City: </label>
+        <input type="text" id="address_city" name="address_city" value="{{ address_city }}" maxlength="20" class="form-control">
+    </div>
+       <div class="form-group"> 
+        <label class="" for="address_postalcode">Postal Code: </label>
+        <input type="text" id="address_postalcode" name="address_postalcode" value="{{ address_postalcode }}" size="10" maxlength="10" class="form-control">
+    </div>
+       <div class="form-group">
+        <label class="" for="address_state">State: </label>
+        <input type="text" id="address_state" name="address_state" value="{{ address_state }}" maxlength="20" class="form-control">
+    </div>
+       <div class="form-group">   
+        <label class="" for="address_country">Country: </label>
+        <input type="text" id="address_country" name="address_country" value="{{ address_country }}" maxlength="20" class="form-control">
+    </div>
+       
+  </div>
+</div>
+
+<div class="row"> 
+  
+  <div class="col-md-6">
+       
+       <h3>Principal Investigator Information</h3>
+
+       <div class="form-group">
+               <label for="pi_first_name">PI First Name</label>
+       <input type="text" id="pi_first_name" name="pi_first_name" value="{{ pi_first_name }}" maxlength="20" class="form-control" required>
+    </div>
+       <div class="form-group">    
+       <label for="pi_last_name">PI Last Name:</label>
+               <input type="text" id="pi_last_name" name="pi_last_name" value="{{ pi_last_name }}" maxlength="20" class="form-control" required>
 <!--
         <tr>
           <th><label class="" for="pi_title">PI Title: </label></th>
-          <td><input type="text" id="pi_title" name="pi_title" value="{{ pi_title }}" size="6" maxlength="6" class="form-text "> </td>
+          <td><input type="text" id="pi_title" name="pi_title" value="{{ pi_title }}" size="6" maxlength="6" class="form-control "> </td>
         </tr>
 -->
-        <tr>
-          <th><label for="pi_phone">PI Phone: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="pi_phone" name="pi_phone" value="{{ pi_phone }}" size="20" maxlength="20" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="pi_email">PI email: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="text" id="pi_email" name="pi_email" value="{{ pi_email }}" size="20" maxlength="40" class="form-control" required> </td>
-        </tr>
-        <tr>
-          <th><label for="pi_password">PI password: <span class="form-required" title="This field is required.">*</span></label></th>
-          <td><input type="password" id="pi_password" name="pi_password" value="" size="20" maxlength="20" class="form-control" required> </td>
-        </tr>
-        <tr><td colspan="2">&nbsp;</td></tr>
-        <tr><td colspan="2"><h4>Postal address</h4></td></tr>
-        <tr>
-          <th><label class="" for="address_line1">Address: </label></th>
-          <td><input type="text" id="address_line1" name="address_line1" value="{{ address_line1 }}" size="30" maxlength="40" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_line2">Address (2): </label></th>
-          <td><input type="text" id="address_line2" name="address_line2" value="{{ address_line2 }}" size="30" maxlength="40" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_line3">Address (3): </label></th>
-          <td><input type="text" id="address_line3" name="address_line3" value="{{ address_line3 }}" size="30" maxlength="40" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_city">City: </label></th>
-          <td><input type="text" id="address_city" name="address_city" value="{{ address_city }}" size="20" maxlength="20" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_postalcode">Postal Code: </label></th>
-          <td><input type="text" id="address_postalcode" name="address_postalcode" value="{{ address_postalcode }}" size="10" maxlength="10" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_state">State: </label></th>
-          <td><input type="text" id="address_state" name="address_state" value="{{ address_state }}" size="20" maxlength="20" class="form-text"> </td>
-        </tr>
-        <tr>
-          <th><label class="" for="address_country">Country: </label></th>
-          <td><input type="text" id="address_country" name="address_country" value="{{ address_country }}" size="20" maxlength="20" class="form-text "> </td>
-        </tr>
-        <tr><td colspan="2">&nbsp;</td></tr>
-        <tr><td colspan="2" style="text-align:center"><input type="submit" name="op" value="Register" class="form-submit"></td></tr>
-      </table>
-    </fieldset>
-  </form>
+       </div>
+       <div class="form-group">
+               <label for="pi_phone">PI Phone:</label>
+       <input type="text" id="pi_phone" name="pi_phone" value="{{ pi_phone }}" maxlength="20" class="form-control" required>
+    </div>
+       <div class="form-group">
+       <label for="pi_email">PI email:</label>
+       <input type="text" id="pi_email" name="pi_email" value="{{ pi_email }}" maxlength="40" class="form-control" required>
+    </div>
+       <div class="form-group">
+       <label for="pi_password">PI password:</label>
+       <input type="password" id="pi_password" name="pi_password" value="" maxlength="20" class="form-control" required>
+       </div>
+       
+       </div>
+       <div class="col-md-6">
+               <h3>Site Registration Information</h3>
+       <p>
+               A membership agreement document will be sent to your email address as a PDF file.
+       </p><p>
+               Please print and sign a copy of the agreement and send it to:
+       </p><p>
+       Ciro Scognamiglio<br>
+       UPMC - LIP6<br>
+       Campus Jussieu<br>
+       Couloir 26-00, bureau 102<br>
+       Boite courrier 169<br>
+       4 place Jussieu<br>
+       F-75252 PARIS cedex 05 - FRANCE<br>
+       </p><p>
+       Once your membership has been processed we will contact you to welcome you as a member.
+       </p><p>
+       If you have any questions about membership, contact the <a href="/portal/contact" >OneLab Support team</a>.
+       </p>
+       </div>
 </div>
-
 <div class="row">
-       <p>
-A membership agreement document will be sent to your email address as a PDF file.
-</p><p>
-Please print and sign a copy of the agreement and send it to:
-</p><p>
-Ciro Scognamiglio<br>
-UPMC - LIP6<br>
-Campus Jussieu<br>
-Couloir 26-00, bureau 102<br>
-Boite courrier 169<br>
-4 place Jussieu<br>
-F-75252 PARIS cedex 05 - FRANCE<br>
-</p><p>
-Once your membership has been processed we will contact you to welcome you as a member.
-</p><p>
-If you have any questions about membership, contact the <a href="/portal/contact" >OneLab Support team</a>.
-</p>
+       <div class="col-md-12" style="text-align:center;">
+               <button type="submit" class="btn btn-default">Send registration form</button>
+       </div>
 </div>
+</form>
 <script>
 /*
 jQuery(document).ready(function(){
index 83b37ee..7f2e98e 100644 (file)
@@ -2,7 +2,9 @@
 {% block content %}
 
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_users_small.png" alt="Manage Users" /> Manage Users</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/users-xs.png" alt="Manage Users" /> Manage Users</h1>
+       </div>
 </div>
 
 
index d1c87e1..1751ce9 100644 (file)
@@ -1,7 +1,3 @@
-{% extends "layout_wide.html" %}
-
-
-{% block content %}
        <div class="col-md-2">
                <div id="select-platform" class="list-group">
                </div>
        </div>
        <div class="col-md-10">
                <div class="row">
-                       {% include theme|add:"_widget-slice-sections.html" %}
-               </div>
-               <div class="row slice-pending">
-                       <ul class="nav nav-pills">
-                               <li><a href="">All users</a></li>
-                               <li><a href="">Users in Slice</a></li>
-                               <li><a href="">Pending<span class="badge">42</span></a></li>
-                               <li>
-                                       <button type="button" class="btn btn-primary apply">Apply</button>
-                                       <button type="button" class="btn btn-default clear">Clear</button>
-                               </li>
-                       </ul>
-               </div>
-               <div class="row">
-                       <ul class="nav nav-tabs">
-                         <li class="active"><a href="#">Users</a></li>
-                         <li><a href="#"></a></li>
-                         <li><a href="#"></a></li>
-                       </ul>
                </div>
                <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Useres" /></div>
                <div id="user-tab-loaded" style="display:none;">
                </div>
 <script>
     $(document).ready(function() {
-               //var selectedValue = $( "#auth_list option:selected" ).val();    
-               //console.log(selectedValue);
-               //console.log("Name of the authority: " + "{{user_details.parent_authority}}");
-               //$("#auth_list").change(function(){
-                       //selectedValue = $(this).find(":selected").val();
                        //console.log("the value you selected: " + selectedValue);
                $.post("/rest/user/",{'filters':{'parent_authority': "{{user_details.parent_authority}}"}}, function( data ) {
                var list_users = [];
     });
 </script>
 
-{% endblock %}
index 0444a82..cf9ee7d 100644 (file)
@@ -6,7 +6,7 @@
 
 {% block content %}
 
-<div class="wrapper">
+<div class="container">
        <div class="row">
                <div class="col-md-12">
                        {% include theme|add:"_widget-slice-sections.html" %}
index 47dea17..bf64b8d 100644 (file)
@@ -1,17 +1,26 @@
-<ul class="nav nav-tabs nav-sliceview">
-       <li {% if section != "resources" %}class="active"{% endif %}>
-               <a href="#info"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> {{ slice }}</a>
-       </li>
-       <li><a href="#testbeds">Testbeds</a></li>
-       <li {% if section == "resources" %}class="active"{% endif %}><a class="link" href="/resources/{{ slice }}">Resources</a></li>
-       <li><a href="#users">Users</a></li>
-       <li><a href="#experiment">Statistics</a></li>
-       <li><a href="#experiment">Measurements</a></li>
-       <li><a href="#experiment" data-toggle="tab">Experiment</a></li>
+{% if section == "resources" %}
+<ul class="nav nav-tabs nav-section">
+       <li><a href="/slice/{{ slice }}#info"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> {{ slice }}</a></li>
+       <li><a href="/slice/{{ slice }}#testbeds">Testbeds</a></li>
+       <li class="active"><a class="link" href="/resources/{{ slice }}">Resources</a></li>
+       <li><a href="/slice/{{ slice }}#users">Users</a></li>
+       <li><a href="/slice/{{ slice }}#experiment">Statistics</a></li>
+       <li><a href="/slice/{{ slice }}#experiment">Measurements</a></li>
+       <li><a href="/slice/{{ slice }}#experiment" data-toggle="tab">Experiment</a></li>
+</ul>
+{% else %}
+<ul class="nav nav-tabs nav-section">
+       <li class="active"><a href="#info"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="About MySlice" /> {{ slice }}</a></li>
+       <li class="testbeds"><a href="#testbeds">Testbeds</a></li>
+       <li><a class="link" href="/resources/{{ slice }}">Resources</a></li>
+       <li class="users"><a href="#users">Users</a></li>
+       <li class="statistics"><a href="#experiment">Statistics</a></li>
+       <li class="measurements"><a href="#experiment">Measurements</a></li>
+       <li class="experiment"><a href="#experiment" data-toggle="tab">Experiment</a></li>
 </ul>
 <script>
 $(document).ready(function() {
-       $('.nav-sliceview a').click(function (e) {
+       $('.nav-tabs a').click(function (e) {
                if ($(this).hasClass('link')) return;
                e.preventDefault();
                $(this).tab('show');
@@ -21,3 +30,4 @@ $(document).ready(function() {
        $('div#info').load('/info/{{ slice }}/');
 });
 </script>
+{% endif %}
\ No newline at end of file
index eee3d20..b33fcd0 100644 (file)
@@ -4,15 +4,19 @@
 {% block content %}
 
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="Password reset" /> Password reset</h1>
+       </div>
 </div>
 <div class="row">
-       <h3>Onelab secured Password reset wizard</h3>
+       <div class="col-md-12">
+       <h3>Secured Password reset wizard</h3>
        <p>Password reset successful</p>
 
        <p>Your password has been set.  You may go ahead and log in now.</p>
 
        <p><a href="/">Log in</a></p>
+       </div>
 </div>
 {% endblock %}
 
index 5701ab1..955193b 100644 (file)
@@ -4,10 +4,13 @@
 {% if validlink %}
 
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="Password reset" /> Password reset</h1>
+       </div>
 </div>
 <div class="row">
-       <h3>Onelab secured Password reset wizard</h3>
+       <div class="col-md-12">
+       <h3>Secured Password reset wizard</h3>
 
        <p>Please enter your new password twice so we can verify you typed it in correctly.</p>
        
@@ -26,6 +29,7 @@
        <p> The password reset link was invalid, possibly because it has already been used.  Please request a new <a href="/portal/pass_reset/">password reset.</a></p>
 
        <p>If you still encounter problem please <a href="/portal/contact/">Contact Support</a> for password recovery.</p> 
+       </div>
 </div>
 {% endif %}
 
index 5efdfb2..257f2fa 100644 (file)
@@ -1,12 +1,16 @@
 {% extends "layout.html" %}
 {% block content %}
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="Password reset" /> Password reset</h1>
+       </div>
 </div>
 <div class="row">
-       <h3>Onelab secured Password reset wizard</h3>
+       <div class="col-md-12">
+       <h3>Secured Password reset wizard</h3>
 
        <p>We've emailed you instructions for setting your password to the email address you submitted. You should be receiving it shortly.</p>
+       </div>
 </div>
 {% endblock %}
 
index 427c4fe..6198523 100644 (file)
@@ -1,10 +1,13 @@
 {% extends "layout.html" %}
 {% block content %}
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+       <div class="col-md-12">
+       <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="Password reset" /> Password reset</h1>
+       </div>
 </div>
 <div class="row">
-       <h3>Welcome to Onelab secured Password reset wizard</h3>
+       <div class="col-md-12">
+       <h3>Welcome to the secured password reset wizard</h3>
 
        <p>Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one.</p>
        
@@ -12,6 +15,7 @@
        {{ form.email.errors }}
        <p><label for="id_email">Email address:</label> {{ form.email }} <input type="submit" value="Reset my password" /></p>
        </form>
+       </div>
 </div>
 {% endblock %}
 
index c101b06..a9240bc 100644 (file)
@@ -2,7 +2,7 @@
 
 {% block content %}
 
-  <h1>Slice request Received !</h1>
+<h1><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="Slice" /> Slice request sent</h1>
 
 We will process your request and get back to you as soon as possible.
 {% endblock %}
index 78be6ff..bd10ac3 100644 (file)
@@ -1,11 +1,7 @@
 <div class="col-md-2">
 </div>
 <div class="col-md-8">
-       <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-       <div id="slice-tab-loaded" style="display:none;margin-top:15px;">
-           <table id="slice-tab">
-           </table>
-       </div>
+       <div id="slice-info"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
 </div>
 <div class="col-md-2">
 </div>
                     slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
                 }
                 
-                slice_row = "<tr><td><b>Description:</b></td><td>"+val.slice_description+"</td></tr>";
-                slice_row += "<tr><td><b>url:</b></td><td><a href='"+val.slice_url+" target='_blank'>"+val.slice_url+"</a></td></tr>";
-                slice_row += "<tr><td><b>users:</b></td><td>"+user_length+"</td></tr>";
-                slice_row += "<tr><td><b>resources:</b></td><td>"+nodes_length+"</td></tr>";
-                slice_row += "<tr><td><b>created:</b></td><td>"+val.created+"</td></tr>";
-                slice_row += "<tr><td><b>last update:</b></td><td>"+val.last_updated+"</td></tr>";
-                slice_row += "<tr><td><b>expires:</b></td><td>"+val.slice_expires+"</td></tr>";
+                slice_row = "<tr><td>Description:</b></td><td>"+val.slice_description+"</td></tr>";
+                slice_row += "<tr><td>url:</td><td><a href='"+val.slice_url+" target='_blank'>"+val.slice_url+"</a></td></tr>";
+                slice_row += "<tr><td>users:</td><td>"+user_length+"</td></tr>";
+                slice_row += "<tr><td>resources:</td><td>"+nodes_length+"</td></tr>";
+                slice_row += "<tr><td>created:</td><td>"+val.created+"</td></tr>";
+                slice_row += "<tr><td>last update:</td><td>"+val.slice_last_updated+"</td></tr>";
+                slice_row += "<tr><td>expires:</td><td>"+val.slice_expires+"</td></tr>";
                 table_slices.push(slice_row);
             });
-           $("table#slice-tab").html(table_slices.join( "" ));
-           $("div#slice-tab-loaded").css("display","block");
-           $("div#slice-tab-loading").css("display","none");
+           $("div#slice-info").html("<table>" + table_slices.join( "" ) + "</table>");
         });
     });
 </script>
\ No newline at end of file
index e609bcf..d40909c 100644 (file)
@@ -3,32 +3,35 @@
 <div class="col-md-8">         
        <div id="testbed-list-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Testbeds" /></div>
        <div id="testbed-list-loaded" style="display:none;margin-top:15px;">
-               <table cellpadding="0" cellspacing="0" border="0" class="table" id="testbedList"></table>
+               <table cellpadding="0" cellspacing="0" border="0" class="table" id="testbedList">
+               </table>
        </div>
 </div>
 <div class="col-md-2">
 </div>
 <script>
 $(document).ready(function() {
-       $.post("/rest/network/", { "fields" : ["network_hrn", "network_longname", "description"]}, function(data) {
+       $.post("/rest/network/", { "fields" : ["network_hrn", "network_longname", "description"] }, function(data) {
                        var testbed_data = [];
                        var testbed_row = "<thead>";
                        testbed_row += "<tr>";
                        testbed_row += "<th id=testbed_check><input type=\"checkbox\" name=\"network_hrn\" value=\"all\"/></th>";
                        testbed_row += "<th id=testbed_icon></th>";
                        testbed_row += "<th>network_hrn</th>";
-                       testbed_row += "<th>Full name</th>";
+                       //testbed_row += "<th>Full name</th>";
                        testbed_row += "<th>Description</th>";
                        testbed_row += "</tr>";
                        testbed_row += "</thead>";
                        testbed_data.push(testbed_row);
                        $.each( data, function(key, val) {
-                               testbed_row = "<tr data-keys=\""+val.network_hrn+"\" class=\"odd\">"
+                               testbed_row = "<tr data-keys=\""+val.network_hrn+"\" class=\"odd\">";
                                testbed_row += "<td><input type=\"checkbox\" name=\"network_hrn\" value=\""+val.network_hrn+"\"/></td>";
-                               testbed_row += "<td><img src='/static/img/testbeds/"+val.network_hrn+".png' alt='' /></td>";
+                net_hrn = val.network_hrn;
+                net_hrn = net_hrn.replace(/\\/g, '');
+                               testbed_row += "<td><img src='/static/img/testbeds/"+net_hrn+".png' alt='' /></td>";
                                testbed_row += "<td>"+val.network_hrn+"</td>";
                                testbed_row += "<td>"+val.network_longname+"</td>";
-                               testbed_row += "<td>"+val.description+"</td>";
+                               //testbed_row += "<td>"+val.description+"</td>";
                                testbed_row += "</thead>";
        
                                testbed_data.push(testbed_row);
@@ -40,7 +43,7 @@ $(document).ready(function() {
                $("input[type=checkbox]").click(function() {
                        var cnt = 0;
                        var id = $(this).val();
-                       var row = $(this).parent().parent()
+                       var row = $(this).parent().parent();
                        if (row.hasClass("active")) {
                                row.removeClass("active");
                        } else {
index 5e90741..6db35a7 100644 (file)
@@ -5,5 +5,6 @@
 <b>type of nodes   :</b> {{type_of_nodes}}</br>
 <b>purpose         :</b> {{purpose}}</br>
 <b>email           :</b> {{email}}</br>
+<b>Portal url     :</b> {{current_site}}</br> 
 <b>cc myself       :</b> {{cc_myself}}</br>
 
index ef46a04..a0d94cd 100644 (file)
@@ -5,5 +5,6 @@ number of nodes : {{number_of_nodes}}
 type of nodes   : {{type_of_nodes}}
 purpose         : {{purpose}}
 email           : {{email}}
+Portal url             : {{current_site}}
 cc myself       : {{cc_myself}}
 
index 1f57bce..e70a9a9 100644 (file)
@@ -2,83 +2,64 @@
 {% load i18n %}
 
 {% block content %}
+       <div class="row">
+               <div class="col-md-12">
+               <h1><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="Request a Slice" /> Request a new Slice</h1>
+               </div>
+       </div>
 
-<div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Request a Slice" /> Request a new Slice</h1>
-</div>
-{% if errors %}
-<ul>
-  {% for error in errors %}
-  <li>{{ error }}</li>
-  {% endfor %}
-</ul>
-{% endif %}
-
-<div class="row">
-  <form id="commentForm" class="form-horizontal" method="post">
-  {% csrf_token %}
-  <fieldset>
-
-   <div class="form-group">
-     <label for="email" class="col-xs-2 control-label">Experimenter</label>
-     <div class="col-xs-4">
-        <label class="col-xs-2 control-label">{{ email }}</label>
-     </div>
-     <div class="col-xs-6">
-       <p class="form-hint">Experimenter requesting a Slice</p>
-     </div>
-   </div>
-
-   <div class="form-group">
-     <label for="slice_name" class="col-xs-2 control-label">Slice Name</label>
-     <div class="col-xs-4">
-        <input type="text" name="slice_name" class="form-control" minlength="2" value="{{ slice_name }}" placeholder="Slice Name" required />
-     </div>
-     <div class="col-xs-6"> <p class="form-hint">The name of the slice you wish to create</p> </div>
-   </div>
-
-   <div class="form-group">
-     <label for="authority_hrn" class="col-xs-2 control-label">Authority</label>
-     <div class="col-xs-4">
-       <div class="ui-widget">
-           <input id="authority_hrn" name="authority_hrn" class="form-control" value="{{ authority_hrn }}" placeholder="Authority" required />
-       </div>
-    </div>
-     <div class="col-xs-6"><p class="form-hint">An authority responsible for vetting your slice</p></div>
-   </div>
-
-   <div class="form-group">
-     <label for="number_of_nodes" class="col-xs-2 control-label">Number of nodes</label>
-     <div class="col-xs-4">
-       <div class="ui-widget">
-           <input id="number_of_nodes" name="number_of_nodes" class="form-control" value="{{ number_of_nodes }}" />
-       </div>
-    </div>
-     <div class="col-xs-6"><p class="form-hint">Number of nodes you expect to request (informative)</p></div>
-   </div>
-
-   <div class="form-group">
-     <label for="purpose" class="col-xs-2 control-label">Experiment purpose</label>
-     <div class="col-xs-4">
-       <div class="ui-widget">
-           <textarea id="purpose" name="purpose" class="form-control" style="height:110px;" placeholder="Experiment Purpose" required>{{ purpose }}</textarea>
-       </div>
-    </div>
-     <div class="col-xs-6">
-       <p class="form-hint">Purpose of your experiment (informative)</p>
-     </div>
-   </div>
-
-       <div class="col-xs-2">
+       {% if errors %}
+       <ul>
+         {% for error in errors %}
+         <li>{{ error }}</li>
+         {% endfor %}
+       </ul>
+       {% endif %}
+       <div class="row">
+               <div class="col-md-12">&nbsp;</div>
        </div>
-       <div class="col-xs-4">
-               <button class="submit btn btn-default" type="submit">Request Slice</button>
+       <div class="row">
+               <div class="col-md-2"></div>
+               <div class="col-md-8">
+                       <form role="form" method="post">
+                       {% csrf_token %}
+                         <div class="form-group">
+                           <label for="email">Experimenter</label>
+                           <input type="email" class="form-control" id="email" value="{{ email }}" readonly="readonly">
+                         </div>
+                         <div class="form-group">
+                           <label for="slice_name">Slice Name</label>
+                           <input type="text" class="form-control" name="slice_name" id="slice_name" placeholder="Slice Name" required="required">
+                               <p class="help-block"></p>
+                         </div>
+                         <div class="form-group">
+                           <label for="authority">Authority</label>
+                           <input type="text" class="form-control" id="authority_hrn" name="authority_hrn" placeholder="Authority" required="required">
+                               <p class="help-block">An authority responsible for vetting your slice</p>
+                         </div>
+                         <div class="form-group">
+                           <label for="number_of_nodes">Number of Nodes</label>
+                           <input type="text" class="form-control" name="number_of_nodes" id="number_of_nodes" placeholder="Number of Nodes">
+                               <p class="help-block">Number of nodes you expect to request (informative)</p>
+                         </div>
+                         <div class="form-group">
+                           <label for="purpose">Experiment Purpose</label>
+                               <textarea id="purpose" name="purpose" class="form-control" rows="6" placeholder="Experiment Purpose" required="required">{{ purpose }}</textarea>
+                           <p class="help-block">Purpose of your experiment (informative)</p>
+                         </div>
+                         <button type="submit" class="btn btn-default">Request Slice</button>
+                       </form>
+       
+               </div>
        </div>
-  </fieldset>
-  </form>
-</div>
+               
 <script>
 jQuery(document).ready(function(){
+       
+       $("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
+               var jsonData = JSON.parse(data)
+        $(this).attr("value", jsonData[0]['parent_authority']);
+    });
     var availableTags = [
      {% if authorities %}
          {% for authority in authorities %}
index d35d226..e9768b7 100644 (file)
-{% extends "layout.html" %}
+{% extends "layout_wide.html" %}
 
 {% block content %}
+<div class="container">
        <div class="row">
-               <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Request a Slice" /> OneLab Portal Support</h1>
+               <div class="col-md-12">
+                       <ul class="nav nav-tabs nav-section">
+                               <li class="active"><a href="#support"><img src="{{ STATIC_URL }}icons/support-xs.png" alt="Support" /> Support</a></li>
+                               <li><a href="#faq">FAQ</a></li>
+                               <li><a href="#contact">Contact</a></li>
+                       </ul>
+           </div>
        </div>
+</div>
 
-       
-       <div class="row">
-               <h2>Report a Bug</h2>
-               <p>If you have found a bug or having difficulties accesing some features or found some anomalies, please report it using our ticketing system.</p>
-               <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
-               <h3>Unresolved Tickets</h3>
-       </div>
-
-       <div class="row">
-           <table class="mytable table table-bordered table-hover">
-               <tr>
-                   <th>Ticket No</th>
-                               <th>Reported By</th>
-                               <th>Description</th>
-                   <th>Status</th>
-               </tr>
-               <tr>
-                   <td>1</td>
-                               <td>yasin.upmc@gmail.com</td>
-                               <td> Slice_request page is not working </td>
-                               <td> Unresolved</td>
-               </tr>
-                       <tr>
-                               <td>2</td>
-                               <td>azerty@lip6.fr</td>
-                               <td>Unable to Register</td>
-                               <td>Unresolved</td>
-                       </tr>
-       
-           </table>
-       </div>
+<div class="container tab-content">
+       <div class="tab-pane active row" id="support">
+               <div class="col-md-12">
+                       <h2>Report a Bug</h2>
+                       <p>If you have found a bug or having difficulties accesing some features or found some anomalies, please report it using our ticketing system.</p>
+                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+                       <h3>Unresolved Tickets</h3>
+                       <table class="mytable table table-bordered table-hover">
+                       <tr>
+                           <th>Ticket No</th>
+                                       <th>Reported By</th>
+                                       <th>Description</th>
+                           <th>Status</th>
+                       </tr>
+                       <!-- <tr>
+                           <td>1</td>
+                                       <td>yasin.upmc@gmail.com</td>
+                                       <td> Slice_request page is not working </td>
+                                       <td> Unresolved</td>
+                       </tr>
+                               <tr>
+                                       <td>2</td>
+                                       <td>azerty@lip6.fr</td>
+                                       <td>Unable to Register</td>
+                                       <td>Unresolved</td>
+                               </tr> -->
+               
+                   </table>
+               </div>
+         </div>
+       <div class="tab-pane row" id="faq">
+               <div class="col-md-12">
+                       <h2>Frequently Asked Questions (FAQs)<h2>
 
+                       <h3>Users</h3>
+                       <ul>
+                       <li><h4>Who is a user?</h4></li>
+                       <p>A user is an experimenter who registers to the OneLab portal and able to use all the facilites that the portal has to offer. However, a user does not
+                       have the right to do any admin operation such as managing slices, users and resources.</p>
+                       
+                       
+                       <li><h4>How do I register?</h4></li>
+                       <p>In order to register you must go to the <a href="/portal/register">Registration</a> page. You have to choose your corresponding institution (authority). After registration you have to wait until the PI validates your account. However upon registration, you will be able login to the portal with a limited access. Do not try to re-register with the same email address.</p>
+                       
+                       <li><h4>Why can't I register with my email?</h4></li>
+                       <p>If you have already registered then you won't be able to register again with the same email address. However, if you have never registered and still you are not able to use your email then please 
+                       <a href="/portal/contact">Contact Support</a> and mention the error message that you are getting while trying to register.</p>
+                       
+                       <li><h4>In registration, in "My keys" option, what should i choose?</h4></li>
+                       <p>There are two choices.</p> 
+                               <p class="text-justify"><b>1. Generate Key Pairs:</b> This option is for users who have no knowledge about SFA and MySlice i.e., new users. We offer convenience to the new users in order to avoid addtional efforts to delegate keys manually. If you choose this option, the portal will automatically handle your credentials and you would be able use the portal as soon as the PI validates your account. However, you can delete your private key from the portal if you are concerned about privacy issues. In that case once your current credentials expire, you have to delegate your credentials manually using <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">SFA</a>. As this needs advance knowledge about SFA and Myslice, we highly recommend to the new users to keep both private and public keys in the portal in order to keep the process automatic. </p>
+                               <p class="text-justify"><b>2. Upload My Public Key:</b> This option is for users who have experience with MySlice and SFA. If you choose this option, once the PI validates your account, you have to delegate your credentials manually using <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">SFA</a>. You have to repeat the same process everytime your credentials expire. Normally, credentials expire every one month. You can see the expiration date in your Account page. </p>
+                       
+                       <li><h4>Who is responsible for validating my account?</h4></li>
+                       <p>When you register, you choose an authority fromt he list of authorities. For each authority there is a Principal Investigator (PI). PI of your authority will verify your identity and if he finds that you are from his institution, he will validate your account otherwise he will reject your account.</p>
+                       
+                       <li><h4>How long I have to wait for validation?</h4></li>
+                       <p>It depends on the PI of your authority. In general, it should not take more than a week. If you are waiting more than usual, please <a href="/portal/contact">Contact Support</a> and explain your problem.</p>
+                       <li><h4>I just registered. Why can't I see any slices and resources?</h4></li>
+                       <p>Once you register, you can login to your account with limited access. It means that you can view your account details, modify your name and password. You can also view other pages. However, you will not be able to see any slices as well as resources before your account validation. But you can <a href="/portal/slice_request/">Request Slice</a> before being validated. Therefore, the PI will validate your account as well as your requested slice. Once validated, you will be able to see your slice and if you click on your slice, you will be able to see resources in that slice and you can reserve nodes and start your experiment.</p>
+                       
+                       <li><h4>How can I get access to a slice?</h4></li>
+                       <p>If you are a completely new user, you have to <a href="/portal/slice_request/">Request Slice</a>. It is upto the PI of your authority to accept/reject your slice request. </br>On the other hand, if you are a new user to the portal but you already have an account in OneLab SFA registry and you have access to slices, you will be able to see all your slices once your account is validated by the PI.</p> 
+                       
+                       <li><h4>I forgot my password, how to recover it?</h4></li>
+                       <p>If you have an account in the portal but you forgot the password, you can always <a href="/portal/pass_reset/">Reset your password</a>.</p></ul>
+                       
+                       <h3>Managers</h3>
+                       <ul>
+                       <li><h4>Who is a manager?</h4></li>
+                       <p>A manager is the Principal Investigator (PI) of the institution. Each PI has authority over his own institution. A PI can add, delete, validate users/ 
+                       slices that belong to his institution.</p>
+                       
+                       <li><h4>What is pending users/slices?</h4></li>
+                       <p>In <a href="/portal/validate">Requests</a> page you will be able to see all the users that registered under your authority and the slices that users of your authority has requested. Therefore, pending users/slices are those users and slices that are yet to be validated. You can validate/reject these requests based on the policy of your institution.</p>
+                       
+                       <li><h4>How can I manage the users/slices that belong to my institution?</h4></li>
+                       <p>In <a href="/portal/institution">Instution</a> page, under "Users" tab, you will be able to see all the users that belong to your authority. You can delete the users that you don't want anymore. Under "Slices" tab, you will be able to see all the slices that belong to your authority. You can renew/delete the slices based on your requirements. As a PI you can also <a href="/portal/slice_request/">Create Slice</a>. Just fill the form of request slice and the slice will be automatically validated if it is requested by a PI. </p>
+                       
+                       </ul>
+               </div>
+         </div>
 
-       
-       <div class="row">
-       
-               <h2><a href="/portal/support/documentation">FAQ</a></h2>
-               <h2>Contact Us</h2>
+       <div class="tab-pane row" id="contact">
+               <div class="col-md-12">
+                       <h2>Contact Us</h2>
                
-               <h3>Mailing List</h3>
-               <p>You can subscribe to our mailing list by sending a request to: <b>support</b> AT <b>myslice</b> DOT <b>info</b></p>
-               <p>Also you can adress any issues in the same email address.</p>
-               
-               <h3>Mailing Address</h3>
-               <p>
-               UPMC - LIP6<br> 
-               Boîte courrier 16 <br>
-               Couloir 26-00, Etage 01, Bureau 102<br>
-               4 place Jussieu<br>
-               75252 PARIS CEDEX 05<br>
-               France<br> 
-               </p>
-       </div>
+                       <h3>Mailing List</h3>
+                       <p>You can subscribe to our mailing list by sending a request to: <b>support</b> AT <b>myslice</b> DOT <b>info</b></p>
+                       <p>Also you can adress any issues in the same email address.</p>
+                       
+                       <h3>Mailing Address</h3>
+                       <address>
+                       UPMC - LIP6<br> 
+                       Boîte courrier 16 <br>
+                       Couloir 26-00, Etage 01, Bureau 102<br>
+                       4 place Jussieu<br>
+                       75252 PARIS CEDEX 05<br>
+                       France<br> 
+                       </address>
+               </div>
+         </div>
+</div>
 
 <script>
-    $(document).ready(function() {
-               $('li#nav-support').addClass("active");
-        $('button#ticketbtn').click(function() {
-            window.location="/portal/contact/";
-        });
+$(document).ready(function() {
+    $('button#ticketbtn').click(function() {
+        window.location="/portal/contact/";
     });
+       $('.nav-tabs a').click(function (e) {
+               e.preventDefault();
+               $(this).tab('show');
+       });
+});
 </script>
 
 
index 9c61395..6fb469d 100644 (file)
@@ -3,7 +3,7 @@
 {% block content %}
 
 <div class="row">
-       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> Experimenter registration</h1>
 </div>
 <div class="row">
   <h3>User registration complete !</h3>
index e8f2b38..b33d32f 100644 (file)
@@ -2,9 +2,10 @@
 <br>
 <h1>NEW USER REQUEST</h1>
 <br>
-<b>First Name   :</b> {{first_name}}
-<b>Last Name    :</b> {{last_name}}
+<b>First name   :</b> {{first_name}}
+<b>Last name    :</b> {{last_name}}
 <b>Authority hrn:</b> {{authority_hrn}}
 <b>Public key   :</b> {{public_key}}
 <b>Email        :</b> {{email}}
-<b>User Hrn     :</b> {{user_hrn}}
+<b>User hrn     :</b> {{user_hrn}}
+<b>Portal url  :</b> {{ current_site }}
index d38fd31..cce80cb 100644 (file)
@@ -1,8 +1,9 @@
 NEW USER REQUEST
 
-First Name   : {{first_name}}
-Last Name    : {{last_name}} 
+First name   : {{first_name}}
+Last name    : {{last_name}} 
 Authority hrn: {{authority_hrn}}
 Public key   : {{public_key}}
 Email        : {{email}}
-User Hrn     : {{user_hrn}}
+User hrn     : {{user_hrn}}
+Portal url   : {{ current_site }}
index 6012720..497b70b 100644 (file)
@@ -49,7 +49,7 @@
 
 {% block content %}
        <div class="row">
-               <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="" /> Pending requests</h1>
+               <h1><img src="{{ STATIC_URL }}icons/testbed-xs.png" alt="Pending Requests" /> Pending requests</h1>
        </div>
 
        {% if my_authorities %}
index fb66850..c55c07b 100644 (file)
@@ -38,7 +38,7 @@ from portal.registrationview    import RegistrationView
 from portal.joinview            import JoinView
 from portal.sliceviewold           import SliceView
 from portal.validationview      import ValidatePendingView
-from portal.experimentview      import ExperimentView
+#from portal.experimentview      import ExperimentView
 from portal.documentationview   import DocumentationView
 from portal.supportview         import SupportView
 
@@ -79,7 +79,7 @@ urlpatterns = patterns('',
     url(r'^register/?$', RegistrationView.as_view(), name='registration'),
     url(r'^join/?$', JoinView.as_view(), name='join'),
     url(r'^contact/?$', ContactView.as_view(), name='contact'),
-    url(r'^experiment?$', ExperimentView.as_view(), name='experiment'),
+    #url(r'^experiment?$', ExperimentView.as_view(), name='experiment'),
     url(r'^support/?$', SupportView.as_view(), name='support'),
     url(r'^support/documentation?$', DocumentationView.as_view(), name='FAQ'),
     #url(r'^pass_reset/?$', PassResetView.as_view(), name='pass_rest'),
index e8b7b68..5b4e2ee 100644 (file)
@@ -10,7 +10,7 @@ from unfold.page                import Page
 from manifoldapi.manifoldapi    import execute_admin_query
 from unfold.loginrequired       import LoginRequiredAutoLogoutView
 
-from theme import ThemeView
+from myslice.theme import ThemeView
 import json
 
 class UsersView (LoginRequiredAutoLogoutView, ThemeView):
index e0f4ab1..f8788d0 100644 (file)
@@ -28,7 +28,7 @@ from django.http                import HttpResponseRedirect, HttpResponse
 from django.shortcuts           import render
 from django.template.loader     import render_to_string
 
-from unfold.loginrequired       import FreeAccessView
+from unfold.loginrequired       import LoginRequiredAutoLogoutView
 from ui.topmenu                 import topmenu_items_live, the_user
 
 from portal.event               import Event
@@ -44,9 +44,9 @@ from portal.actions             import get_requests
 from manifoldapi.manifoldapi    import execute_query
 from manifold.core.query        import Query
 from unfold.page                import Page
-from theme import ThemeView
+from myslice.theme import ThemeView
 
-class ValidatePendingView(FreeAccessView, ThemeView):
+class ValidatePendingView(LoginRequiredAutoLogoutView, ThemeView):
     template_name = "validate_pending.html"
 
     def get_context_data(self, **kwargs):
@@ -153,8 +153,17 @@ class ValidatePendingView(FreeAccessView, ThemeView):
             pi_authorities_query = Query.get('user').filter_by('user_hrn', '==', '$user_hrn').select('pi_authorities')
             pi_authorities_tmp = execute_query(self.request, pi_authorities_query)
             pi_authorities = set()
-            for pa in pi_authorities_tmp:
-                pi_authorities |= set(pa['pi_authorities'])
+            try:
+                for pa in pi_authorities_tmp:
+                    pi_authorities |= set(pa['pi_authorities'])
+            except:
+                print 'No pi_authorities'
+# TODO: exception if no parent_authority
+#             try:
+#                 for pa in pi_authorities_tmp:
+#                     pi_authorities |= set(pa['pi_authorities'])
+#             except:
+
 
 #            # include all sub-authorities of the PI
 #            # if PI on ple, include all sub-auths ple.upmc, ple.inria and so on...
@@ -263,6 +272,7 @@ class ValidatePendingView(FreeAccessView, ThemeView):
         context['username'] = the_user(self.request) 
         
         context['theme'] = self.theme
+        context['section'] = "Requests"
         # XXX We need to prepare the page for queries
         #context.update(page.prelude_env())
 
index bdf3ee0..faef22e 100644 (file)
@@ -40,10 +40,24 @@ class ObjectRequest(object):
             self.filters['disabled'] = '0'
             self.filters['gateway_type'] = 'sfa'
             self.filters['platform'] = '!myslice'
+        elif(self.type.startswith('local:')):
+            # XXX TODO: find a generic Query to get the fields like 
+            # select column.name from local:object where table == local:user
+            table = self.type.split(':')
+            table = table[1]
+            if table == "user":
+                self.id = table + '_id'
+                self.fields = ['user_id', 'email', 'password', 'config','status'];
+            elif table == "account":
+                # XXX TODO: Multiple key for account = (platform_id, user_id)
+                self.id = "platform_id, user_id"
+                self.fields = ['platform_id', 'user_id', 'auth_type', 'config'];
+            elif table == "platform":
+                self.id = 'platform'
+                self.fields = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
         else :
             self.setKey()
             self.setLocalFields()
-        
     
     def setKey(self):
         # What about key formed of multiple fields???
@@ -94,7 +108,7 @@ class ObjectRequest(object):
     
     def get(self):
         query = Query.get(self.type)
-        if (self.id not in self.fields) :
+        if (self.id is not None) and (self.id not in self.fields) :
             query.select(self.fields + [self.id])
         else :
             query.select(self.fields)
@@ -106,7 +120,11 @@ class ObjectRequest(object):
         query = Query.create(self.type)
         # No filters for create
         if self.params :
-            query.set(self.params)
+            for p in self.params :
+                for k,v in p.iteritems() :
+                    print "param: %s : %s" % (k,v)
+                    query.set({k : v})
+            print "query = ",query
         else:
             raise Exception, "Params are required for create"
         return execute_query(self.request, query)
@@ -114,15 +132,19 @@ class ObjectRequest(object):
     def update(self):
         query = Query.update(self.type)
         query = self.applyFilters(query, True)
-        print ">>>>>",self.params
-        
+
         if self.params :
-            query.set({ 'resource' : self.params})
-#             for param in self.params :
-                
+            for p in self.params :
+                for k,v in p.iteritems() :
+                    print "param: %s : %s" % (k,v)
+                    query.set({k : v})
+            print "query = ",query
         else:
             raise Exception, "Params are required for update"
-        
+
+        if self.id is not None:
+           query.select(self.id)
+       
         return execute_query(self.request, query)
     
     def delete(self):
index e95a6e7..afb62b7 100644 (file)
@@ -29,7 +29,8 @@ def dispatch(request, object_type, object_name):
         if el[0].startswith('filters'):
             o.filters[el[0][8:-1]] = el[1]
         elif el[0].startswith('params'):
-            o.params[el[0][7:-1]] = el[1]
+            #o.params[el[0][7:-1]] = el[1]
+            o.params.append({el[0][7:-1]:el[1]})
         elif el[0].startswith('fields'):
             o.fields=req_items.getlist('fields[]')
         elif el[0].startswith('options'):
index d2dd71e..fb6bb97 100644 (file)
@@ -31,11 +31,16 @@ def dispatch(request, object_type, object_name):
             o.filters[el[0][8:-1]] = el[1]
         elif el[0].startswith('params'):
             print "#======> 0 ", el[0]
-            #print "#======>", el[0][7:8]
-            #print "#======>", el[0][10:-1]
-            print "#======> 1 ", el[1]
-            o.params = req_items.getlist('params[]')
+            print "#======> 1 ", req_items.getlist(el[0])
+
+            if (el[0][-2:] == '[]') :
+                # when receiving params[key][] = 'value1' ...
+                o.params.append({el[0][7:-3]:",".join(req_items.getlist(el[0]))})
+            else :
+                # when receiving params[key] = 'value'
+                o.params.append({el[0][7:-1]:el[1]})
             
+            print "o.params = ",o.params
             
         elif el[0].startswith('fields'):
             o.fields=req_items.getlist('fields[]')
@@ -51,5 +56,5 @@ def dispatch(request, object_type, object_name):
             return error('an error has occurred')
  
     except Exception, e:
-        return error(str(e))
+        return error("exception:"+str(e))