Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorLoic Baron <loic.baron@lip6.fr>
Wed, 2 Apr 2014 10:42:43 +0000 (12:42 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Wed, 2 Apr 2014 10:42:43 +0000 (12:42 +0200)
Conflicts:
portal/templates/base.html

auth/manifoldbackend.py
plugins/googlemap/static/js/googlemap.js
plugins/querytable/static/js/querytable.js
portal/sliceresourceview.py
portal/templates/_widget-topmenu.html
portal/templates/base.html
portal/templates/fed4fire/fed4fire_home-view.html [deleted file]
portal/templates/fed4fire/fed4fire_widget-topmenu.html
portal/templates/home-view.html
portal/templates/onelab/onelab_home-view.html [deleted file]
portal/templates/onelab/onelab_widget-topmenu.html

index eb87ab8..afb8782 100644 (file)
@@ -61,9 +61,13 @@ class ManifoldBackend:
         except User.DoesNotExist:
             # Create a user in Django's local database
             user = User.objects.create_user(username, username, 'passworddoesntmatter')
-            user.first_name = "DUMMY_FIRST_NAME" #person['first_name']
-            user.last_name = "DUMMY LAST NAME" # person['last_name']
             user.email = person['email']
+
+        if 'firstname' in person:
+            user.first_name = person['firstname']
+        if 'lastname' in person:
+            user.last_name = person['lastname']
+
         return user
 
     # Required for your backend to work properly - unchanged in most scenarios
index 6db222d..8a740b2 100644 (file)
@@ -94,6 +94,8 @@
             //create empty LatLngBounds object in order to automatically center the map on the displayed objects
             this.bounds = new google.maps.LatLngBounds();
             var center = new google.maps.LatLng(this.options.latitude, this.options.longitude);
+
+            console.log("GoogleMap zoom = "+this.options.zoom);
             var myOptions = {
                 zoom: this.options.zoom,
                 center: center,
index 375aa8f..c2f0d55 100644 (file)
             });
             $(".dataTables_filter").append("<div style='display:inline-block;height:27px;width:27px;padding-left:6px;padding-top:4px;'><span class='glyphicon glyphicon-search'></span></div>");
             $(".dataTables_filter input").css("width","100%");
-            $(".columns_selector").append("columns");
-            $(".columns_selector").css("float","right");
-            $(".columns_selector").css("width","inherit");
         }, // initialize_table
 
         /**
index 254e2fd..6883765 100644 (file)
@@ -143,7 +143,7 @@ class SliceResourceView (LoginRequiredView, ThemeView):
             # center on Paris
             latitude   = 49.,
             longitude  = 9,
-            zoom       = 4,
+            zoom       = 8,
         )
 
         # --------------------------------------------------------------------------
index 4ed429a..cf81029 100644 (file)
                        </a>
                                
                                <div class="dropdown-menu" style="z-index:99;">
-                                               <ul>
+                                               <ul id="dropdown-slice-list">
                                                        <li><a href="/portal/slice_request/">Request Slice</a></li>
-                                                       <li><a href="/slice/ple.upmc.agent3/">ple.upmc.agent3</a></li>
-                                                   <li><a href="/slice/ple.upmc.agent/">ple.upmc.agent</a></li>
-                                                   <li><a href="/slice/ple.upmc.myslicedemo/">ple.upmc.myslicedemo</a></li>
-                                                   <li><a href="/slice/ple.upmc.slicestat/">ple.upmc.slicestat</a></li>
-                                                   <li><a href="/slice/ple.upmc.agent2/">ple.upmc.agent2</a></li>
                                                </ul>
                                </div>
                                </li>
index e739316..6bb7e23 100644 (file)
@@ -1,7 +1,7 @@
 {% load portal_filters %}
 {# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
 <html lang="en"><head>
-<title>OneLab Portal - {{ section }}</title>
+<title>{{theme}} portal - {{ section }}</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <link rel="shortcut icon" href="/static/img/favicon.ico">
 {# This is where insert_str will end up #}{% media_container prelude %}
 {% insert_str prelude "css/topmenu.css" %}
 {% insert_str prelude "js/logout.js" %}
 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
+
+<script type="text/javascript">
+/*
+XXX TODO: session
+This list of slices should go into SESSION !
+*/
+$(document).ready(function() {
+
+    user = myslice.user();
+    if(user.length>0){
+       $.each( user.slices, function(i, val) {
+               items.push( "<li><a href=\"/slice/"+val+"\">" + val + "</a></li>" );
+       });
+       $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+       $("ul#dropdown-slice-list").append(items.join( "" ));
+    }
+       {% if person %}
+    $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+         var items = [];
+      if(data.length > 0){
+                 $.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( "" ) }));
+                 $("ul#dropdown-slice-list").append(items.join( "" ));
+         }else{
+                 $("div#home-slice-list").html("no slice");
+      } 
+       });
+       {% endif %}
+});
+</script>
 </head>
 <body>
 {% block container %}
diff --git a/portal/templates/fed4fire/fed4fire_home-view.html b/portal/templates/fed4fire/fed4fire_home-view.html
deleted file mode 100644 (file)
index f7da2da..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-{% extends "layout.html" %}
-
-{% 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>
-       </ul>
-       <div class="home-panel" id="user">
-               <table>
-                       <tr>
-                               <td>ACCOUNT</td>
-                               <td>SLICES</td>
-                               <td>SUPPORT</td>
-                       </tr>
-                       <tr>
-                               <td><a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a></td>
-                               <td><a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
-                               <td><a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a></td>
-                       </tr>
-                       <tr>
-                               {% if person %}
-                               <td class="logged-in">
-                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
-                                       <div>
-                                       {% if person.last_name %}
-                                               {{person.first_name}} {{person.last_name}}<br />
-                                       {% endif %}
-                                       <span class="label">Email:</span> <a href='/portal/account/'>{{person.email}}</a>
-                               </div>
-                               {% else %}
-                               <td>
-                                       {% include '_widget-login-user.html' %}
-                               {% endif %}
-                               </td>
-                               <td>
-                               {% if person %}
-                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
-                                       <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-                               {% else %}
-                               {% endif %}
-                               </td>
-                               <td class="support">
-                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
-                                       <div>
-                                               <a href="/portal/contact">Contact</a> <br />
-                                               <a href="/portal/support/documentation">Documentation</a>
-                                       </div>
-                               </td>
-                       </tr>
-               </table>
-       </div>
-       <div class="home-panel" id="manager">
-               <table>
-                       <tr>
-                               <td>INSTITUTION</td>
-                               <td>SLICES</td>
-                               <td>REQUESTS</td>
-                       </tr>
-                       <tr>
-                               <td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
-                               <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
-                               <td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
-                       </tr>
-                       <tr>
-                               {% if person %}
-                               <td class="logged-in">
-                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
-                               {% else %}
-                               <td>
-                                       {% include '_widget-login-manager.html' %}
-                               {% endif %}
-                               </td>
-                               <td>
-                                       {% if person %}
-                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
-                                       {% endif %}
-                               </td>
-                               <td class="support">
-                                       {% if person %}
-                                   <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
-                                       {% endif %}
-                               </td>
-                       </tr>
-               </table>
-       </div>
-</div>
-<script>
-       $(document).ready(function() {
-               $('a.home-tab').click(function() {
-                       $('ul.nav-tabs li').removeClass('active');
-                       $(this).parent().addClass('active');
-                       $('div.home-panel').hide();
-                       $('div#'+$(this).data('panel')).show();
-               });
-               $('button#validaterequestbtn').click(function() {
-                       window.location="/portal/validate/";
-               });
-               $('button#ticketbtn').click(function() {
-                       window.location="/portal/contact/";
-               });
-               $('button#slicerequestbtn').click(function() {
-                       window.location="/portal/slice_request/";
-               });
-               
-               {% if person %}
-        $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
-                 var items = [];
-          if(data.length > 0){
-                   $.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( "" ) }));
-                 }else{
-                   $("div#home-slice-list").html("no slice");
-          }
-               });
-               {% endif %}
-       });
-</script>
-{% endblock %}
index 865a2bc..74edfdc 100644 (file)
@@ -27,7 +27,7 @@
                        </a>
                                
                                <div class="dropdown-menu" style="z-index:99;">
-                                               <ul>
+                                               <ul id="dropdown-slice-list">
                                                        <li><a href="/portal/slice_request/">Request Slice</a></li>
                             <!--
                                                        <li><a href="/slice/ple.upmc.agent3/">ple.upmc.agent3</a></li>
index d7b3c33..93e1f15 100644 (file)
                </table>
        </div>
 </div>
-<script>
+<script type="text/javascript">
        $(document).ready(function() {
+        {% if person %}
+        myslice.login();
+        {% endif %}
+
                $('a.home-tab').click(function() {
                        $('ul.nav-tabs li').removeClass('active');
                        $(this).parent().addClass('active');
                $('button#slicerequestbtn').click(function() {
                        window.location="/portal/slice_request/";
                });
-               
-               {% if person %}
-        $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
-                 var items = [];
-          if(data.length > 0){
-                 $.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( "" ) }));
-                 }else{
-                 $("div#home-slice-list").html("no slice");
-          } 
-               });
-               {% endif %}
-       });
+/*-------
+List of slices has been moved in 
+portal/templates/base.html
+This should go into session
+--------*/
+});
 </script>
 {% endblock %}
diff --git a/portal/templates/onelab/onelab_home-view.html b/portal/templates/onelab/onelab_home-view.html
deleted file mode 100644 (file)
index 090f66b..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-{% extends "layout.html" %}
-
-{% 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>
-       </ul>
-       <div class="home-panel" id="user">
-               <table>
-                       <tr>
-                               <td>ACCOUNT</td>
-                               <td>SLICES</td>
-                               <td>SUPPORT</td>
-                       </tr>
-                       <tr>
-                               <td><a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a></td>
-                               <td><a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
-                               <td><a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a></td>
-                       </tr>
-                       <tr>
-                               {% if person %}
-                               <td class="logged-in">
-                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
-                                       <div>
-                                       {% if person.last_name %}
-                                               {{person.first_name}} {{person.last_name}}<br />
-                                       {% endif %}
-                                       <span class="label">Email:</span> <a href='/portal/account/'>{{person.email}}</a>
-                               </div>
-                               {% else %}
-                               <td>
-                                       {% include 'onelab__widget-login-user.html' %}
-                               {% endif %}
-                               </td>
-                               <td>
-                               {% if person %}
-                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
-                                       <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-                               {% else %}
-                               {% endif %}
-                               </td>
-                               <td class="support">
-                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
-                                       <div>
-                                               <a href="/portal/contact">Contact</a> <br />
-                                               <a href="/portal/support/documentation">Documentation</a>
-                                       </div>
-                               </td>
-                       </tr>
-               </table>
-       </div>
-       <div class="home-panel" id="manager">
-               <table>
-                       <tr>
-                               <td>INSTITUTION</td>
-                               <td>SLICES</td>
-                               <td>REQUESTS</td>
-                       </tr>
-                       <tr>
-                               <td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
-                               <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
-                               <td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
-                       </tr>
-                       <tr>
-                               {% if person %}
-                               <td class="logged-in">
-                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
-                               {% else %}
-                               <td>
-                                       {% include 'onelab__widget-login-manager.html' %}
-                               {% endif %}
-                               </td>
-                               <td>
-                                       {% if person %}
-                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
-                                       {% endif %}
-                               </td>
-                               <td class="support">
-                                       {% if person %}
-                                   <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
-                                       {% endif %}
-                               </td>
-                       </tr>
-               </table>
-       </div>
-</div>
-<script>
-       $(document).ready(function() {
-               $('a.home-tab').click(function() {
-                       $('ul.nav-tabs li').removeClass('active');
-                       $(this).parent().addClass('active');
-                       $('div.home-panel').hide();
-                       $('div#'+$(this).data('panel')).show();
-               });
-               $('button#validaterequestbtn').click(function() {
-                       window.location="/portal/validate/";
-               });
-               $('button#ticketbtn').click(function() {
-                       window.location="/portal/contact/";
-               });
-               $('button#slicerequestbtn').click(function() {
-                       window.location="/portal/slice_request/";
-               });
-               
-               {% if person %}
-        $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
-                 var items = [];
-          if(data.length > 0){
-                   $.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( "" ) }));
-                 }else{
-                   $("div#home-slice-list").html("no slice");
-          }
-               });
-               {% endif %}
-       });
-</script>
-{% endblock %}
index 4ed429a..cf81029 100644 (file)
                        </a>
                                
                                <div class="dropdown-menu" style="z-index:99;">
-                                               <ul>
+                                               <ul id="dropdown-slice-list">
                                                        <li><a href="/portal/slice_request/">Request Slice</a></li>
-                                                       <li><a href="/slice/ple.upmc.agent3/">ple.upmc.agent3</a></li>
-                                                   <li><a href="/slice/ple.upmc.agent/">ple.upmc.agent</a></li>
-                                                   <li><a href="/slice/ple.upmc.myslicedemo/">ple.upmc.myslicedemo</a></li>
-                                                   <li><a href="/slice/ple.upmc.slicestat/">ple.upmc.slicestat</a></li>
-                                                   <li><a href="/slice/ple.upmc.agent2/">ple.upmc.agent2</a></li>
                                                </ul>
                                </div>
                                </li>