Smartfire portal changes
authorLoic Baron <loic.baron@lip6.fr>
Fri, 20 Feb 2015 10:54:19 +0000 (11:54 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 20 Feb 2015 10:54:19 +0000 (11:54 +0100)
portal/static/css/smartfire.css
portal/static/img/bg-smartfire.png [new file with mode: 0644]
portal/templates/_widget-topmenu.html
portal/templates/account-view.html
portal/templates/home-view.html
portal/templates/slice-resource-view.html
portal/templates/smartfire/smartfire_account-view.html
portal/templates/smartfire/smartfire_home-view.html
portal/templates/smartfire/smartfire_widget-login-user.html
portal/templates/smartfire/smartfire_widget-topmenu.html

index 190924e..9f9a03a 100644 (file)
@@ -13,7 +13,7 @@ body {
 a, a:active, a:focus {
     outline: 0;
     text-decoration:none;
-    color:#760073;
+    color:#FF4400;
 }
 a:hover {
     color:#0D0049;
@@ -174,14 +174,14 @@ button.btn-danger:active {
 }
 button.btn-onelab, input.btn-onelab {
     border:0;
-    border-bottom:3px solid #760073;
-    background-color:#302562;
+    border-bottom:3px solid #FFA315;
+    background-color:#FFA315;
     color:white;
 }
 button.btn-onelab:hover, input.btn-onelab:hover {
     border:0;
-    border-bottom:3px solid #760073;
-    background-color:#302562;
+    border-bottom:3px solid #FF7E00;
+    background-color:#FF7E00;
     color:white;
 }
 button.btn-onelab:active, input.btn-onelab:active {
@@ -576,7 +576,7 @@ div.navigation li a {
     color:#0C0047;
 }
 div.navigation li a:hover, div.navigation li a.current {
-    color:#760073;
+    color:#FF4400;
     text-decoration:none;
 }
 
@@ -715,7 +715,7 @@ div.home {
     line-height:1.2em;
     letter-spacing:0.3pt;
     min-height:500px;
-    //background-image: url('../img/bg-experiment.png');
+    background-image: url('../img/bg-smartfire.png');
     background-repeat:no-repeat;
     background-size:cover;
     background-position:center top;
@@ -798,7 +798,6 @@ div.registration-form {
 div.slogan {
     text-align:center;
     color:white;
-    padding-top:60px;
     text-shadow: 1px 1px #013540;
 }
 
diff --git a/portal/static/img/bg-smartfire.png b/portal/static/img/bg-smartfire.png
new file mode 100644 (file)
index 0000000..f5340fc
Binary files /dev/null and b/portal/static/img/bg-smartfire.png differ
index 6236344..668c3d3 100644 (file)
@@ -1,51 +1,49 @@
-
-<div id="header">
-       <div class="wrapper">
-               <div class="logo">
-                       <a href="/"><img src="{{ STATIC_URL }}img/onelab-portal.png" alt="OneLab - Future Internet Testbeds" /></a>
+{% load portal_filters %}
+<div class="header">
+<div class="container">
+       <div class="row">
+               <div class="col-sm-3 col-md-3 logo">
+                       <a href="/"><img src="{{ STATIC_URL }}img/onelab-portal.png" alt="OneLab Portal - Future Internet Testbeds" /></a>
+               </div>
+               {% if username %}
+               <div class="col-sm-4 col-md-4 navigation">
+                       <ul>
+                               <li>
+                                       <a class="dropdown-toggle" data-toggle="dropdown" href="#">
+                                       EXPERIMENT <span class="caret"></span>
+                               </a>
+                                       
+                                       <div class="dropdown-menu" style="z-index:99;">
+                                                       <ul id="dropdown-slice-list">
+                                                               <li class="title"><a href="/portal/slice_request/">Request Slice</a></li>
+                                                       </ul>
+                                       </div>
+                               </li>
+                               {%if 'is_pi'  in pi %}  
+                               <li id="nav-institution" class=""><a href="/institution">MANAGEMENT</a></li>
+                                {%endif%}
+                               <li><a href="/support/">SUPPORT</a></li>
+                       </ul>
+               </div>
+               {% else %}
+               <div class="col-sm-4 col-md-4 navigation">
                </div>
-               
-               <div id="secondary">
+               {% endif %}
+               <div class="col-sm-5 col-md-5 secondary">
                        <ul>
                                <li><a href="/news">News</a></li>
-                               <li><a href="/portal/about">About</a></li>
-                               <li><a target="_blank" href="http://www.onelab.eu">Public Website</a></li>
+                               <li><a href="/about">About</a></li>
+                               <li><a target="_blank" href="https://www.onelab.eu">Public Website</a></li>
                                <li><a target="_blank" href="http://intranet.onelab.eu">Intranet</a></li>
                        </ul>
+                       {% if username %}
+                       <div class="account">You are logged in as &nbsp;<a href="/account/">{{ username }}</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</a></div>
+                       {% endif %}
                </div>
        </div>
-       
-       {% if username %}
-       <div id="navigation">
-               <div class="wrapper">
-               <ul>
-                       <li id="nav-account"><a href="/portal/account/">{{ username }}</a></li>
-                       <li>|</li>
-                       <li id="nav-institution" class=""><a href="/portal/institution">INSTITUTION</a></li>
-                       <li class="slices">
-                               <a class="dropdown-toggle" data-toggle="dropdown" href="#">
-                                       SLICES <span class="caret"></span>
-                       </a>
-                               
-                               <div class="dropdown-menu" style="z-index:99;">
-                                               <ul id="dropdown-slice-list">
-                                                       <li><a href="/portal/slice_request/">Request Slice</a></li>
-                                               </ul>
-                               </div>
-                               </li>
-                       <li id="nav-request"><a href="/portal/validate">REQUESTS</a></li>
-                       <li id="nav-support"><a href="/portal/support/">SUPPORT</a></li>
-                       <li>|</li>
-                       <li id="nav-logout" style="margin-top: 10px;"><a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> LOGOUT</a></li>
-               </ul>
-               </div>
-       </div>
-       {% else %}
-       <div id="navigation">
-               <div class="wrapper"></div>
-       </div>
-       {% endif %}
 </div>
+</div>
+
 <script>
        $(document).ready(function() {
                $('li.slices').mouseenter(function() {
index 2b99be1..985974f 100644 (file)
@@ -1,7 +1,22 @@
-{% extends "layout_wide.html" %}
+{% extends "layout.html" %}
+{% load portal_filters %}
 {% block content %}
+{% widget "_widget-no_credentials.html" %}
+{% widget "_widget-tradeoff.html" %}
+<div class="row">
+       <div class="col-md-12">
+                <div class="breadcrumbs">
+                        Account &nbsp;>&nbsp; <a href="/account">{{ person.email }}</a>
+                </div>
+       </div>
+        {%if 'no_creds' in user_cred %}
+    <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
+    {%endif%}
+        {%if 'creds_expired' in user_cred %}
+    <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
 
-
+</div>
 {% if messages %}
 <ul class="messages">
     {% for message in messages %}
     {% endfor %}
 </ul>
 {% endif %}
-<div class="container">
-       <div class="row">
-               <div class="col-md-12">
-                       <ul class="nav nav-tabs nav-section">
-                               <li class="active"><a href="#profile"><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Account" /> User Profile</a></li>
-                               <li><a href="#account">Account</a></li>
-                               <li><a href="#access">Testbed Access</a></li>
-                       </ul>
-           </div>
-       </div>
+
+<form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
+<input type="hidden" id="button_value"  name="button_value" value="" />
+
+<div class="row">
+       <div class="col-md-12">
+               <ul class="nav nav-tabs nav-section">
+                       <li class="active"><a href="#profile">User Profile</a></li>
+                       <li><a href="#account">Account</a></li>
+                       <li><a href="#access">Testbed Access</a></li>
+               </ul>
+    </div>
 </div>
-<div class="container tab-content">
+<div class="tab-content">
        <div class="tab-pane active row" id="profile">
                
                <div class="col-md-12">
 
-                       <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
                                {% csrf_token %}
                                        <table class="profile">          
                                        <tr>
@@ -37,7 +53,7 @@
                                                <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" type="button" id="edit_email" onclick="editAlert();"  title="To change your affiliation please contact the administrator">
                                                                <span class="glyphicon glyphicon-question-sign"></span> Edit
                                                                </button>
                                                        </td>
                                                <tr class="even">
                                                        <td class="key">Generate Keys</td>
                                                        <td>
-                                                               <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
+                                                               <input type="submit" name="generate" class="btn btn-primary" 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> 
                                                <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>
+                                                                       <button type="button" class="btn btn-default" 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"/>  
                                                                                   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">
+                                                               <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_pubkey" onclick="javascript:document.getElementById('button_value').value='dl_pubkey';">
                                                                        <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">
                                                 {%if 'N/A' not in user_private_key%}
                                                <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey" value="dl_pkey" onclick="javascript:document.getElementById('button_value').value='dl_pkey';">
                                                                        <span class="glyphicon glyphicon-download"></span> Download     
                                                                </button>
                                                        <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
-                                                                               onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
+                                                                               onclick="javascript:document.getElementById('button_value').value='delete'; return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
                                                </td>
                                                  {%else%}
                                                        <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                        <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey" value="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" />
                                        <tr class="even" id="sfi_config_row">
                                                <td class="key">sfi_config </td>
                                                <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
-                                                       <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_sfi_config">
-                                                                       <span class="glyphicon glyphicon-download"></span> Download 
+                                                       <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your sfi_config" id="dl_sfi_config" value="dl_sfi_config" onclick="javascript:document.getElementById('button_value').value='dl_sfi_config';">
+                                                                       <span class="glyphicon glyphicon-download"></span> Download
                                                                </button>
                                                </td>
                         </tr>
+                                               <tr class="odd">
+                                                       {%if 'N/A' not in user_private_key%}
+                                                       <td class="key">Identity</td> 
+                                               <td>
+                                                               <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it to use jfed" id="dl_identity" onclick="javascript:document.getElementById('button_value').value='dl_identity';">
+                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                                               </button>
+                                                       </td>
+                                                       {%else%}
+                                                       <td class="key">Identity</td> 
+                                                       <td>
+                                                       <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
+                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                                       </button>
+                                                       </td>
+                                                       {%endif%} 
+                                               </tr>
+
                                                <tr class="even">
                                                <td colspan="2">
-                                                       <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
-                                                                       <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
-                                                                       <b>Security:</b> Manual account delegation. Download & Delete private key.
+                                                               <p class="command">
+                                                                       <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
+                                                                       Trade-off between ease-of-use & security</p>
                                                                </p>
                                                </td>
                                                </tr>
                </table>
        
                </div>
-       
 
        {%if 'Enabled'  in user_status %}
                <div class="col-md-12">
                <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> Credential
-                                                       </button>
-                                                       <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
-                                                               <span class="glyphicon glyphicon-download"></span> Certificate
-                                                       </button>
-                             <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
-                                 <span class="glyphicon glyphicon-download"></span> PKCS p12
-                             </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%}
+                   <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" onclick="javascript:document.getElementById('button_value').value='dl_user_cred';">
+                                                       <span class="glyphicon glyphicon-download"></span> Credential
+                                               </button>
+                                               <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate" onclick="javascript:document.getElementById('button_value').value='dl_user_cert';">
+                                                       <span class="glyphicon glyphicon-download"></span> Certificate
+                                               </button>
+                         <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12" onclick="javascript:document.getElementById('button_value').value='dl_user_p12';">
+                             <span class="glyphicon glyphicon-download"></span> PKCS p12
+                         </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" onclick="javascript:document.getElementById('button_value').value='dl_{{row.slice_name}}';">
+                                                       <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" onclick="javascript:document.getElementById('button_value').value='dl_{{row.auth_name}}';">
+                                                       <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" onclick="javascript:document.getElementById('button_value').value='clear_cred';">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="tab-pane row" id="access">
                <div class="col-md-12">
        
                 <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">
+                               <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform" onclick="javascript:document.getElementById('button_value').value='delete_{{row.platform_name}}';">
                                                <span class="glyphicon glyphicon-minus"></span>
                                        </button>
                                </td>
             <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">
+                                       <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform" onclick="javascript:document.getElementById('button_value').value='add_{{platform.platform_no_access}}';">
                                                <span class="glyphicon glyphicon-plus"></span>
                                        </button>
                                </td>
        </div>
 {%endif%} 
 </div>
-</form>
 </div>
 
+</form>
 <script>
     $(document).ready(function() {
+           {%if 'no_creds' in user_cred or 'creds_expired' in user_cred %}
+        localStorage.clear();
+        $.post("/cache/clear/", function( data ) {
+        });
+        {% endif %}
        $('.nav-tabs a').click(function (e) {
                        e.preventDefault();
                        $(this).tab('show');
                        id = $(this).attr('href').substr(1);
-               
                });
                
         $('button#createslice').click(function() {
index 383aa95..379547c 100644 (file)
-{% extends "layout.html" %}
+{% extends "layout_base.html" %}
 {% load portal_filters %}
 
 {% block content %}
-<div class="row">
+<!-- <div class="row">
 {% widget '_widget-news.html' %}
-</div>
-<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>
-                                       {% widget '_widget-login-user.html' %}
-                               {% endif %}
-                               </td>
-                               <td>
-                               {% if person %}
-                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
-                                       <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
-                               {% else %}
-                                       <button id="signupbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> Sign Up</button>
+</div> -->
+{% if username %}
+{% widget "_widget-no_credentials.html" %}
+<div class="container dashboard">
+       {%if 'no_creds'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
+    {%endif%}
+       {%if 'creds_expired'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
+
+       <div class="row">
+               {% if pi %}
+               <div class="col-md-3">
+                       <h3>
+                               EXPERIMENT
+                       </h3>
+                       <div>
+                               <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
+                       </div>
+                       <div>
+                               <p><strong>Your slices </strong>
+                                       <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
+                                       Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
+                                       However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
+                                       such as on the PlanetLab Europe portal, those slices will not appear here."
+                                       class="glyphicon glyphicon-info-sign">
+                               </span>
+
+                               </p>
+                       </div>
+                       <div>   
+                               <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+                       </div>
+               </div>
+               <div class="col-md-3">
+                       <h3>MANAGEMENT</h3>
+                       <div>
+                               <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+                       </div>
+               </div>
+               <div class="col-md-3">
+                       <h3>
+                               SUPPORT
+                       </h3>
+                       <div>
+                               <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
+                       </div>
+               </div>
+               
+               <div class="col-md-3">
+                       <h3>
+                               ACCOUNT
+                       </h3>
+                       <div>
+                               <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                       </div>
+                       <div>
+                               {% if person.last_name %}
+                                       {{person.first_name}} {{person.last_name}}<br />
                                {% endif %}
-                               </td>
-                               <td class="support">
-                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
-                               </td>
-                       </tr>
-               </table>
+                       <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
+               </div>
+               </div>
        </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>
-                                       {% widget '_widget-login-manager.html' %}
+       {%else%}
+       <div class="row">
+               <div class="col-md-4">
+                       <h3>
+                               EXPERIMENT
+                       </h3>
+                       <div>
+                               <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+                       </div>
+                       <div>
+                               <p><strong>Your slices </strong>
+                               <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
+                                       Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
+                                       However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
+                                       such as on the PlanetLab Europe portal, those slices will not appear here."
+                                       class="glyphicon glyphicon-info-sign">
+                               </span>
+                               </p>
+                       </div>
+                       <div>   
+                               <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+                       </div>
+                       {% if pending_slices %}
+                       <p><strong>Pending slices</strong>
+                       <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
+                               class="glyphicon glyphicon-info-sign">
+                       <ul>
+                       {% for slices in pending_slices %}
+                       <li>{{slices}}</li>
+                       {% endfor %}
+                       </ul>
+                       </span>
+                       </p>
+                       {%endif%}       
+               </div>
+               <div class="col-md-4">
+                       <h3>
+                               SUPPORT
+                       </h3>
+                       <div>
+                               <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
+                       </div>
+               </div>
+               
+               <div class="col-md-4">
+                       <h3>
+                               ACCOUNT
+                       </h3>
+                       <div>
+                               <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
+                       </div>
+                       <div>
+                               <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                       </div>
+                       <div>
+                               {% if person.last_name %}
+                                       {{person.first_name}} {{person.last_name}}<br />
                                {% 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>
+                       <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
+               </div>
+               </div>
        </div>
+       {%endif%}
+
 </div>
+{% else %}
+<div class="container-fluid home">
+       <div class="">
+               <div class="col-sm-2"></div>
+               <div class="col-sm-4 slogan">
+                       <h2>
+                               Your Easy Access to Computer Networking Testbeds:
+                       </h2>
+                       <h3>
+                               A wide variety of world class testbeds available through your one account
+                       </h3>
+               </div>
+               <div class="col-sm-5 col-sm-offset-1">
+                       <div class="row">
+                               {% widget '_widget-login-user.html' %}
+                       </div>
+               </div>
+               <div class="col-sm-1"></div>
+       </div>
+</div>
+{% endif %}
+
+
 <script type="text/javascript">
        $(document).ready(function() {
                $('a.home-tab').click(function() {
                        $('div#'+$(this).data('panel')).show();
                });
                $('button#validaterequestbtn').click(function() {
-                       window.location="/portal/validate/";
+                       window.location="/portal/institution#requests";
                });
                $('button#ticketbtn').click(function() {
                        window.location="/portal/contact/";
                $('button#slicerequestbtn').click(function() {
                        window.location="/portal/slice_request/";
                });
-/*-------
-List of slices has been moved in 
-portal/templates/base.html
-This should go into session
---------*/
+
+        myslice.loadSlices();
+        
 });
 </script>
+
 {% endblock %}
index 93285e1..3fefedf 100644 (file)
@@ -54,9 +54,7 @@ $(document).ready(function() {
                        <ul class="nav nav-tabs">
                          <li class="active"><a href="#resourcelist" role="tab" data-toggle="tab">Table</a></li>
                          <li> <a href="#resourcemap" role="tab" data-toggle="tab">Map</a></li>
-              <!-- <li> <a href="#openflowcontroller" role="tab" data-toggle="tab">OpenFlow Controller</a></li>
-              <li> <a href="#resourceflowspace" role="tab" data-toggle="tab">Flowspace</a></li>
-                         <li> <a href="#resourcescheduler" role="tab" data-toggle="tab">Scheduler</a></li> -->
+                         <li> <a href="#resourcescheduler" role="tab" data-toggle="tab">Scheduler</a></li>
                        </ul>
                        </div>
                </div>
@@ -92,24 +90,6 @@ $(document).ready(function() {
                                <div class="tab-pane" id="resourcemap">
                        {{map_resources}}
                                </div>
-                <div class="tab-pane" id="openflowcontroller">
-                    <p>{{vms_list}}</p>
-                    <p>{{vm_form}}</p>
-
-                    <p>{{below_table}}</p>
-                </div>
-
-                <div class="tab-pane" id="resourceflowspace">
-                    <p>{{welcome}}</p>
-                    <p>{{flowspaces}}</p>
-                    <p>{{flowspaces_form}}</p>
-                    <p>{{oflowspaces_form}}</p>
-                    <p>{{topology}}</p>
-                    <p>{{resources}}</p>
-
-                    <p>{{below_table}}</p>
-                </div>
-
                                <div class="tab-pane" id="resourcescheduler">
                        {{scheduler}}
                                </div>
index 199444a..985974f 100644 (file)
@@ -1,15 +1,20 @@
 {% extends "layout.html" %}
+{% load portal_filters %}
 {% block content %}
-
+{% widget "_widget-no_credentials.html" %}
+{% widget "_widget-tradeoff.html" %}
 <div class="row">
        <div class="col-md-12">
                 <div class="breadcrumbs">
                         Account &nbsp;>&nbsp; <a href="/account">{{ person.email }}</a>
                 </div>
        </div>
-        {%if 'no_creds'  in user_cred %}
+        {%if 'no_creds' in user_cred %}
     <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
-{%endif%}
+    {%endif%}
+        {%if 'creds_expired' in user_cred %}
+    <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
 
 </div>
 {% if messages %}
     {% endfor %}
 </ul>
 {% endif %}
+
+<form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
+<input type="hidden" id="button_value"  name="button_value" value="" />
+
 <div class="row">
        <div class="col-md-12">
                <ul class="nav nav-tabs nav-section">
@@ -33,7 +42,6 @@
                
                <div class="col-md-12">
 
-                       <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
                                {% csrf_token %}
                                        <table class="profile">          
                                        <tr>
                                                                                   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">
+                                                               <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_pubkey" onclick="javascript:document.getElementById('button_value').value='dl_pubkey';">
                                                                        <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">
                                                 {%if 'N/A' not in user_private_key%}
                                                <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey" value="dl_pkey" onclick="javascript:document.getElementById('button_value').value='dl_pkey';">
                                                                        <span class="glyphicon glyphicon-download"></span> Download     
                                                                </button>
                                                        <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
-                                                                               onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
+                                                                               onclick="javascript:document.getElementById('button_value').value='delete'; return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
                                                </td>
                                                  {%else%}
                                                        <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                        <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey" value="dl_pkey">
                                                                <span class="glyphicon glyphicon-download"></span> Download 
                                                        </button>
                                                        <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
                                                        </td>
                                                 {%endif%}              
                                                </tr>
+                                       <tr class="even" id="sfi_config_row">
+                                               <td class="key">sfi_config </td>
+                                               <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
+                                                       <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your sfi_config" id="dl_sfi_config" value="dl_sfi_config" onclick="javascript:document.getElementById('button_value').value='dl_sfi_config';">
+                                                                       <span class="glyphicon glyphicon-download"></span> Download
+                                                               </button>
+                                               </td>
+                        </tr>
+                                               <tr class="odd">
+                                                       {%if 'N/A' not in user_private_key%}
+                                                       <td class="key">Identity</td> 
+                                               <td>
+                                                               <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it to use jfed" id="dl_identity" onclick="javascript:document.getElementById('button_value').value='dl_identity';">
+                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                                               </button>
+                                                       </td>
+                                                       {%else%}
+                                                       <td class="key">Identity</td> 
+                                                       <td>
+                                                       <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
+                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                                       </button>
+                                                       </td>
+                                                       {%endif%} 
+                                               </tr>
+
                                                <tr class="even">
                                                <td colspan="2">
-                                                       <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
-                                                                       <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
-                                                                       <b>Security:</b> Manual account delegation. Download & Delete private key.
+                                                               <p class="command">
+                                                                       <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
+                                                                       Trade-off between ease-of-use & security</p>
                                                                </p>
                                                </td>
                                                </tr>
                </table>
        
                </div>
-       
 
        {%if 'Enabled'  in user_status %}
                <div class="col-md-12">
                <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> Credential
-                                                       </button>
-                                                       <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
-                                                               <span class="glyphicon glyphicon-download"></span> Certificate
-                                                       </button>
-                             <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
-                                 <span class="glyphicon glyphicon-download"></span> PKCS p12
-                             </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%}
+                   <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" onclick="javascript:document.getElementById('button_value').value='dl_user_cred';">
+                                                       <span class="glyphicon glyphicon-download"></span> Credential
+                                               </button>
+                                               <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate" onclick="javascript:document.getElementById('button_value').value='dl_user_cert';">
+                                                       <span class="glyphicon glyphicon-download"></span> Certificate
+                                               </button>
+                         <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12" onclick="javascript:document.getElementById('button_value').value='dl_user_p12';">
+                             <span class="glyphicon glyphicon-download"></span> PKCS p12
+                         </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" onclick="javascript:document.getElementById('button_value').value='dl_{{row.slice_name}}';">
+                                                       <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" onclick="javascript:document.getElementById('button_value').value='dl_{{row.auth_name}}';">
+                                                       <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" onclick="javascript:document.getElementById('button_value').value='clear_cred';">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>
-<!-- Modal- No credentials -->
-<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-            <div class="modal-dialog">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-                            <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
-                    </div>
-                    <div class="modal-body">
-                                       <p>You may get this message for several reasons.</p>
-                                       <h3>Account Delegation: Automatic</h3>
-                                       <ul>
-                                               <li>If your account is not yet validated</li>
-                                               <li>If you press the "Clear Credentials" button</li>
-                                               <li>If you "Generate a new key pair"</li>
-                                               <li>If a new slice is added to your account</li>
-                                       </ul>
-                                       <p>In all the above mentioned cases, it is sufficient to refresh the page or go back to home page. The portal will regenrate your credentials.
-                                        In some cases it may take more time than usual. If nothing works, then please logout and login again to the portal.</p>
-                                       <h3>Account Delegation: Manual</h3>
-                                               <p>First of all your account needs to be validated by the manager of your organization.</p>
-                                               <p>As you have uploaded your own public key, the portal can no longer generate your credentials automatically.</p>
-                                               <p>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
-                                               <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a>
-                                       </p>
-                                       <h5>Contact support</h5>
-                                       <p>If you don't have the above mentioned cases and still have this message, please  <a href="/contact/" target="_blank">contact us</a>.</p>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-                    </div>
-                </div>
-            </div>
-</div>
 
 
        <div class="tab-pane row" id="access">
                 <td class="odd"> {{ row.account_type }} </td>
                                <td class="odd"> {{ row.account_reference }} </td>
                                <td class="odd">
-                               <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
+                               <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform" onclick="javascript:document.getElementById('button_value').value='delete_{{row.platform_name}}';">
                                                <span class="glyphicon glyphicon-minus"></span>
                                        </button>
                                </td>
             <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">
+                                       <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform" onclick="javascript:document.getElementById('button_value').value='add_{{platform.platform_no_access}}';">
                                                <span class="glyphicon glyphicon-plus"></span>
                                        </button>
                                </td>
        </div>
 {%endif%} 
 </div>
-</form>
 </div>
 
+</form>
 <script>
     $(document).ready(function() {
+           {%if 'no_creds' in user_cred or 'creds_expired' in user_cred %}
+        localStorage.clear();
+        $.post("/cache/clear/", function( data ) {
+        });
+        {% endif %}
        $('.nav-tabs a').click(function (e) {
                        e.preventDefault();
                        $(this).tab('show');
                        id = $(this).attr('href').substr(1);
-               
                });
                
         $('button#createslice').click(function() {
index 8236fc5..379547c 100644 (file)
@@ -6,9 +6,17 @@
 {% widget '_widget-news.html' %}
 </div> -->
 {% if username %}
+{% widget "_widget-no_credentials.html" %}
 <div class="container dashboard">
+       {%if 'no_creds'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
+    {%endif%}
+       {%if 'creds_expired'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
+
        <div class="row">
-               {%if 'is_pi'  in pi %}
+               {% if pi %}
                <div class="col-md-3">
                        <h3>
                                EXPERIMENT
                        <div>   
                                <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
                        </div>
+                       {% if pending_slices %}
+                       <p><strong>Pending slices</strong>
+                       <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
+                               class="glyphicon glyphicon-info-sign">
+                       <ul>
+                       {% for slices in pending_slices %}
+                       <li>{{slices}}</li>
+                       {% endfor %}
+                       </ul>
+                       </span>
+                       </p>
+                       {%endif%}       
                </div>
                <div class="col-md-4">
                        <h3>
                <div class="col-sm-2"></div>
                <div class="col-sm-4 slogan">
                        <h2>
-                               SmartFIRE
+                               Your Easy Access to Computer Networking Testbeds:
                        </h2>
                        <h3>
-                               EU-South Korea Cooperation<br>
-                               On Future Internet Infrastructure
+                               A wide variety of world class testbeds available through your one account
                        </h3>
                </div>
                <div class="col-sm-5 col-sm-offset-1">
                $('button#slicerequestbtn').click(function() {
                        window.location="/portal/slice_request/";
                });
-/*-------
-List of slices has been moved in 
-portal/templates/base.html
-This should go into session
---------*/
+
+        myslice.loadSlices();
+        
 });
 </script>
-{# widget "_widget-monitor.html" #}
-{# widget "_widget-stats-top-slices.html" #}
 
 {% endblock %}
index 7529c61..eaa5c2a 100644 (file)
        <div class="login-submit">
                <input type="submit" class="btn btn-onelab" value="Sign In" />
                <span class="lost-password">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="/portal/pass_reset/">Can't access your account?</a></span>
-       </div>
-       <div class="login-signup">
-               <!-- You don't have yet an account? 
-               
-               <a href="/register">Sign Up!</a> -->
+       <p></p>
+       <p style="color:white;">Don't have an account? <a href="/register">Sign Up!</a></p>
        </div>
        </form>
 </div>
index 738075f..de34e32 100644 (file)
@@ -19,7 +19,7 @@
                                                        </ul>
                                        </div>
                                </li>
-                               {%if 'is_pi'  in pi %}  
+                               {%if pi %}      
                                <li id="nav-institution" class=""><a href="/institution">MANAGEMENT</a></li>
                                 {%endif%}
                                <li><a href="/support/">SUPPORT</a></li>