Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorJordan Augé <jordan.auge@lip6.fr>
Mon, 3 Mar 2014 12:55:47 +0000 (13:55 +0100)
committerJordan Augé <jordan.auge@lip6.fr>
Mon, 3 Mar 2014 12:55:47 +0000 (13:55 +0100)
Conflicts:
portal/registrationview.py

54 files changed:
devel/server-loop.sh
myslice/urls.py
portal/actions.py
portal/dashboardview.py
portal/homeview.py
portal/registrationview.py
portal/sliceuserview.py [new file with mode: 0644]
portal/static/css/account_view.css
portal/static/css/onelab.css
portal/static/js/institution.js [new file with mode: 0644]
portal/static/js/myslice-ui.js
portal/supportview.py
portal/templates/about.html
portal/templates/account-view.html
portal/templates/contact.html
portal/templates/contact_sent.html
portal/templates/documentationview.html
portal/templates/experimentview.html
portal/templates/home-view.html
portal/templates/institution.html
portal/templates/join_view.html
portal/templates/layout.html [new file with mode: 0644]
portal/templates/layout_wide.html [new file with mode: 0644]
portal/templates/manageuserview.html
portal/templates/onelab/onelab__widget-topmenu.html
portal/templates/onelab/onelab_home-view.html
portal/templates/onelab/onelab_slice-resource-view.html
portal/templates/onelab/onelab_slice-user-view.html [new file with mode: 0644]
portal/templates/onelab/onelab_slice-view.html
portal/templates/onelab/onelab_testbed-list.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/platform.html
portal/templates/register_user_wizard.html
portal/templates/registration_view.html
portal/templates/slice-request-ack-view.html
portal/templates/slice-request-view.html
portal/templates/slicerequest_view.html
portal/templates/supportview.html
portal/templates/user_register.html
portal/templates/user_register_complete.html
portal/templates/validate_pending.html
portal/validationview.py
rest/__init__.py
rest/create.py [new file with mode: 0644]
rest/delete.py [new file with mode: 0644]
rest/templates/table-default.html
rest/update.py [new file with mode: 0644]
ui/static/img/icon_user_small.png [new file with mode: 0644]
ui/static/img/icon_users_small.png [new file with mode: 0644]
ui/templates/base.html

index 49d433e..c77258f 100755 (executable)
@@ -3,8 +3,8 @@ DIRNAME=$(dirname $0)
 cd $DIRNAME/..
 
 # default port : if hostname starts with z -> use 8080 ; otherwise take 80
-hostname | grep -q '^z' && port=8080 || port=8080
-#hostname | grep -q '^z' && port=8080 || port=80
+#hostname | grep -q '^z' && port=8080 || port=8080
+hostname | grep -q '^z' && port=8080 || port=80
 [[ -n "$@" ]] && port=$1
 
 while true; do 
index 21dd952..cc8b259 100644 (file)
@@ -23,6 +23,7 @@ platforms_view=portal.platformsview.PlatformsView.as_view()
 import portal.testbedlist
 import portal.sliceview
 import portal.sliceresourceview
+from portal.sliceuserview import SliceUserView 
 
 
 #### high level choices
@@ -65,6 +66,9 @@ urls = [
     (r'^rest/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
     (r'^table/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
     (r'^datatable/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.dispatch'),
+    (r'^update/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.update.dispatch'),
+    (r'^create/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.create.dispatch'),
+    (r'^delete/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.delete.dispatch'),
     #
     #
     #(r'^view/?', include('view.urls')),
@@ -74,6 +78,7 @@ urls = [
     # Portal
     (r'^testbeds/(?P<slicename>[^/]+)/?$', portal.testbedlist.TestbedList.as_view()),
     (r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
+    (r'^users/(?P<slicename>[^/]+)/?$', SliceUserView.as_view()),
     (r'^slice/(?P<slicename>[^/]+)/?$', portal.sliceview.SliceView.as_view()),
     url(r'^portal/', include('portal.urls')),
 ]
index 084ee88..b2f5318 100644 (file)
@@ -4,7 +4,7 @@ from manifoldapi.manifoldapi        import execute_query,execute_admin_query
 from portal.models               import PendingUser, PendingSlice, PendingAuthority
 import json
 
-from portal.models               import PendingSlice
+from django.contrib.auth.models import User
 from django.template.loader      import render_to_string
 from django.core.mail            import send_mail
 
@@ -33,10 +33,9 @@ def authority_get_pi_emails(request, authority_hrn):
         return ['support@myslice.info']
     else:
         pi_user_hrns = [ hrn for x in pi_users for hrn in x['pi_users'] ]
-        query = Query.get('user').filter_by('user_hrn', 'included', pi_user_hrns).select('email')
+        query = Query.get('user').filter_by('user_hrn', 'included', pi_user_hrns).select('user_email')
         results = execute_admin_query(request, query)
-        print "mails",  [result['email'] for result in results]
-        return [result['email'] for result in results]
+        return [result['user_email'] for result in results]
 
 def is_pi(wsgi_request, user_hrn, authority_hrn):
     # XXX could be done in a single query !
@@ -172,7 +171,9 @@ def make_request_user(user):
     request['last_name']     = user.last_name
     request['email']         = user.email
     request['login']         = user.login
-    request['keypair']       = user.keypair
+    request['user_hrn']      = user.user_hrn
+    request['public_key']    = user.public_key
+    request['private_key']   = user.private_key
     return request
 
 def make_request_slice(slice):
@@ -471,7 +472,7 @@ def sfa_create_user(wsgi_request, request):
         'enabled'    : True
     }
 
-    query = Query.create('user').set(user_params).select('user_hrn')
+    query = Query.create('user').set(sfa_user_params).select('user_hrn')
     results = execute_query(wsgi_request, query)
     if not results:
         raise Exception, "Could not create %s. Already exists ?" % user_params['user_hrn']
@@ -486,7 +487,7 @@ def create_user(wsgi_request, request):
     # we would have to perform the steps in create_pending_user too
 
     # Add the user to the SFA registry
-    sfa_add_user(wsgi_request, request)
+    sfa_create_user(wsgi_request, request)
 
     # Update Manifold user status
     manifold_update_user(wsgi_request, request['email'], {'status': USER_STATUS_ENABLED})
@@ -494,7 +495,7 @@ def create_user(wsgi_request, request):
     # Add reference accounts for platforms
     manifold_add_reference_user_accounts(wsgi_request, request)
 
-def create_pending_user(wgsi_request, request, user_detail):
+def create_pending_user(wsgi_request, request, user_detail):
     """
     """
 
@@ -505,10 +506,9 @@ def create_pending_user(wgsi_request, request, user_detail):
         authority_hrn = request['authority_hrn'],
         email         = request['email'],
         password      = request['password'],
-        keypair       = request['account_config'],  # XXX REMOVE
-        public_key    = request['public_key'],      # TODO NEW
-        private_key   = request['private_key'],     # TODO NEW
-        user_hrn      = request['user_hrn'],        # TODO NEW
+        public_key    = request['public_key'],
+        private_key   = request['private_key'],
+        user_hrn      = request['user_hrn'],
         pi            = '',                         # XXX Why not None ?
     )
     b.save()
@@ -538,6 +538,6 @@ def create_pending_user(wgsi_request, request, user_detail):
     manifold_add_account(wsgi_request, account_params)
 
     # Send an email: the recipients are the PI of the authority
-    recipients = authority_get_pi_emails(wsgi_request, authority_hrn)
+    recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
     msg = render_to_string('user_request_email.txt', request)
     send_mail("Onelab New User request for %(email)s submitted" % request, msg, 'support@myslice.info', recipients)
index c2f6e9c..2b0ab82 100644 (file)
@@ -22,7 +22,6 @@ class DashboardView (LoginRequiredAutoLogoutView, ThemeView):
         # We might have slices on different registries with different user accounts 
         # We note that this portal could be specific to a given registry, to which we register users, but i'm not sure that simplifies things
         # Different registries mean different identities, unless we identify via SFA HRN or have associated the user email to a single hrn
-       print self.request
         #messages.info(self.request, 'You have logged in')
         page = Page(self.request)
 
@@ -48,6 +47,8 @@ class DashboardView (LoginRequiredAutoLogoutView, ThemeView):
 #            root_authority = sub_authority[0]
 #            slice_query = Query().get(root_authority+':user').filter_by('user_hrn', '==', '$user_hrn').select('user_hrn', 'slice.slice_hrn')
 #        else:
+        print "SLICE QUERY"
+        print "-" * 80
         slice_query = Query().get('user').filter_by('user_hrn', '==', '$user_hrn').select('slices.slice_hrn')
         page.enqueue_query(slice_query)
         page.enqueue_query(testbed_query)
index 8bd2c27..14487c9 100644 (file)
@@ -43,7 +43,6 @@ class HomeView (FreeAccessView, ThemeView):
             manifoldresult = auth_result
             # let's use ManifoldResult.__repr__
             env['state']="%s"%manifoldresult
-            env['layout_1_or_2']="layout-unfold2.html"
             
             return render_to_response(self.template,env, context_instance=RequestContext(request))
         # user was authenticated at the backend
@@ -55,6 +54,7 @@ class HomeView (FreeAccessView, ThemeView):
                 
                 if request.user.is_authenticated(): 
                     env['person'] = self.request.user
+                    env['username'] = self.request.user
                 else: 
                     env['person'] = None
                 return render_to_response(self.template,env, context_instance=RequestContext(request))
@@ -66,7 +66,6 @@ class HomeView (FreeAccessView, ThemeView):
         # otherwise
         else:
             env['state'] = "Your username and/or password were incorrect."
-            env['layout_1_or_2']="layout-unfold2.html"
             
             return render_to_response(self.template, env, context_instance=RequestContext(request))
 
@@ -86,7 +85,6 @@ class HomeView (FreeAccessView, ThemeView):
         if state: env['state'] = state
         elif not env['username']: env['state'] = None
         # use one or two columns for the layout - not logged in users will see the login prompt
-        env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
         
         
         return render_to_response(self.template, env, context_instance=RequestContext(request))
index c133a57..8fd5917 100644 (file)
@@ -3,7 +3,6 @@ import json
 from random import randint
 
 from django.core.mail           import send_mail
-from django.contrib.auth.models import User
 from django.views.generic       import View
 from django.template.loader     import render_to_string
 from django.shortcuts           import render
@@ -17,7 +16,7 @@ from manifoldapi.manifoldapi    import execute_admin_query
 from manifold.core.query        import Query
 
 from portal.models              import PendingUser
-from portal.actions             import authority_get_pi_emails, manifold_add_user,manifold_add_account
+from portal.actions             import create_pending_user
 
 from theme import ThemeView
 
@@ -68,7 +67,7 @@ class RegistrationView (FreeAccessView, ThemeView):
             }
 
             # Construct user_hrn from email (XXX Should use common code)
-            split_email = reg_email.split("@")[0] 
+            split_email = user_request['email'].split("@")[0] 
             split_email = split_email.replace(".", "_")
             user_request['user_hrn'] = user_request['authority_hrn'] \
                      + '.' + split_email + str(randint(1,1000000))
@@ -99,7 +98,7 @@ class RegistrationView (FreeAccessView, ThemeView):
                 # Example: private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIC...'
                 # Example: public_key = 'ssh-rsa AAAAB3...'
                 user_request['private_key'] = private.exportKey()
-                user_request['public_key']  = private.public_key().exportKey(format='OpenSSH')
+                user_request['public_key']  = private.publickey().exportKey(format='OpenSSH')
 
             else: 
                 user_request['auth_type'] = 'user'
@@ -122,9 +121,8 @@ class RegistrationView (FreeAccessView, ThemeView):
                 self.template_name = 'user_register_complete.html'
                 return render(wsgi_request, self.template, {'theme': self.theme}) 
 
-
-        # Backlashed \n => \\n but no surrounding " "
-        public_key_formatted = request['public_key'].replace('"', '');
+        else:
+            user_request = {}
 
         template_env = {
           'topmenu_items': topmenu_items_live('Register', page),
diff --git a/portal/sliceuserview.py b/portal/sliceuserview.py
new file mode 100644 (file)
index 0000000..1a4bef6
--- /dev/null
@@ -0,0 +1,23 @@
+from django.template                 import RequestContext
+from django.shortcuts                import render_to_response
+
+from manifold.core.query             import Query, AnalyzedQuery
+from manifoldapi.manifoldapi         import execute_query
+
+from django.views.generic.base      import TemplateView
+
+from unfold.loginrequired           import LoginRequiredView
+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 theme import ThemeView
+
+class SliceUserView (LoginRequiredView, ThemeView):
+    template_name = "slice-user-view.html"
+    
+    def get(self, request, slicename):
+        return render_to_response(self.template, {"slice": slicename, "theme": self.theme, "username": request.user, "section":"resources"}, context_instance=RequestContext(request))
index 859b4a9..cfdf432 100644 (file)
@@ -1,198 +1,3 @@
-/*****************************************************************
-Motivated from Geni clearing house
-********************/
-
-* {
-       margin: 0;
-       padding: 0;
-}
-
-fieldset, img {
-       border: 0;
-}
-
-
-
-/************************
-* GENERAL
-************************/
-
-body {
-       background-color: #fff;
-       /* font-family: "Segoe UI", "Lucida Grande", "Helvetica" , sans-serif;
-       font-size: 12pt; */
-       min-width: 1000px; /* ADDED July 2012 */
-       margin: 0px auto; /* ADDED Aug 14, 2012 */
-}
-
-ol {
-    list-style-position: inside;
-}
-
-a {
-    text-decoration: none;
-    color: #0066FF;
-}
-
-code {
-    font-family: "Consolas", "Lucida Console", "Monaco", "Courier New";
-}
-
-.odd {
-    background-color: #fff;
-}
-
-.even {
-    background-color: #eee;
-}
-
-
-/************************
-* LAYOUT
-************************/
-
-/***** Header *****/
-
-#header {
-    width: 900px;   /* Edited Aug 14, 2012  prev width:70%*/
-    margin: 30px auto 20px auto;
-}
-
-#header #logo {
-    font-size: 42px;  /* Edited Sept 28, 2012  prev value :36pt*/
-    font-weight: bold;
-}
-
-#header #logo a {
-    color: #000;
-}
-
-#header #caption {
-    margin-left: 20px;
-    font-size: 13.3333px; 
-}
-
-#header #caption a {
-       color: #0066FF;
-}
-
-
-/***** Navigator *****/
-
-#navigator {
-    border-bottom: 3px solid #222;
-    width: 100%;
-    margin: 0 auto;  /* ADDED Aug 14, 2012 */
-}
-
-#tabs {
-    margin: 0 auto; 
-    width: 900px; /* Editied Aug 14, 2012 prev width: 70% */
-}
-
-#meta {
-    float: right;
-    font-size: 13pt;
-    margin: 5px 0;
-}
-
-#meta a.logout {
-    color: red;
-}
-
-#tabs table {
-    border-collapse: collapse;
-    border-spacing: 0;
-}
-
-#tabs table tr td {
-   padding: 5px 15px;
-   font-size: 14pt;
-   border-top: 1px solid #222;
-   border-right: 2px solid #222;
-   border-left: 2px solid #222;
-}
-
-#tabs table tr td a {
-    color: #000;
-}
-
-#tabs table tr td.active {
-    background-color: #222;
-    color: #fff;
-}
-
-#tabs table tr td.active a {
-    color: #fff;
-}
-
-
-/***** Main *****/
-
-#main {
-    width: 100%;
-    height: 400px;
-    padding: 40px 0;
-    background-image: url(../images/bg.png);
-    background-repeat: repeat-x;
-}
-
-#middle {
-   margin: 0 auto;
-   width: 900px;  /* Edited Aug 14, 2012 prev width:70% */
-  padding-bottom: 60px;
-}
-
-
-/***** Notifications *****/
-
-.warning2 {
-       border: 1px solid red;
-       margin: 20px 60px;
-       padding: 10px 20px;
-       color: red;
-       background-color: #f2dbdb;
-       text-align: center;
-}
-.message {
-       border: 1px solid green;
-          max-width : 682px;  /* ADDED July 2012 */
-       margin: 20px 60px;
-       padding: 10px 20px;
-       color: green;
-       font-weight: normal;
-       background-color: #CCFFCC;
-       text-align: center;
-}
-
-.tooltip {
-       background-color: #efefef;
-       color: #333;
-       font-size: 10pt;
-       padding: 3px;
-    border: solid 1px #333;
-       z-index:100;
-}
-
-ul.errorlist li {
-       color: red;
-       font-weight: normal;
-       font-size: 10pt;
-       background-color: #f2dbdb;
-    padding: 3px;
-    list-style-position: inside;
-}
-
-#learn-about-seattle {
-   /* max-width : 70%;*/
-    text-align : center;
-    background-color : #ded;
-    border : 1px solid #0a0;
-    padding : 1em;
-    margin-top : 1em;
-    margin-bottom : 1em;
-    font-size : 1.3em;
-}
 
 
 
@@ -208,12 +13,6 @@ tr.border_bottom td {border-bottom:1pt solid green;}
 * STYLE FOR PERSONAL DETAILS TABLE
 *******************************/
 
-h1 { 
-  font-size: 1.8em; 
-  border-bottom: 1px solid #bbb; 
-  width: 70%; 
-  min-width: 688px;
-}
 
 #info {
   background-color : #839E99;
index 160cac2..8147e1c 100644 (file)
@@ -1,12 +1,3 @@
-/* @override unfold/static/css/plugin.css */
-
-/*-------------------------------- MARKO'S STYLES -----*/
-
-
-
-
-/*** NEW CSS STYLES FOR ONLEAB ***/
-
 body {
     background-color:white;
     color:black;
@@ -19,17 +10,35 @@ a, a:active, a:focus {
 
 h1 {
     border-bottom:1px solid #DDDDDD;
-    padding:0 0 15px 0;
+    padding:0 0 5px 0;
     margin:0 0 15px 0;
+    font-size:18pt;
 }
 h1 img {
-    vertical-align:top;
+    vertical-align:middle;
+    margin-bottom:4px;
+}
+h2 {
+    font-size:14pt;
+    color:#333333;
+}
+h3 {
+    font-size:13pt;
+    color:#201E62;
 }
 div.wrapper {
     width:980px;
     margin:0 auto;
     position:relative;
 }
+div.container {
+    width:980px;
+    margin:25px auto;
+}
+div.wide {
+    margin:25px auto;
+    padding:0 25px;
+}
 
 span.label {
     font-size:11pt;
@@ -48,7 +57,7 @@ span.label {
 }
 /* HEADER */
 div#header {
-    height:85px;
+    height:100px;
     background-color:white;
 }
 
@@ -121,7 +130,7 @@ div#navigation li:last-child {
 /* HOME DASHBOARD */
 div#home-dashboard {
     color:black;
-    margin:25px auto;
+    margin:0 auto 25px auto;
 }
 div#home-dashboard table {
     margin:25px;
@@ -214,6 +223,7 @@ div#home-dashboard div#home-slice-list li {
 /* NAV TABS */
 
 .nav.nav-tabs {
+    margin-bottom:25px;
 }
 
 .nav.nav-tabs li.active a {
@@ -259,7 +269,6 @@ table.table td {
 /* INSTITUTION */
 div#institution {
     color:black;
-    margin:25px auto;
 }
 .form-hint {
     font-size:11pt;
@@ -267,11 +276,7 @@ div#institution {
     color:gray;
 }
 
-/* SLICE REQUEST */
-div#slice-request {
-    color:black;
-    margin:25px auto;
-}
+
 .form-hint {
     font-size:11pt;
     font-style:italic;
@@ -283,7 +288,6 @@ div#slice-request {
 /* TICKET REQUEST */
 div#ticket-request {
     color:black;
-    margin:25px auto;
 }
 .form-hint {
     font-size:11pt;
@@ -296,25 +300,24 @@ div#ticket-request p {
 
 /* SLICE VIEW */
 div#slice-view {
-    width:100%;
-    margin:25px auto;
+    margin:0;
 }
-div#slice-view div.list-group-item {
+div.list-group-item {
     border:0;
     background-color:white;
     font-weight:bold;
     padding-left:0;
 }
-div#slice-view a.list-group-item {
+a.list-group-item {
     border:0;
     background-color:white;
     padding:3px 0 3px 10px;
     border-left:2pt white solid;
 }
-div#slice-view a.list-group-item.active, div#slice-view a.list-group-item:hover {
+a.list-group-item.active, a.list-group-item:hover {
     border-left:2pt blue solid;
 }
-div#slice-view a.list-group-item p.list-group-item-text {
+a.list-group-item p.list-group-item-text {
     font-size:9pt;
     font-style:italic;
 }
@@ -344,7 +347,6 @@ div#slice-view a.list-group-item p.list-group-item-text {
     font-size:14px;
     color:black;
     padding:0;
-    margin-top:10px;
 }
 .slice-sections li.active a, .slice-pending li.active a  {
     color:#201E62;
@@ -378,18 +380,10 @@ div#slice-view a.list-group-item p.list-group-item-text {
 }
 .slice-pending button {
     font-size:9pt;
-    margin:8px 0 0 0;
+    margin:-2px 0 0 0;
     padding:3px 5px;
 }
 .slice-pending button.apply {
 }
 .slice-pending button.clear {
 }
-
-/* */
-
-/* TESTBED LIST */
-div#testbed-list {
-    margin:25px auto;
-}
-
diff --git a/portal/static/js/institution.js b/portal/static/js/institution.js
new file mode 100644 (file)
index 0000000..17858fe
--- /dev/null
@@ -0,0 +1,63 @@
+$(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();
+    });
+    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();
+        }
+    }
+
+    /* 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){
+                var record_id = this.id;
+                $.post("/delete/slice/",{'filters':{'slice_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#createslice').click(function() {
+        window.location="/portal/slice_request/";
+    });
+    $('button#slicerequestbtn').click(function() {
+        /*
+        window.location="/portal/slice_request/";
+        */
+    });
+});
index b6b7ca5..0419986 100644 (file)
@@ -34,8 +34,8 @@ $(document).ready(function() {
                });
        });
        
-       
-       oTable.load("/table/resource/", {'columns' : ['hostname','country','type'], 'filters' : { 'country' : 'France' } }, function(data) {
+       //{'columns' : ['hostname','country','type'], 'filters' : { 'country' : 'France' } }
+       oTable.load("/table/resource/", {'columns' : ['hostname','country','type'] }, function(data) {
                $(this).dataTable( {
                        "sScrollY": window.innerHeight - 275,
                        "sDom": "frtiS",
index 11d7476..bbb5b49 100644 (file)
@@ -17,19 +17,15 @@ from theme import ThemeView
 class SupportView (FreeAccessView, ThemeView):
     template_name = 'supportview.html'
         
-    # expose this so we can mention the backend URL on the welcome page
-    def default_env (self):
-        return { 
-                 'MANIFOLD_URL':ConfigEngine().manifold_url(),
-                 }
+    
 
     def post (self,request):
-        env = self.default_env()
+        env = {}
         env['theme'] = self.theme
         return render_to_response(self.template, env, context_instance=RequestContext(request))
 
     def get (self, request, state=None):
-        env = self.default_env()
+        env = {}
 
         if request.user.is_authenticated(): 
             env['person'] = self.request.user
@@ -40,12 +36,10 @@ class SupportView (FreeAccessView, ThemeView):
     
 
         env['username']=the_user(request)
-        env['topmenu_items'] = topmenu_items(None, request)
+
         if state: env['state'] = state
         elif not env['username']: env['state'] = None
         # use one or two columns for the layout - not logged in users will see the login prompt
-        env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
-        
-        
+
         return render_to_response(self.template, env, context_instance=RequestContext(request))
 
index 375946c..bddeb7e 100644 (file)
@@ -1,10 +1,41 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
-<div class="wrapper" id="ticket-request">
+{% block content %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="About MySlice" /> About</h1>
 </div>
 
-<h1>This portal is powered by MySlice</h1>
-<a href ="http://myslice.info">More info</a>
+<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>
 
 {% endblock %}
index d3f724e..228ee55 100644 (file)
@@ -1,5 +1,5 @@
-{% extends "layout-unfold1.html" %}
-{% block unfold_main %}
+{% extends "layout.html" %}
+{% block content %}
 
 
 {% if messages %}
 </ul>
 {% endif %}
 
-<div class="wrapper" id="institution">
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="" /> User Account</h1>
+</div>
+
+<div class="row">
     <ul class="nav nav-tabs">
-      <li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
-      <li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
-      <li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
+      <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="home-panel" id="user_profile">
-<p></p>
-<form id="editForm"  method="POST" action="account_process" enctype="multipart/form-data">
-<div id="middle" align="center">
-       <div class="well">
+       
+       <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 class="odd">
+                       <tr>
                                <td colspan="2">
-                                               <div id="info">Platform: Myslice</div>
+                                               <div>Platform: Myslice</div>
                                </td>
                        </tr>
-                       <tr class="even">
+                       <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">
+                                               <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>
                                        <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"  />
+                                       <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>
                                {%endif%}
                        </table>
+               </div>
        </div>
-</div>
-</div>
 
-<div class="home-panel" id="principal_acc" style="display:none;">
+       <div class="account-panel" id="principal_acc" style="display:none;">
 
-<h3>Principal Account <small>Account used for delegating credentials</small></h3>
-<div id="middle" align="center">
-       <div class="well">
-               <table class="table table-bordered table-hover  mytable"> 
+       <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+       <div class="raw">
+               <table class="table"> 
                        <tr class="odd"> 
                        <th>Platform</th> 
                        <th>Account Type</th>
                        {%endfor%}               
                </table>
        </div>
-</div>
 
 
 
-{%if 'Enabled'  in user_status %}
-<h3>Credentials <small>Delegated to Principal Account</small></h3>
-<div id="middle" align="center">
-    <div class="well">
-        <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated User Credential</b></caption> 
-            <tr class="odd"> 
-                <th>Expiration Date</th>
-                               <th>Download</th>
-            </tr>
-                       {% for row in my_users %}         
-                       <tr class="border_bottom">
-                       <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd">
-                                       <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button>
-                               </td>
-                       </tr>
-                       {%endfor%}
-                </table>
-               <p></p>
-               <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated Slice Credentials</b></caption>  
-               <tr class="odd"> 
-                               <th>Slice Name</th> 
-                       <th>Expiration Date</th>
-                               <th>Download</th>
-               </tr>
-                       {% for row in my_slices %}     
-               <tr class="border_bottom">
-                       <td class="odd"> {{ row.slice_name }} </td>
-                               <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd"> 
-                                       <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button> 
-                               </td>
-               </tr>
-               {%endfor%}
-               </table>
-               <p></p>
-               <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated Authority Credentials</b></caption>
-                       <tr class="odd"> 
-                               <th>Authority Name</th> 
-                               <th>Expiration Date</th>
-                               <th>Download</th>
-                       </tr>
-                       {% for row in my_auths %}
-                       <tr class="border_bottom">
-                               <td class="odd"> {{ row.auth_name }} </td>
-                               <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd">
-                                       <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button>
-                               </td>
-                       </tr>
-                       {%endfor%}
-               </table>
-               <p></p>
-                {%if '' not in my_users%}      
-               <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
-               {%else%}
-               <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
-               {%endif%}
-    </div>
-</div>
-</div>
-
-
-<div class="home-panel" id="ref_acc" style="display:none;">
-<h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
-<div id="middle" align="center">
-    <div class="well">
-        <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>
-</div>
-
+       {%if 'Enabled'  in user_status %}
+       <div class="row">
+               <h3>Credentials <small>Delegated to Principal Account</small></h3>
+                       <table class="table">
+                                       <caption><b>Delegated User Credential</b></caption> 
+                           <tr class="odd"> 
+                               <th>Expiration Date</th>
+                                               <th>Download</th>
+                           </tr>
+                                       {% for row in my_users %}         
+                                       <tr class="border_bottom">
+                                       <td class="odd"> {{ row.cred_exp }} </td>
+                                               <td class="odd">
+                                                       <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
+                                                               <span class="glyphicon glyphicon-download"></span> Download
+                                                       </button>
+                                               </td>
+                                       </tr>
+                                       {%endfor%}
+                                </table>
+                               <p></p>
+                               <table class="mytable table table-bordered table-hover">
+                                       <caption><b>Delegated Slice Credentials</b></caption>  
+                               <tr class="odd"> 
+                                               <th>Slice Name</th> 
+                                       <th>Expiration Date</th>
+                                               <th>Download</th>
+                               </tr>
+                                       {% for row in my_slices %}     
+                               <tr class="border_bottom">
+                                       <td class="odd"> {{ row.slice_name }} </td>
+                                               <td class="odd"> {{ row.cred_exp }} </td>
+                                               <td class="odd"> 
+                                                       <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
+                                                               <span class="glyphicon glyphicon-download"></span> Download
+                                                       </button> 
+                                               </td>
+                               </tr>
+                               {%endfor%}
+                               </table>
+                               <p></p>
+                               <table class="mytable table table-bordered table-hover">
+                                       <caption><b>Delegated Authority Credentials</b></caption>
+                                       <tr class="odd"> 
+                                       <th>Authority Name</th> 
+                                       <th>Expiration Date</th>
+                                               <th>Download</th>
+                                       </tr>
+                                       {% for row in my_auths %}
+                                       <tr class="border_bottom">
+                                       <td class="odd"> {{ row.auth_name }} </td>
+                                       <td class="odd"> {{ row.cred_exp }} </td>
+                                               <td class="odd">
+                                                       <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
+                                                               <span class="glyphicon glyphicon-download"></span> Download
+                                                       </button>
+                                               </td>
+                                       </tr>
+                                       {%endfor%}
+                               </table>
+                               <p></p>
+                                {%if '' not in my_users%}      
+                               <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+                               {%else%}
+                               <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+                               {%endif%}
+               </div>
+       </div>
+       
 
 
-<h3>Add reference account to the following testbeds</h3>
-<div id="middle" align="center">
-    <div class="well">
-        <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>
-</div>
-</div>
+       <div class="account-panel" id="ref_acc" style="display:none;">
+               <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>
+               
+               
+               
+               <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>
+       </div>
 {%endif%} 
-</div>
 </form>
 </div>
 
 <script>
     $(document).ready(function() {
-        $('a.home-tab').click(function() {
+        $('a.account-tab').click(function() {
             $('ul.nav-tabs li').removeClass('active');
             $(this).parent().addClass('active');
-            $('div.home-panel').hide();
+            $('div.account-panel').hide();
             $('div#'+$(this).data('panel')).show();
         });
         $('button#createslice').click(function() {
             window.location="/portal/slice_request/";
-        })
-        ;$('button#slicerequestbtn').click(function() {
-            /*
-            window.location="/portal/slice_request/";
-            */
         });
     });
 </script>
index 9f2e30e..5660912 100644 (file)
@@ -1,21 +1,21 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
 {% block head %}
 {{ wizard.form.media }}
 {% endblock %}
 
-{% block unfold_main %}
-
-
-<div class="wrapper" id="ticket-request">
-<h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
-
-<p>
+{% block content %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
+</div>
+<div class="row">
+       <p>
        If you have any diffculties using the portal, please contact us by filling this form below.<br />
-       You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a href="http://trac.myslice.info/" >documentation</a>
-</p>
+       You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a target="_blank" href="http://trac.myslice.info/" >documentation</a>
+       </p>
+</div>
 
-<div>
+<div class="row">
   <form class="cmxform form-horizontal" id="commentForm" action="#" method="post" role="form">{% csrf_token %}
   <fieldset>
     {% for field in form %}
index 62a2ab9..c1d0d7d 100644 (file)
@@ -1,9 +1,14 @@
-{% extends "layout-unfold1.html" %}
-
-{% block unfold_main %}
-
-  <h1>Query Received !</h1>
-
-We will study your problem and get back to you as soon as possible.
+{% extends "layout.html" %}
+
+{% block content %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
+</div>
+<div class="row">
+       <h2>Query Received !</h2>
+       <p>
+       We will study your problem and get back to you as soon as possible.
+       </p>
+</div>
 {% endblock %}
 
index 2ecfdb7..5c838d0 100644 (file)
@@ -1,13 +1,10 @@
-{% extends "layout-unfold1.html" %}
-
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<h1>OneLab Portal Documentation<h1>
+{% extends "layout.html" %}
 
+{% block content %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Portal Documentation</h1>
+</div>
+<div class="row">
 <h2>Portal Components</h2>
 <h3>Myslice (Web Frontend)</h3>
 <p>
@@ -32,6 +29,6 @@ Manifold is the backend that is running behind the portal.
 <h2>FAQ<h2>
 <h3>Users</h3>
 <h3>Managers</h3>
-
+</div>
 {% endblock %}
 
index 0aebd03..1c7ba2a 100644 (file)
@@ -1,13 +1,11 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
+{% block content %}
 
-
-<h1> Experiment Tools </h1>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Experiment Tools" /> Experiment Tools</h1>
+</div>
+<div class="row">
 
 <h2>Secure Shell (SSH)</h2>
 <p>
@@ -31,5 +29,5 @@ OMF was originally developed for the ORBIT wireless testbed at Winlab, Rutgers U
 
 <p>More Info: <a href="http://mytestbed.net/projects/omf" target="_blank">http://mytestbed.net/projects/omf</a></p>
 
-
+</div>
 {% endblock %}
index 4a44ce1..c88902d 100644 (file)
@@ -1,6 +1,6 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
+{% block content %}
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
 <div id="home-dashboard">
        <ul class="nav nav-tabs">
@@ -60,4 +60,4 @@
                </table>
        </div>
 </div>
-{% endblock unfold_main %}
+{% endblock %}
index 771a5e5..1cef373 100644 (file)
@@ -1,28 +1,28 @@
-{% extends "layout-unfold1.html" %}
-
-{% block unfold_main %}
-<div class="wrapper" id="institution">
+{% extends "layout.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>
+<div class="row" id="institution">
     <ul class="nav nav-tabs">
-      <li class="active"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
-      <li><a class="home-tab" data-panel="users" href="#">USERS</a></li>
-      <li><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
+      <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">
-        <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
-        <br>
         <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="onelab_membership" style="float:left; width:30%;">
+            <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 id="authority-data" style="float:right; width:70%;">
-            </div>
         </div>
     </div>
     <div class="home-panel" id="users" style="display:none;">
-               <br>
-        <h1>Users: {{user_details.parent_authority}}</button></h1>
         <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">
@@ -40,8 +40,6 @@
         </div>
        </div>
     <div class="home-panel" id="slices" style="display:none;">
-        <br>
-        <h1>Slices: {{user_details.parent_authority}} <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button></h1>
         <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">
 </div>
 <script>
     $(document).ready(function() {
-        $('a.home-tab').click(function() {
-            $('ul.nav-tabs li').removeClass('active');
-            $(this).parent().addClass('active');
-            $('div.home-panel').hide();
-            $('div#'+$(this).data('panel')).show();
-        });
-        $('button#createslice').click(function() {
-            window.location="/portal/slice_request/";
-        })
-        ;$('button#slicerequestbtn').click(function() {
-            /*
-            window.location="/portal/slice_request/";
-            */
-        });
         {% if person %}
         {% if user_details.parent_authority %}
         $.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
                 */
                     authority_row += val.scientific+"<br>";
                 //}
-                onelab_membership = "<b>Membership:</b> "+val.onelab_membership;
+                onelab_membership = "<b>Status: </b>"+val.onelab_membership;
                 onelab_data.push(onelab_membership);
                 authority_data.push(authority_row);
             });
                     slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
                 }
                 
-                slice_row = "<tr>";
-                slice_row += "<td><input type='checkbox'></td>";
-                slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
+                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>"+slice_url+"</td>";
                 slice_row += "<td>"+nodes_length+"</td>";
                        */
             $.each( data, function( key, val ) {
                 list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
-                user_row = "<tr>";
-                user_row += "<td><input type='checkbox'></td>";
+
+                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>";
          {% endif %}
     });
 </script>
-{% endblock unfold_main %}
+{% endblock %}
index 201c91b..576458a 100644 (file)
@@ -1,22 +1,24 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}    
+{% block content %}    
 
-<div class="onelab-title well-lg">
- <h2>Join the OneLab Federation</h2>
-</div>
 
-<div class="well">
-OneLab welcomes companies, universities, and research laboratories to join the OneLab Federation of Testbeds. <br>
-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.
-<br>
-<br>
-If you wish to become a new member of OneLab Federation, you should first consult the Membership Agreement.
-<br>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="Join Federation" /> Join the OneLab Federation</h1>
+</div>
+<div class="row">
+       
+       <p>
+       OneLab welcomes companies, universities, and research laboratories to join the OneLab Federation of Testbeds. <br>
+       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>
 
 {% if errors %}
-<div class="well">
+<div class="row">
     <ul class="error">
      {% for error in errors %}
      <li>{{ error }}</li>
@@ -25,7 +27,7 @@ If you wish to become a new member of OneLab Federation, you should first consul
 </div>
 {% endif %}
   
-<div class="well">
+<div class="row">
   <form action="" id="joinForm" method="post">
   {% csrf_token %}
     <fieldset>
@@ -137,12 +139,12 @@ If you wish to become a new member of OneLab Federation, you should first consul
   </form>
 </div>
 
-<div class="well">
+<div class="row">
+       <p>
 A membership agreement document will be sent to your email address as a PDF file.
-<br>
+</p><p>
 Please print and sign a copy of the agreement and send it to:
-<br>
-<br>
+</p><p>
 Ciro Scognamiglio<br>
 UPMC - LIP6<br>
 Campus Jussieu<br>
@@ -150,10 +152,11 @@ Couloir 26-00, bureau 102<br>
 Boite courrier 169<br>
 4 place Jussieu<br>
 F-75252 PARIS cedex 05 - FRANCE<br>
-<br>
+</p><p>
 Once your membership has been processed we will contact you to welcome you as a member.
-<br>
+</p><p>
 If you have any questions about membership, contact the <a href="/portal/contact" >OneLab Support team</a>.
+</p>
 </div>
 <script>
 /*
diff --git a/portal/templates/layout.html b/portal/templates/layout.html
new file mode 100644 (file)
index 0000000..4172300
--- /dev/null
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block base_content %}
+<div class="container">
+  {% block content %}
+  {% endblock %}
+</div>
+{% endblock %}
diff --git a/portal/templates/layout_wide.html b/portal/templates/layout_wide.html
new file mode 100644 (file)
index 0000000..f456a0f
--- /dev/null
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block base_content %}
+<div class="wide">
+  {% block content %}
+  {% endblock %}
+</div>
+{% endblock %}
index 4548f46..83b37ee 100644 (file)
@@ -1,5 +1,9 @@
-{% extends "layout-unfold1.html" %}
-{% block unfold_main %}
+{% extends "layout.html" %}
+{% block content %}
+
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_users_small.png" alt="Manage Users" /> Manage Users</h1>
+</div>
 
 
 {% if messages %}
 </ul>
 {% endif %}
 
-<div class="wrapper" id="institution">
+<div class="row">
     <ul class="nav nav-tabs">
       <li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
       <li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
       <li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
     </ul>
-<div class="home-panel" id="user_profile">
-<p></p>         
-<form id="editForm"  method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
-<div id="middle" align="center">
-       <div class="well">
-               {% csrf_token %}
-                       <table class="profile">          
-                       <tr class="odd">
-                               <td colspan="2">
-                                               <div id="info">Platform: Myslice</div>
-                               </td>
-                       </tr>
-                               <tr class="even">
-                               <td class="key">Email</td>
-                               <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
-                               </tr>
-                       <tr class="odd">
-                                       <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="even">
-                               <td class="key">Authority</td>
-                               <td class="value">
-                                       <span id="authval" class="value" >{{ authority }} </span>
-                                       <span class="hide_this" id="span_auth">
-                                       <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_auth_change"> Cancel </button>
-                                       <div style='display:none;'><input type='hidden'  name='authform'  /></div>
-                                       <input id="authority" type="text" name="authority" class="required"  maxlength="200" value="{{authority}}" />
-                                       <input type="submit" class="btn btn-default btn-xs" name="submit_auth" value="Save"/>
-                                       </span>
-                                       <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
-                                       <span class="glyphicon glyphicon-edit"></span> Edit
-                                       </button>
-                               </td>
-                               </tr>     
-                               <tr class="odd">
-                                       <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="even">
-                               <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>
-                       </table>
+       <div class="home-panel" id="user_profile">
+       <form id="editForm"  method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
+       <div id="middle" align="center">
+               <div class="well">
+                       {% csrf_token %}
+                               <table class="profile">          
+                               <tr class="odd">
+                                       <td colspan="2">
+                                                       <div id="info">Platform: Myslice</div>
+                                       </td>
+                               </tr>
+                                       <tr class="even">
+                                       <td class="key">Email</td>
+                                       <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
+                                       </tr>
+                               <tr class="odd">
+                                               <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="even">
+                                       <td class="key">Authority</td>
+                                       <td class="value">
+                                               <span id="authval" class="value" >{{ authority }} </span>
+                                               <span class="hide_this" id="span_auth">
+                                               <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_auth_change"> Cancel </button>
+                                               <div style='display:none;'><input type='hidden'  name='authform'  /></div>
+                                               <input id="authority" type="text" name="authority" class="required"  maxlength="200" value="{{authority}}" />
+                                               <input type="submit" class="btn btn-default btn-xs" name="submit_auth" value="Save"/>
+                                               </span>
+                                               <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
+                                               <span class="glyphicon glyphicon-edit"></span> Edit
+                                               </button>
+                                       </td>
+                                       </tr>     
+                                       <tr class="odd">
+                                               <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="even">
+                                       <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>
+                               </table>
+               </div>
+       </div>
        </div>
-</div>
-</div>
-
-
-<div class="home-panel" id="principal_acc" style="display:none;">
 
-<h3>Principal Account <small>Account used for delegating credentials</small></h3>
-<div id="middle" align="center">
-       <div class="well">
-               <table class="table table-bordered table-hover  mytable"> 
-                       <tr class="odd"> 
-                       <th>Platform</th> 
-                       <th>Account Type</th>
-                               <th>Account Delegation</th>
-                       <th>User hrn</th>
-                               <th>User Status</th>
-                       <!--<th>Pub Key</th> -->
-               </tr>   
-                       {% for row in principal_acc %}         
-                       <tr class="border_bottom">
-                       <td class="odd"> {{ row.platform_name }} </td>
-                       <td class="odd"> {{ row.account_type }} </td>
-                               <td class="odd"> {{ row.delegation_type }} </td>
-                               <td class="odd"> {{ row.usr_hrn }}  </td>
-                               <td class="odd"> {{ row.user_status }}  </td>
-               <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
-               </tr> 
-                       {%endfor%}               
-               </table>
+       
+       <div class="home-panel" id="principal_acc" style="display:none;">
+       <div class="row">
+               
+       <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+       
+                       <table class="table table-bordered table-hover  mytable"> 
+                               <tr class="odd"> 
+                               <th>Platform</th> 
+                               <th>Account Type</th>
+                                       <th>Account Delegation</th>
+                               <th>User hrn</th>
+                                       <th>User Status</th>
+                               <!--<th>Pub Key</th> -->
+                       </tr>   
+                               {% for row in principal_acc %}         
+                               <tr class="border_bottom">
+                               <td class="odd"> {{ row.platform_name }} </td>
+                               <td class="odd"> {{ row.account_type }} </td>
+                                       <td class="odd"> {{ row.delegation_type }} </td>
+                               <td class="odd"> {{ row.usr_hrn }}  </td>
+                                       <td class="odd"> {{ row.user_status }}  </td>
+                       <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
+                       </tr> 
+                               {%endfor%}               
+                       </table>
        </div>
-</div>
 
 
 
 {%if 'Enabled'  in user_status %}
-<h3>Credentials <small>Delegated to Principal Account</small></h3>
-<div id="middle" align="center">
-    <div class="well">
-        <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated User Credential</b></caption> 
-            <tr class="odd"> 
-                <th>Expiration Date</th>
-                               <th>Download</th>
-            </tr>
-                       {% for row in my_users %}         
-                       <tr class="border_bottom">
-                       <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd">
-                                       <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button>
-                               </td>
-                       </tr>
-                       {%endfor%}
-                </table>
-               <p></p>
-               <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated Slice Credentials</b></caption>  
-               <tr class="odd"> 
-                               <th>Slice Name</th> 
-                       <th>Expiration Date</th>
-                               <th>Download</th>
-               </tr>
-                       {% for row in my_slices %}     
-               <tr class="border_bottom">
-                       <td class="odd"> {{ row.slice_name }} </td>
-                               <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd"> 
-                                       <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button> 
-                               </td>
-               </tr>
-               {%endfor%}
-               </table>
-               <p></p>
-               <table class="mytable table table-bordered table-hover">
-                       <caption><b>Delegated Authority Credentials</b></caption>
-                       <tr class="odd"> 
-                               <th>Authority Name</th> 
-                               <th>Expiration Date</th>
-                               <th>Download</th>
-                       </tr>
-                       {% for row in my_auths %}
-                       <tr class="border_bottom">
-                               <td class="odd"> {{ row.auth_name }} </td>
-                               <td class="odd"> {{ row.cred_exp }} </td>
-                               <td class="odd">
-                                       <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
-                                               <span class="glyphicon glyphicon-download"></span> Download
-                                       </button>
-                               </td>
-                       </tr>
-                       {%endfor%}
-               </table>
-               <p></p>
-                {%if '' not in my_users%}      
-               <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
-               {%else%}
-               <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
-               {%endif%}
-    </div>
-</div>
+       <div class="row">
+       <h3>Credentials <small>Delegated to Principal Account</small></h3>
+               <table class="mytable table table-bordered table-hover">
+                               <caption><b>Delegated User Credential</b></caption> 
+                   <tr class="odd"> 
+                       <th>Expiration Date</th>
+                                       <th>Download</th>
+                   </tr>
+                               {% for row in my_users %}         
+                               <tr class="border_bottom">
+                               <td class="odd"> {{ row.cred_exp }} </td>
+                                       <td class="odd">
+                                               <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
+                                                       <span class="glyphicon glyphicon-download"></span> Download
+                                               </button>
+                                       </td>
+                               </tr>
+                               {%endfor%}
+                        </table>
+                       <p></p>
+                       <table class="mytable table table-bordered table-hover">
+                               <caption><b>Delegated Slice Credentials</b></caption>  
+                       <tr class="odd"> 
+                                       <th>Slice Name</th> 
+                               <th>Expiration Date</th>
+                                       <th>Download</th>
+                       </tr>
+                               {% for row in my_slices %}     
+                       <tr class="border_bottom">
+                               <td class="odd"> {{ row.slice_name }} </td>
+                                       <td class="odd"> {{ row.cred_exp }} </td>
+                                       <td class="odd"> 
+                                               <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
+                                                       <span class="glyphicon glyphicon-download"></span> Download
+                                               </button> 
+                                       </td>
+                       </tr>
+                       {%endfor%}
+                       </table>
+                       <p></p>
+                       <table class="mytable table table-bordered table-hover">
+                               <caption><b>Delegated Authority Credentials</b></caption>
+                               <tr class="odd"> 
+                               <th>Authority Name</th> 
+                               <th>Expiration Date</th>
+                                       <th>Download</th>
+                               </tr>
+                               {% for row in my_auths %}
+                               <tr class="border_bottom">
+                               <td class="odd"> {{ row.auth_name }} </td>
+                               <td class="odd"> {{ row.cred_exp }} </td>
+                                       <td class="odd">
+                                               <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
+                                                       <span class="glyphicon glyphicon-download"></span> Download
+                                               </button>
+                                       </td>
+                               </tr>
+                               {%endfor%}
+                       </table>
+                       <p></p>
+                        {%if '' not in my_users%}      
+                       <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+                       {%else%}
+                       <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
+                       {%endif%}
+       </div>
 </div>
 
 
-<div class="home-panel" id="ref_acc" style="display:none;">
-<h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
-<div id="middle" align="center">
-    <div class="well">
+       <div class="home-panel" id="ref_acc" style="display:none;">
+               <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
         <table class="mytable table table-bordered table-hover"> 
             <tr class="odd"> 
                 <th>Platform</th> 
             </tr> 
             {%endfor%}               
         </table>
-    </div>
-</div>
 
 
-<h3>Add reference account to the following testbeds</h3>
-<div id="middle" align="center">
-    <div class="well">
+               <h3>Add reference account to the following testbeds</h3>
+
         <table class="mytable table table-bordered table-hover"> 
             <tr class="odd"> 
                 <th>Platforms</th> 
             </tr> 
             {%endfor%}               
         </table>
-    </div>
-</div>
-</div>
+    
+       </div>
 {%endif%} 
 </div>
 </form>
index 55b8dd3..196a59c 100644 (file)
        </div>
        {% endif %}
 </div>
+<script>
+       $(document).ready(function() {
+               // var slices = localStorage.getItem('slices');
+               // if (slices.length == 0) {
+                       // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+                       // var items = [];
+                               // localStorage.setItem('slices', data[0].slice);
+                       // });
+               // }
+               // $.each(slices, function( key, val ) {
+                       // items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+               // });
+               // $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+       });
+</script>
index a1206de..4915b9e 100644 (file)
@@ -1,7 +1,7 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
-<div class="wrapper" id="home-dashboard">
+{% block content %}
+<div class="row" id="home-dashboard">
        <ul class="nav nav-tabs">
          <li class="active"><a class="home-tab" data-panel="user" href="#">USER</a></li>
          <li><a class="home-tab" data-panel="manager" href="#">MANAGER</a></li>
@@ -59,7 +59,7 @@
                        </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/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>
                                {% endif %}
                                </td>
                                <td>
+                                       {% if person %}
                                    <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button>
+                                       {% endif %}
                                </td>
                                <td class="support">
+                                       {% if person %}
                                    <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+                                       {% endif %}
                                </td>
                        </tr>
                </table>
                {% if person %}
         $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
                  var items = [];
-                 $.each( data[0].slice, function( key, val ) {
-                       items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+                 $.each( data[0].slices, function(i, val) {
+                       items.push( "<li><a href=\"/slice/"+val+"\">" + val + "</a></li>" );
                  });
                  
                  $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
                {% endif %}
        });
 </script>
-{% endblock unfold_main %}
+{% endblock %}
index 7db76a9..5432be7 100644 (file)
@@ -1,10 +1,9 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
 
-{% block unfold_main %}
-<div id="slice-view">  
+{% block content %}
        <div class="col-md-2">
-               <div id="select-platform" class="list-group">
-               </div>
+               <div id="select-platform" class="list-group">
+               </div>
                        
                <ul class="list-group">
                  <li class="list-group-item">Filter: CPU</li>
@@ -13,8 +12,8 @@
                  <li class="list-group-item">...</li>
                  <li class="list-group-item">...</li>
                </ul>
-
-       </div>
+       
+       </div>
        <div class="col-md-10">
                <div class="row">
                        {% include theme|add:"_widget-slice-sections.html" %}
@@ -39,5 +38,4 @@
                </div>
                <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table>
        </div>
-</div>
-{% endblock unfold_main %}
\ No newline at end of file
+{% endblock %}
\ No newline at end of file
diff --git a/portal/templates/onelab/onelab_slice-user-view.html b/portal/templates/onelab/onelab_slice-user-view.html
new file mode 100644 (file)
index 0000000..5d597a1
--- /dev/null
@@ -0,0 +1,81 @@
+{% extends "layout_wide.html" %}
+
+
+{% block content %}
+       <div class="col-md-2">
+               <div id="select-platform" class="list-group">
+               </div>
+                       
+               <ul class="list-group">
+                 <li class="list-group-item">Filter: authority</li>
+                 <li class="list-group-item">Filter: slice</li>
+                 <li class="list-group-item">...</li>
+                 <li class="list-group-item">...</li>
+                 <li class="list-group-item">...</li>
+               </ul>
+       
+       </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;">
+               <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>
+               </div>
+<script>
+    $(document).ready(function() {
+        $.post("/rest/user/",{'filters':{'parent_authority':'ple.upmc'}}, function( data ) {
+            var list_users = [];
+            var table_users = [];
+                       /*
+                       "enabled", "keys", "parent_authority", "user_first_name", "user_last_name", "user_phone", "user_hrn", "slice", "user_email"
+                       */
+            $.each( data, function( key, val ) {
+                list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+                user_row = "<tr>";
+                user_row += "<td><input type='checkbox'></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.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");
+         });
+    });
+</script>
+
+{% endblock %}
index 85ae5a8..a67d34b 100644 (file)
@@ -1,7 +1,6 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
 
-{% block unfold_main %}
-<div id="slice-view">  
+{% block content %}
        <div class="col-md-2"></div>
        <div class="col-md-10">
                <div class="row">
        <div class="col-md-10">
         <br>
         <br>
-        <table>
-            <tr>
-                <td><b>Description:</b></td>
-                <td>this slice is dedicated to debug the myslice software...</td>
-            </tr>
-            <tr>
-                <td><b>url:</b></td>
-                <td><a href="http://myslice.info" target="_blank">http://myslice.info</a></td>
-            </tr>
-            <tr>
-                <td><b>users:</b></td>
-                <td>3</td>
-            </tr>
-            <tr>
-                <td><b>resources:</b></td>
-                <td>8</td>
-            </tr>
-            <tr>
-                <td><b>created:</b></td>
-                <td>2012-06-21 10:00</td>
-            </tr>
-            <tr>
-                <td><b>last update:</b></td>
-                <td>2014-02-25 14:00</td>
-            </tr>
-            <tr>
-                <td><b>expires:</b></td>
-                <td>2014-04-01 12:00</td>
-            </tr>
-        </table>
+        <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">
+            </table>
+        </div>
        </div>
-    
-</div>
-{% endblock unfold_main %}
+<script>
+    $(document).ready(function() {
+        $.post("/rest/slice/",{'filters':{'slice_hrn':'{{slice}}'}}, function( data ) {
+            var table_slices = [];
+            /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+            $.each( data, function( key, val ) {
+                if(val.nodes=="undefined" || val.nodes==null){
+                    nodes_length=0;
+                }else{
+                    nodes_length=val.nodes.length;
+                }
+
+                if(val.user=="undefined" || val.user==null){
+                    user_length=0;
+                }else{
+                    user_length=val.user.length;
+                }
+
+                if(val.slice_url=="undefined" || val.slice_url==null){
+                    slice_url="";
+                }else{
+                    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>";
+                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");
+        });
+    });
+</script>
+{% endblock %}
index 546fd88..a0872bf 100644 (file)
@@ -1,7 +1,6 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout_wide.html" %}
 
-{% block unfold_main %}
-<div id="testbed-list">
+{% block content %}
        <div class="col-md-2"></div>
        <div class="col-md-10">
                <div class="row">
@@ -16,5 +15,4 @@
                </div>
                <table cellpadding="0" cellspacing="0" border="0" class="table" id="testbedList"></table>
        </div>
-</div>
-{% endblock unfold_main %}
\ No newline at end of file
+{% endblock %}
\ No newline at end of file
index d01bdbe..e637b15 100644 (file)
@@ -3,7 +3,7 @@
                <li {% if section == 'slice' %}class="active"{% endif %}><a href="/slice/{{ slice }}/">{{ slice }}</a></li>
                <li {% if section == 'testbeds' %}class="active"{% endif %}><a href="/testbeds/{{ slice }}/">Testbeds</a></li>
                <li {% if section == 'resources' %}class="active"{% endif %}><a href="/resources/{{ slice }}/">Resources</a></li>
-               <li {% if section == 'users' %}class="active">{% endif %}><a href="/users/{{ slice }}/">Users</a></li>
+               <li {% if section == 'users' %}class="active"{% endif %}><a href="/users/{{ slice }}/">Users</a></li>
                <li><a href="">Statistics</a></li>
                <li><a href="">Measurements</a></li>
        </ul>
index 63ce14e..eee3d20 100644 (file)
@@ -1,18 +1,18 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 {% load i18n %}
 
-{% block unfold_main %}
-
-
 {% block content %}
 
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Password reset successful' %}</h3>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+       <h3>Onelab secured Password reset wizard</h3>
+       <p>Password reset successful</p>
 
-<p>{% trans "Your password has been set.  You may go ahead and log in now." %}</p>
+       <p>Your password has been set.  You may go ahead and log in now.</p>
 
-<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
-
-{% endblock %}
+       <p><a href="/">Log in</a></p>
+</div>
 {% endblock %}
 
index 0ea6867..8f9d2f7 100644 (file)
@@ -1,36 +1,33 @@
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
-
+{% extends "layout.html" %}
 {% block content %}
 
 {% if validlink %}
 
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Enter new password' %}</h3>
-
-<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<form action="" method="post">{% csrf_token %}
-{{ form.new_password1.errors }}
-<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
-{{ form.new_password2.errors }}
-<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
-<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
-</form>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+       <h3>Onelab secured Password reset wizard</h3>
+
+       <p>Please enter your new password twice so we can verify you typed it in correctly.</p>
+       
+       <form action="" method="post">{% csrf_token %}
+       {{ form.new_password1.errors }}
+       <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
+       {{ form.new_password2.errors }}
+       <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
+       <p><input type="submit" value="{% trans 'Change my password' %}" /></p>
+       </form>
 
 {% else %}
+       
+       <h3>Onelab secured Password reset wizard</h3>
 
-<h2>{% trans 'OneLab secured Password reset wizard' %}</h2>
-<h3>{% trans 'Password reset unsuccessful!' %}</h3>
-
-<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> 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> 
+       <p>If you still encounter problem please <a href="/portal/contact/">Contact Support</a> for password recovery.</p> 
+</div>
 {% endif %}
 
 {% endblock %}
-{% endblock %}
 
index caeb4eb..5efdfb2 100644 (file)
@@ -1,14 +1,12 @@
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
+{% extends "layout.html" %}
 {% block content %}
-
-<h2>{% trans 'Onelab secured Password reset wizard' %}</h2>
-
-<p>{% trans "We've emailed you instructions for setting your password to the email address you submitted. You should be receiving it shortly." %}</p>
-
-{% endblock %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+       <h3>Onelab 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>
 {% endblock %}
 
index 8fba320..427c4fe 100644 (file)
@@ -1,21 +1,17 @@
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
-
-{% block unfold_main %}
-
-
-
+{% extends "layout.html" %}
 {% block content %}
-
-<h2>{% trans "Welcome to Onelab secured Password reset wizard" %}</h2>
-
-<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
-
-<form action="" method="post">{% csrf_token %}
-{{ form.email.errors }}
-<p><label for="id_email">{% trans 'Email address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
-</form>
-
-{% endblock %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="Password reset" /> Password reset</h1>
+</div>
+<div class="row">
+       <h3>Welcome to Onelab 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>
+       
+       <form action="/portal/pass_reset/" method="post">{% csrf_token %}
+       {{ form.email.errors }}
+       <p><label for="id_email">Email address:</label> {{ form.email }} <input type="submit" value="Reset my password" /></p>
+       </form>
+</div>
 {% endblock %}
 
index 136a8bf..499eb74 100644 (file)
@@ -1,10 +1,10 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
 {% block head %}
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
 {% endblock %}
 
-{% block unfold_main %}
+{% block content %}
 <h1>Platform</h1>
 {{networks}}
 <br>
index 1f480a1..740d7c9 100644 (file)
@@ -1,14 +1,12 @@
-{% extends "layout-unfold1.html" %}
-{% load i18n %}
+{% extends "layout.html" %}
 {% load crispy_forms_tags %}
 
-
 {% block head %}
 {{ wizard.form.media }}
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
 {% endblock %}
 
-{% block unfold_main %}
+{% block content %}
 
   <h1>User registration</h1>
 
index 1f27d41..10381a3 100644 (file)
@@ -1,11 +1,13 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}        
+{% block content %}        
 
-<div class="onelab-title well-lg">
-  <h2>OneLab Experimenter Registration</h2>
-  <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
 </div>
+<div class="row">
+
+  <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
 
 {% if errors %}
 <ul>
@@ -15,7 +17,6 @@
 </ul>
 {% endif %}
    
-<div class="well">
  <form class="cmxform form-horizontal" id="registrationForm" method="post" action="" enctype="multipart/form-data" role="form">
     <fieldset>
     {% csrf_token %}
     <div class="form-group" id="register">
       <button class="submit btn btn-default col-xs-12" type="submit">Register</button>
     </div>
-    </div>
   </fieldset>
   </form>  
 </div>
index dc98c27..c101b06 100644 (file)
@@ -1,6 +1,6 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
+{% block content %}
 
   <h1>Slice request Received !</h1>
 
index 4568864..838b9b4 100644 (file)
@@ -1,11 +1,11 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 {% load i18n %}
 
 {% block head %}
 {{ wizard.form.media }}
 {% endblock %}
 
-{% block unfold_main %}
+{% block content %}
 
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
 <!-- xxx ideally only onelab.css but ... xxx -->
index d59bd68..1f57bce 100644 (file)
@@ -1,15 +1,11 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 {% load i18n %}
 
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<div class="wrapper" id="slice-request">
-<h1><img src="{{ STATIC_URL }}img/icon_slices_small.png" alt="Request a Slice" /> Request a new Slice</h1>
+{% block content %}
 
+<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 %}
@@ -18,7 +14,7 @@
 </ul>
 {% endif %}
 
-<div>
+<div class="row">
   <form id="commentForm" class="form-horizontal" method="post">
   {% csrf_token %}
   <fieldset>
@@ -81,7 +77,6 @@
   </fieldset>
   </form>
 </div>
-</div>
 <script>
 jQuery(document).ready(function(){
     var availableTags = [
@@ -99,6 +94,7 @@ jQuery(document).ready(function(){
     ];
     $( "#authority_hrn" ).autocomplete({
       source: availableTags,
+      minLength: 0,
       select: function( event, ui ) {console.log(jQuery(this))}
     });
 });
index 18b5a93..3b4c2ef 100644 (file)
@@ -1,72 +1,69 @@
-{% extends "layout-unfold1.html" %}
-
-{% block head %}
-{{ wizard.form.media }}
-{% endblock %}
-
-{% block unfold_main %}
-
-<h1>OneLab Portal Support</h1>
-
-<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 id="middle" align="center">
-    <div class="well">
-        <table class="mytable table table-bordered table-hover">
-            <tr>
-                <th>Ticket No</th>
+{% extends "layout.html" %}
+
+{% block content %}
+       <div class="row">
+               <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Request a Slice" /> OneLab Portal Support</h1>
+       </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>
+                   <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>
                        <tr>
-                       <td>2</td>
+                               <td>2</td>
                                <td>azerty@lip6.fr</td>
-                       <td>Unable to Register</td>
-                       <td>Unresolved</td>
+                               <td>Unable to Register</td>
+                               <td>Unresolved</td>
                        </tr>
-
-        </table>
-    </div>
-</div>
-</div>
-
-
-
-
-
-<h2><a href="/portal/support/documentation">FAQ</a></h2>
-<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>
+       
+           </table>
+       </div>
+
+
+       
+       <div class="row">
+       
+               <h2><a href="/portal/support/documentation">FAQ</a></h2>
+               <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>
 
 <script>
     $(document).ready(function() {
         $('button#ticketbtn').click(function() {
             window.location="/portal/contact/";
-        })
+        });
     });
 </script>
 
index bfb08f1..a1295c1 100644 (file)
@@ -1,21 +1,25 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
 {% block head %}
 {{ wizard.form.media }}
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
 {% endblock %}
 
-{% block unfold_main %}
+{% block content %}
 
-  <h1>User registration</h1>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
+</div>
+<div class="row">
 
-{% if envoi %}Your registration message has been sent !{% endif %}
-<div class='well'>
-<form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
-{{ form.as_p }}
-<input type="submit" value="Submit" />
-</form>
+{% if envoi %}
+       <h3>Your registration message has been sent !</h3>
+{% endif %}
+        
+       <form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
+       {{ form.as_p }}
+       <input type="submit" value="Submit" />
+       </form>
 </div>
 
 {% endblock %}
index 35b252e..9c61395 100644 (file)
@@ -1,8 +1,15 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
+{% block content %}
 
-  <h1>User registration complete !</h1>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
+</div>
+<div class="row">
+  <h3>User registration complete !</h3>
+  <p>
+       You will receive an email with further instructions.
+  </p>
+ </div>
 
-You will receive an email with further instructions.
 {% endblock %}
index cef58ea..447c931 100644 (file)
@@ -1,7 +1,6 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
 {% block head %}
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/validate_pending.css" />
 <script type="text/javascript">
        function on_click_event() {
                var ids = []; 
 </script>
 {% endblock %}
 
-{% block unfold_main %}
-<div class="onelab-title well-lg">
-<h1>Pending requests</h1>
-</div>
-<hr/>
-<h2>My authorities</h2>
-
-{% if my_authorities %}
-
-{% for authority, requests in my_authorities.items %}
-<h3>{{authority}}</h3>
-<div class="container">
-    <table width=100% border=1>
-      <th>
-        <td>type</td>
-        <td>id</td>
-        <td>details</td>
-        <td>timestamp</td>
-        <td>status</td>
-      </th>
-    {% for request in requests %}
-
-         <tr>
-               <td>
-               {% if request.allowed == 'allowed' %}
-               <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
-               {% else %}
-                       {% if request.allowed == 'expired' %}
-                               expired
-                       {% else %} {# denied #}
-                               denied
+{% block content %}
+       <div class="row">
+               <h1><img src="{{ STATIC_URL }}img/icon_testbed_small.png" alt="" /> Pending requests</h1>
+       </div>
+
+       {% if my_authorities %}
+       
+       {% for authority, requests in my_authorities.items %}
+       
+       <div class="row">
+               <h3>{{authority}}</h3>
+           <table class="table">
+             <th>
+               <td>type</td>
+               <td>id</td>
+               <td>details</td>
+               <td>timestamp</td>
+               <td>status</td>
+             </th>
+           {% for request in requests %}
+       
+                 <tr>
+                       <td>
+                       {% if request.allowed == 'allowed' %}
+                       <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+                       {% else %}
+                               {% if request.allowed == 'expired' %}
+                                       expired
+                               {% else %} {# denied #}
+                                       denied
+                               {% endif %}
                        {% endif %}
-               {% endif %}
-               </td>
-               <td>{{ request.type }}</td>
-               <td>{{ request.id }}</td>
-               <td>
-        {% if request.type == 'user' %}
-        Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
-        {% else %}
-            {% if request.type == 'slice' %}
-        Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
-            {% else %} {# authority #}
-        Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
-            {% endif %}
-        {% endif %}
-               </td>
-               <td>{{ request.timestamp }}</td>
-               
-               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
-    <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
-         </tr>
-
-    {% endfor %}
-       </table>
-{% endfor %}
+                       </td>
+                       <td>{{ request.type }}</td>
+                       <td>{{ request.id }}</td>
+                       <td>
+               {% if request.type == 'user' %}
+               Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+               {% else %}
+                   {% if request.type == 'slice' %}
+               Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+                   {% else %} {# authority #}
+               Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+                   {% endif %}
+               {% endif %}
+                       </td>
+                       <td>{{ request.timestamp }}</td>
+                       
+                       <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+       
+           <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+                 </tr>
+       
+           {% endfor %}
+               </table>
+       </div>
+       {% endfor %}
 
 {% else %}
-<i>There is no pending request waiting for validation.</i>
+       <div class="row">
+               <i>There is no pending request waiting for validation.</i>
+       </div>
 {% endif %}
 
 {% if sub_authorities %}
-<hr/>
-<h2>Sub-Authorities</h2>
-
-{% for authority, requests in sub_authorities.items %}
-<h3>{{authority}}</h3>
-    <table width=100% border=1>
-      <th>
-        <td>type</td>
-        <td>id</td>
-        <td>details</td>
-        <td>timestamp</td>
-        <td>status</td>
-      </th>
-    {% for request in requests %}
-         <tr>
-               <td>
-               {% if request.allowed == 'allowed' %}
-               <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
-               {% else %}
-                       {% if request.allowed == 'expired' %}
-                               expired
-                       {% else %} {# denied #}
-                               denied
+       <div class="row">
+               <h2>Sub-Authorities</h2>
+       </div>
+       {% for authority, requests in sub_authorities.items %}
+       <div class="row">
+       <h3>{{authority}}</h3>
+           <table class="table">
+             <th>
+               <td>type</td>
+               <td>id</td>
+               <td>details</td>
+               <td>timestamp</td>
+               <td>status</td>
+             </th>
+           {% for request in requests %}
+                 <tr>
+                       <td>
+                       {% if request.allowed == 'allowed' %}
+                       <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+                       {% else %}
+                               {% if request.allowed == 'expired' %}
+                                       expired
+                               {% else %} {# denied #}
+                                       denied
+                               {% endif %}
                        {% endif %}
-               {% endif %}
-               </td>
-               <td>{{ request.type }}</td>
-               <td>{{ request.id }}</td>
-               <td>
-        {% if request.type == 'user' %}
-        Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
-        {% else %}
-            {% if request.type == 'slice' %}
-        Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
-            {% else %} {# authority #}
-        Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
-            {% endif %}
-        {% endif %}
-               </td>
-               <td>{{ request.timestamp }}</td>
-               
-               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
-    <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
-         </tr>
-    {% endfor %}
-    </table>
-{% endfor %}
-<hr/>
+                       </td>
+                       <td>{{ request.type }}</td>
+                       <td>{{ request.id }}</td>
+                       <td>
+               {% if request.type == 'user' %}
+               Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+               {% else %}
+                   {% if request.type == 'slice' %}
+               Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+                   {% else %} {# authority #}
+               Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+                   {% endif %}
+               {% endif %}
+                       </td>
+                       <td>{{ request.timestamp }}</td>
+                       
+                       <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+       
+           <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+                 </tr>
+           {% endfor %}
+           </table>
+       </div>
+       {% endfor %}
 
 {% endif %}
 
 
 {% if delegation_authorities %}
-<hr/>
-<h2>Authorities with delegation</h2>
-
-{% for authority, requests in delegation_authorities.items %}
-<h3>{{authority}}</h3>
-    <table width=100% border=1>
-      <th>
-        <td>type</td>
-        <td>id</td>
-        <td>details</td>
-        <td>timestamp</td>
-        <td>status</td>
-      </th>
-    {% for request in requests %}
-         <tr>
-               <td>
-               {% if request.allowed == 'allowed' %}
-               <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
-               {% else %}
-                       {% if request.allowed == 'expired' %}
-                               expired
-                       {% else %} {# denied #}
-                               denied
-                       {% endif %}
-               {% endif %}
-               </td>
-               <td>{{ request.type }}</td>
-               <td>{{ request.id }}</td>
-               <td>
-        {% if request.type == 'user' %}
-        Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
-        {% else %}
-            {% if request.type == 'slice' %}
-        Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
-            {% else %} {# authority #}
-        Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
-            {% endif %}
-       {% endif %}
-               </td>
-               <td>{{ request.timestamp }}</td>
+       <div class="row">
+               <h2>Authorities with delegation</h2>
+       </div>
+       {% for authority, requests in delegation_authorities.items %}
+       <div class="row">
+               <h3>{{authority}}</h3>
+                   <table class="table">
+                     <th>
+                       <td>type</td>
+                       <td>id</td>
+                       <td>details</td>
+                       <td>timestamp</td>
+                       <td>status</td>
+                     </th>
+                   {% for request in requests %}
+                         <tr>
+                               <td>
+                               {% if request.allowed == 'allowed' %}
+                               <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+                               {% else %}
+                                       {% if request.allowed == 'expired' %}
+                                               expired
+                                       {% else %} {# denied #}
+                                               denied
+                                       {% endif %}
+                               {% endif %}
+                               </td>
+                               <td>{{ request.type }}</td>
+                               <td>{{ request.id }}</td>
+                               <td>
+                       {% if request.type == 'user' %}
+                       Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+                       {% else %}
+                           {% if request.type == 'slice' %}
+                       Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+                           {% else %} {# authority #}
+                       Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+                           {% endif %}
+                      {% endif %}
+                               </td>
+                               <td>{{ request.timestamp }}</td>
+                               
+                               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
                
-               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-
-    <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
-         </tr>
-    {% endfor %}
-    </table>
-{% endfor %}
-<hr/>
+                   <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+                         </tr>
+                   {% endfor %}
+                   </table>
+               </div>
+               {% endfor %}
 
 {% endif %}
-
-<input type='button' id='portal__validate' value='Validate' onclick='on_click_event();'/>
-</div>
-<!-- End of the container div -->
+       <div class="row">
+               <button type="button" id="portal__validate" onclick="on_click_event();">Validate</button>
+       </div>
 {% endblock %}
index 43b34e5..e0f4ab1 100644 (file)
@@ -263,7 +263,6 @@ class ValidatePendingView(FreeAccessView, ThemeView):
         context['username'] = the_user(self.request) 
         
         context['theme'] = self.theme
-        
         # XXX We need to prepare the page for queries
         #context.update(page.prelude_env())
 
index f871966..854c9e8 100644 (file)
@@ -6,10 +6,11 @@ from django.shortcuts               import render_to_response
 from unfold.loginrequired           import LoginRequiredView
 from django.http                    import HttpResponse
 
-from manifold.core.query            import Query, AnalyzedQuery
+from manifold.core.query            import Query
 from manifoldapi.manifoldapi        import execute_query
 
-from string import join
+from string                         import join
+
 import decimal
 import datetime
 import json
@@ -27,110 +28,106 @@ class DecimalEncoder(json.JSONEncoder):
             return (str(o) for o in [o])
         return super(DecimalEncoder, self)._iterencode(o, markers)
 
-def dispatch(request, object_type, object_name):
+class objectRequest(object):
     
-    object_properties = None
-    object_filters = {}
-    
-    switch = {
-         'platform' : platform,
-         'slice' : slice,
-         'resource' : resource,
-         'user' : user,
-         'authority' : authority,
-    }
-    
-    if request.method == 'POST':
-        req_items = request.POST.items()
-    elif request.method == 'GET':
-        req_items = request.GET.items()
+    def __init__(self, request, object_type, object_name):
+        self.type = object_type
+        self.name = object_name
+        self.properties = []
+        self.filters = {}
+        self.options = None
         
-    for el in req_items:
-        if el[0].startswith('filters'):
-            object_filters[el[0][8:-1]] = el[1]
-        elif el[0].startswith('columns'):
-            object_properties = request.POST.getlist('columns[]')
-
-    # platform is local
-    if ((object_type == 'platform') or (object_type == 'testbed')) :
-        object_type = 'local:platform'
-        if object_properties == None :
-            object_properties = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
-        return switch.get('platform', error)(request, object_name, object_properties, object_filters)
-    else :
-        if object_properties == None :
-            query = Query.get('local:object').filter_by('table', '==', object_type).select('column.name')
-            results = execute_query(request, query)
+        self.request = request
+
+    # XXX TODO: What about the local: objects? 
+    # Example: local:user (Manifold) is different from user (SFA GW)   
+
+        if ((self.type == 'platform') or (self.type == 'testbed')) :
+            self.type = 'local:platform'
+            self.id = 'platform'
+            self.properties = ['platform', 'platform_longname', 'platform_url', 'platform_description','gateway_type'];
+            self.filters['disabled'] = '0'
+            self.filters['gateway_type'] = 'sfa'
+            self.filters['platform'] = '!myslice'
+        else :
+            self.id = 'hrn'
+            query = Query.get('local:object').filter_by('table', '==', self.type).select('column.name')
+            results = execute_query(self.request, query)
             if results :
-                object_properties = []
                 for r in results[0]['column'] :
-                    object_properties.append(r['name'])
+                    self.properties.append(r['name'])
             else :
-                return error(request, object_name, {})
-        return switch.get(object_type, error)(request, object_name, object_properties, object_filters)
-
-def platform(request, object_name, object_properties, object_filters = None):
-    query  = Query().get('local:platform').filter_by('disabled', '==', '0').filter_by('gateway_type', '==', 'sfa').filter_by('platform', '!=', 'myslice')
-    if object_filters :
-        for k, f in object_filters.iteritems() :
-            query.filter_by(k, '==', f)
-    query.select(object_properties)
-    return send(request, execute_query(request, query), object_properties)
-
-# Add different filters possibilities [['user.user_hrn','==','$user_hrn'],['parent_authority','==','ple.upmc']]
-def slice(request, object_name, object_properties, object_filters = None):
-    query = Query().get('slice')#.filter_by('user.user_hrn', '==', '$user_hrn')
-    if object_filters :
-        for k, f in object_filters.iteritems() :
-            query.filter_by(k, '==', f)
-    query.select(object_properties)
-    return send(request, execute_query(request, query), object_properties)
-
-def resource(request, object_name, object_properties, object_filters = None):
-    query = Query().get('resource')
-    if object_filters :
-        for k, f in object_filters.iteritems() :
-            query.filter_by(k, '==', f)
-    query.select(object_properties)
-    return send(request, execute_query(request, query), object_properties)
+                return error('db error')
+        return None
+    
+    def addFilters(self, properties):
+        selected_properties = []
+        for p in properties :
+            if p in self.properties :
+                selected_properties.append(p)
+        self.properties = selected_properties
+        self.setId()
+    
+    def setId(self):
+        if self.id in self.properties :
+            self.properties.remove(self.id)
+            [self.id].extend(self.properties)
+    
+    def execute(self):
+        query = Query.get(self.type).select(self.properties)
+        if self.filters :
+            for k, f in self.filters.iteritems() :
+                if (f[:1] == "!") :
+                    query.filter_by(k, '!=', f[1:])
+                elif (f[:2] == ">=") :
+                    query.filter_by(k, '>=', f[2:])
+                elif (f[:1] == ">") :
+                    query.filter_by(k, '>', f[1:])
+                elif (f[:2] == "<=") :
+                    query.filter_by(k, '<=', f[2:])
+                elif (f[:1] == "<") :
+                    query.filter_by(k, '<', f[1:])
+                else :
+                    query.filter_by(k, '==', f)
+        return execute_query(self.request, query)
 
-def user(request, object_name, object_properties, object_filters = None):
-    query = Query().get('user')#.filter_by('user_hrn', '==', '$user_hrn')
-    if object_filters :
-        for k, f in object_filters.iteritems() :
-            query.filter_by(k, '==', f)
-    query.select(object_properties)
-    return send(request, execute_query(request, query), object_properties)
+def dispatch(request, object_type, object_name):
+    
+    o = objectRequest(request, object_type, object_name)
+    
+    if request.method == 'POST':
+        req_items = request.POST
+    elif request.method == 'GET':
+        req_items = request.GET
 
-def authority(request, object_name, object_properties, object_filters = None):
-    query = Query().get('authority')#.filter_by('user_hrn', '==', '$user_hrn')
-    if object_filters :
-        for k, f in object_filters.iteritems() :
-            query.filter_by(k, '==', f)
-    query.select(object_properties)
-    return send(request, execute_query(request, query), object_properties)
+    for el in req_items.items():
+        if el[0].startswith('filters'):
+            o.filters[el[0][8:-1]] = el[1]
+        elif el[0].startswith('columns'):
+            o.addFilters(req_items.getlist('columns[]'))
+        elif el[0].startswith('options'):
+            o.options = req_items.getlist('options[]')
 
-def send(request, response, object_properties):
+    response = o.execute()
+    
     if request.path.split('/')[1] == 'rest' :
         response_data = response
         return HttpResponse(json.dumps(response_data, cls=DecimalEncoder, default=DateEncoder), content_type="application/json")
     elif request.path.split('/')[1] == 'table' :
-        return render_to_response('table-default.html', {'data' : response, 'properties' : object_properties})
+        return render_to_response('table-default.html', {'data' : response, 'properties' : o.properties, 'id' : o.id, 'options' : o.options})
     elif request.path.split('/')[1] == 'datatable' :
         response_data = {}
-        response_data['columns'] = object_properties
-        response_data['labels'] = object_properties
+        response_data['columns'] = o.properties
+        response_data['labels'] = o.properties
         response_data['data'] = []
         response_data['total'] = len(response)
         for r in response :
             d = []
-            for p in object_properties :
+            for p in o.properties :
                 d.append(r[p])
-            print d
-            
             response_data['data'].append(d)
          
         return HttpResponse(json.dumps(response_data, cls=DecimalEncoder, default=DateEncoder), content_type="application/json")
 
-def error(request, object_name, object_properties):
-    return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+def error(msg):
+    return HttpResponse(json.dumps({'error' : msg}), content_type="application/json")
diff --git a/rest/create.py b/rest/create.py
new file mode 100644 (file)
index 0000000..eaad539
--- /dev/null
@@ -0,0 +1,68 @@
+from manifold.core.query            import Query
+
+from django.views.generic.base      import TemplateView
+from django.shortcuts               import render_to_response
+
+from unfold.loginrequired           import LoginRequiredView
+from django.http                    import HttpResponse
+
+from manifold.core.query            import Query, AnalyzedQuery
+from manifoldapi.manifoldapi        import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+    def _iterencode(self, o, markers=None):
+        if isinstance(o, decimal.Decimal):
+            return (str(o) for o in [o])
+        return super(DecimalEncoder, self)._iterencode(o, markers)
+
+def dispatch(request, object_type, object_name):
+    
+    object_filters = {}
+    object_params = {}
+    result = {}
+    
+    if request.method == 'POST':
+        req_items = request.POST.items()
+    elif request.method == 'GET':
+        return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+
+    query = Query.create(object_type)
+
+# No filters for create    
+#    if object_filters :
+#        for k, f in object_filters.iteritems() :
+#            query.filter_by(k, '==', f)
+#    
+#    # DEBUG        
+#    print object_filters
+    
+    if object_params :
+        query.set(object_params.iteritems())
+    else :
+        return HttpResponse(json.dumps({'error' : 'params are required for create'}), content_type="application/json")
+    
+    # DEBUG
+    print object_params
+    
+    result = execute_query(request, query)
+    
+    # DEBUG
+    print result
+    
+    if result :
+        return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+    else :
+        return HttpResponse(json.dumps({'success' : 'record updated'}), content_type="application/json")
+    
diff --git a/rest/delete.py b/rest/delete.py
new file mode 100644 (file)
index 0000000..70d0ae6
--- /dev/null
@@ -0,0 +1,125 @@
+from manifold.core.query            import Query
+
+from django.views.generic.base      import TemplateView
+from django.shortcuts               import render_to_response
+
+from unfold.loginrequired           import LoginRequiredView
+from django.http                    import HttpResponse
+
+from manifold.core.query            import Query, AnalyzedQuery
+from manifoldapi.manifoldapi        import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+    def _iterencode(self, o, markers=None):
+        if isinstance(o, decimal.Decimal):
+            return (str(o) for o in [o])
+        return super(DecimalEncoder, self)._iterencode(o, markers)
+
+class objectRequest(object):
+
+    def __init__(self, request, object_type, object_name):
+        self.type = object_type
+        self.name = object_name
+        # No params in delete    
+        self.properties = []
+        self.filters = {}
+        self.options = None
+
+        self.request = request
+
+        # What about key formed of multiple fields???
+        query = Query.get('local:object').filter_by('table', '==', self.type).select('key')
+        results = execute_query(self.request, query)
+        print "key of object = %s" % results
+        if results :
+            for r in results[0]['key'] :
+                self.id = r
+        else :
+            return error('Manifold db error')
+
+        query = Query.get('local:object').filter_by('table', '==', self.type).select('column.name')
+        results = execute_query(self.request, query)
+        if results :
+            for r in results[0]['column'] :
+                self.properties.append(r['name'])
+        else :
+            return error('Manifold db error')
+
+    def addFilters(self, properties):
+        selected_properties = []
+        for p in properties :
+            if p in self.properties :
+                selected_properties.append(p)
+        self.properties = selected_properties
+        self.setId()
+
+    def setId(self):
+        if self.id in self.properties :
+            self.properties.remove(self.id)
+            [self.id].extend(self.properties)
+
+    def execute(self):
+        query = Query.delete(self.type)
+        if self.filters :
+            for k, f in self.filters.iteritems() :
+                if (f[:1] == "!") :
+                    query.filter_by(k, '!=', f[1:])
+                elif (f[:2] == ">=") :
+                    query.filter_by(k, '>=', f[2:])
+                elif (f[:1] == ">") :
+                    query.filter_by(k, '>', f[1:])
+                elif (f[:2] == "<=") :
+                    query.filter_by(k, '<=', f[2:])
+                elif (f[:1] == "<") :
+                    query.filter_by(k, '<', f[1:])
+                else :
+                    query.filter_by(k, '==', f)
+        else:
+            raise Exception, "Filters are required for delete"
+        return execute_query(self.request, query)
+
+def dispatch(request, object_type, object_name):
+    
+    o = objectRequest(request, object_type, object_name)    
+    
+    object_filters = {}
+    object_params = {}
+    result = {}
+    
+    if request.method == 'POST':
+        req_items = request.POST
+    elif request.method == 'GET':
+        #return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+        req_items = request.GET
+
+    for el in req_items.items():
+        if el[0].startswith('filters'):
+            o.filters[el[0][8:-1]] = el[1]
+        elif el[0].startswith('columns'):
+            o.addFilters(req_items.getlist('columns[]'))
+        elif el[0].startswith('options'):
+            o.options = req_items.getlist('options[]')
+
+    try:
+        response = o.execute()
+
+        if response :
+            return HttpResponse(json.dumps({'success' : 'record deleted'}), content_type="application/json")
+        else :
+            return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+    except Exception, e:
+        return HttpResponse(json.dumps({'error' : str(e)}), content_type="application/json")
+
index aeed984..da7ba0c 100644 (file)
@@ -1,21 +1,15 @@
 {% load rest_filters %}
 <thead>
 <tr>
-       {% for p in properties %}
-       <th>
-               {{ p }}
-       </th>
-       {% endfor %}
+       {% if "checkbox" in options %}<th>checkbox</th>{% endif %}
+       {% for p in properties %}<th>{{ p }}</th>{% endfor %}
 </tr>
 </thead>
 <tbody>
 {% for d in data %}
-<tr>
-       {% for p in properties %}
-       <td>
-               <div class="line1">{{ d|key:p }}</div>
-       </td>
-       {% endfor %}
+<tr id="{{ id }}">
+       {% if "checkbox" in options %}<td><input type="checkbox" name="{{ id }}" /></td>{% endif %}
+       {% for p in properties %}<td><div class="line1">{{ d|key:p }}</div></td>{% endfor %}
 </tr>
 {% endfor %}
 </tbody>
\ No newline at end of file
diff --git a/rest/update.py b/rest/update.py
new file mode 100644 (file)
index 0000000..953e786
--- /dev/null
@@ -0,0 +1,67 @@
+from manifold.core.query            import Query
+
+from django.views.generic.base      import TemplateView
+from django.shortcuts               import render_to_response
+
+from unfold.loginrequired           import LoginRequiredView
+from django.http                    import HttpResponse
+
+from manifold.core.query            import Query, AnalyzedQuery
+from manifoldapi.manifoldapi        import execute_query
+
+from string import join
+import decimal
+import datetime
+import json
+
+# handles serialization of datetime in json
+DateEncoder = lambda obj: obj.strftime("%B %d, %Y %H:%M:%S") if isinstance(obj, datetime.datetime) else None
+
+# support converting decimal in json
+json.encoder.FLOAT_REPR = lambda o: format(o, '.2f')
+
+# handles decimal numbers serialization in json
+class DecimalEncoder(json.JSONEncoder):
+    def _iterencode(self, o, markers=None):
+        if isinstance(o, decimal.Decimal):
+            return (str(o) for o in [o])
+        return super(DecimalEncoder, self)._iterencode(o, markers)
+
+def dispatch(request, object_type, object_name):
+    
+    object_filters = {}
+    object_params = {}
+    result = {}
+    
+    if request.method == 'POST':
+        req_items = request.POST.items()
+    elif request.method == 'GET':
+        return HttpResponse(json.dumps({'error' : 'only post request is supported'}), content_type="application/json")
+
+    query = Query.update(object_type)
+    
+    if object_filters :
+        for k, f in object_filters.iteritems() :
+            query.filter_by(k, '==', f)
+    
+    # DEBUG        
+    print object_filters
+    
+    if object_params :
+        query.set(object_params.iteritems())
+    else :
+        return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+    
+    # DEBUG
+    print object_params
+    
+    #result = execute_query(request, query)
+    
+    # DEBUG
+    print result
+    
+    if result :
+        return HttpResponse(json.dumps({'error' : 'an error has occurred'}), content_type="application/json")
+    else :
+        return HttpResponse(json.dumps({'success' : 'record updated'}), content_type="application/json")
+    
\ No newline at end of file
diff --git a/ui/static/img/icon_user_small.png b/ui/static/img/icon_user_small.png
new file mode 100644 (file)
index 0000000..725455e
Binary files /dev/null and b/ui/static/img/icon_user_small.png differ
diff --git a/ui/static/img/icon_users_small.png b/ui/static/img/icon_users_small.png
new file mode 100644 (file)
index 0000000..6cf3888
Binary files /dev/null and b/ui/static/img/icon_users_small.png differ
index a79c6b4..8b4e827 100644 (file)
@@ -1,6 +1,6 @@
 {# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
 <html lang="en"><head>
-<title>MySlice - {{ title }}</title>
+<title>OneLab - {{ section }}</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <link rel="shortcut icon" href="/static/img/myslice-icon.png">
 {# This is where insert_str will end up #}{% media_container prelude %}
 {% insert_str prelude "js/mustache.js" %}
 {% insert_str prelude "js/plugin.js" %}
 {% insert_str prelude "js/manifold.js" %}
-{% insert_str prelude "js/topmenu.js" %}
-{% insert_str prelude "css/layout-unfold.css" %}
 {% insert_str prelude "css/manifold.css" %}
 {% insert_str prelude "css/plugin.css" %}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/{{ theme }}.css">
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
 </head>
 <body>
 {% block container %}
        {% block topmenu %}
        {% include theme|add:"__widget-topmenu.html" %}
        {% endblock topmenu %}
-{% include 'messages-transient.html' %}
-       {% block base_content%}{% endblock %}
+       {% include 'messages-transient.html' %}
+       {% block base_content %}
+       {% endblock %}
 {% endblock container %}
 </body>
 </html>