--- /dev/null
+{% extends "layout.html" %}
+{% block content %}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="breadcrumbs">
+ Account > <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%}
+
+</div>
+{% if messages %}
+<ul class="messages">
+ {% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+ {% endfor %}
+</ul>
+{% endif %}
+<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="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>
+ <td colspan="2">
+ <div><h3>Platform: Myslice</h3></div>
+ </td>
+ </tr>
+ <tr>
+ <td class="key">Email</td>
+ <td class="value">
+ <span id="emailval" class="value" >{{ person.email }}</span>
+ <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
+ <span class="glyphicon glyphicon-question-sign"></span> Edit
+ </button>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="key">Password</td>
+ <td class="value">
+ <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
+ <span class="glyphicon glyphicon-edit"></span> Edit
+ </button>
+ <span id="passval"class="value">******** </span>
+ <span class="hide_this" id="span_pass">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
+ <div style='display:none;' id="pass_form">
+ <input type='hidden' value='' /></div>
+ <table id="edit_password">
+ <tr>
+ <td>Enter password: </td>
+ <td class="field"> <input type="password" name="password" id="password" /> </td>
+ </tr>
+ <tr>
+ <td>Confirm password: </td>
+ <td class="field">
+ <input type="password" name="confirmpassword" id="confirmpassword" />
+ <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
+ </td>
+ </tr>
+ </table>
+ </span>
+ </td>
+ </tr>
+ <tr class="even">
+ <td class="key">Full Name</td>
+ <td class="value">
+ <span id="nameval" class="value" >{{ fullname }} </span>
+ <span class="hide_this" id="span_name">
+ <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
+ <div style='display:none;'><input type='hidden' name='nameform' /></div>
+ <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
+ <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
+ <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
+ </span>
+ <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
+ <span class="glyphicon glyphicon-edit"></span> Edit
+ </button>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="key">Authority</td>
+ <td class="value">
+ <span id="affval" class="value">{{ authority }}</span>
+ <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
+ <span class="glyphicon glyphicon-question-sign"></span> Edit
+ </button>
+ </td>
+ </tr>
+ {%if 'Enabled' in user_status %}
+ <tr class="even">
+ <td class="key">Generate Keys</td>
+ <td>
+ <input type="submit" name="generate" class="btn btn-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>
+ </tr>
+ <tr class="odd">
+ <td class="key">Public Key</td>
+ <td class="value">
+ <span id="keyval" class="value">******** </span>
+ <span class="hide_this" id="span_upload">
+ <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
+ <div style='display:none;'>
+ <input type='hidden' name='upload' /></div>
+ <input type="file" name="pubkey" class="required" id="pubkey"/>
+ <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
+ onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
+ </span>
+ <div style='display:none;'> <input type='hidden' name='dload' /> </div>
+ <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
+ <span class="glyphicon glyphicon-upload"></span> Upload
+ </button>
+ </td>
+ </tr>
+ <tr class="even" id="pkey_row">
+ {%if 'N/A' not in user_private_key%}
+ <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
+ <td class="value">********<a href="#"></a>
+ <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
+ onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
+ </td>
+ {%else%}
+ <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
+ <td class="value">********<a href="#"></a>
+ <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey">
+ <span class="glyphicon glyphicon-download"></span> Download
+ </button>
+ <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
+ </td>
+ {%endif%}
+ </tr>
+ <tr class="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>
+ </td>
+ </tr>
+ {%endif%}
+ </table>
+
+ </div>
+ </div>
+
+ <div class="tab-pane row" id="account">
+ <div class="col-md-12">
+
+ <h3>Principal Account <small>Account used for delegating credentials</small></h3>
+ <table class="table">
+ <tr class="odd">
+ <th>Platform</th>
+ <th>Account Type</th>
+ <th>Account Delegation</th>
+ <th>User hrn</th>
+ <th>User Status</th>
+ <!--<th>Pub Key</th> -->
+ </tr>
+ {% for row in principal_acc %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.platform_name }} </td>
+ <td class="odd"> {{ row.account_type }} </td>
+ <td class="odd"> {{ row.delegation_type }} </td>
+ <td class="odd"> {{ row.usr_hrn }} </td>
+ <td class="odd"> {{ row.user_status }} </td>
+ <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
+ </tr>
+ {%endfor%}
+ </table>
+
+ </div>
+
+
+ {%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%}
+ </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">×</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">
+ <div class="col-md-12">
+
+ <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
+ <table class="mytable table table-bordered table-hover">
+ <tr class="odd">
+ <th>Platform</th>
+ <th>Account Type</th>
+ <th>Reference to</th>
+ <th>Remove Account</th>
+ </tr>
+ {% for row in ref_acc %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ row.platform_name }} </td>
+ <td class="odd"> {{ row.account_type }} </td>
+ <td class="odd"> {{ row.account_reference }} </td>
+ <td class="odd">
+ <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
+ <span class="glyphicon glyphicon-minus"></span>
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+
+
+ <h3>Add reference account to the following testbeds</h3>
+ <table class="mytable table table-bordered table-hover">
+ <tr class="odd">
+ <th>Platforms</th>
+ <th>Add Account</th>
+ </tr>
+ {% for platform in platform_list %}
+ <tr class="border_bottom">
+ <td class="odd"> {{ platform.platform_no_access }} </td>
+ <td class="odd">
+ <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
+ <span class="glyphicon glyphicon-plus"></span>
+ </button>
+ </td>
+ </tr>
+ {%endfor%}
+ </table>
+ </div>
+{%endif%}
+</div>
+</form>
+</div>
+
+<script>
+ $(document).ready(function() {
+ $('.nav-tabs a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ id = $(this).attr('href').substr(1);
+
+ });
+
+ $('button#createslice').click(function() {
+ window.location="/portal/slice_request/";
+ });
+ });
+</script>
+
+{% endblock %}
--- /dev/null
+<div class="footer">
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <ul>
+ <li></li>
+ </ul>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12 copy">
+
+ </div>
+ </div>
+</div>
+</div>
\ No newline at end of file
--- /dev/null
+{% extends "layout_base.html" %}
+{% load portal_filters %}
+
+{% block content %}
+<!-- <div class="row">
+{% widget '_widget-news.html' %}
+</div> -->
+{% if username %}
+<div class="container dashboard">
+ <div class="row">
+ {%if 'is_pi' in 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 %}
+ <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>
+ {%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>
+ </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 %}
+ <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>
+ SmartFIRE
+ </h2>
+ <h3>
+ EU-South Korea Cooperation<br>
+ On Future Internet Infrastructure
+ </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() {
+ $('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/institution#requests";
+ });
+ $('button#ticketbtn').click(function() {
+ window.location="/portal/contact/";
+ });
+ $('button#signupbtn').click(function() {
+ window.location="/portal/register/";
+ });
+ $('button#slicerequestbtn').click(function() {
+ window.location="/portal/slice_request/";
+ });
+/*-------
+List of slices has been moved in
+portal/templates/base.html
+This should go into session
+--------*/
+});
+</script>
+{# widget "_widget-monitor.html" #}
+{# widget "_widget-stats-top-slices.html" #}
+
+{% endblock %}
--- /dev/null
+{% extends "layout_wide.html" %}
+
+{% block head %}
+<script type="text/javascript" src="{{STATIC_URL}}/js/institution.js"></script>
+{% endblock head %}
+
+{% block content %}
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="breadcrumbs">
+ Management > Institution: <span id="authority_name"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <ul class="nav nav-tabs nav-section">
+ <li class="active"><a href="#about">About</a></li>
+ <li><a href="#users">Users</a></li>
+ <li><a href="#slices">Slices</a></li>
+ <li><a href="#requests">Requests</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+<div class="container tab-content">
+ <div class="tab-pane active row" id="about">
+ </div>
+
+ <div class="tab-pane row" id="users" data-authority="{{user_details.parent_authority}}">
+ <div class="col-md-12 el">
+ <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ <div id="user-tab-loaded" style="display:none;">
+ <table id="user-tab" class="table">
+ <tr>
+ <th>+/-</th>
+ <th>Email</th>
+ <th>User hrn</th>
+ <!--
+ <th>First name</th>
+ <th>Last name</th>
+ <th>Enabled</th>
+ -->
+ </tr>
+ </table>
+
+ </div>
+ {%if 'is_pi' in pi %}
+ <div>
+ <button id="deleteusers" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete selected users</button>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+
+ <div class="tab-pane row" id="slices">
+ <div class="col-md-12 el">
+ <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ <div id="slice-tab-loaded" style="display:none;">
+ <table id="slice-tab" class="table">
+ <tr>
+ <th>+/-</th>
+ <th>Slice hrn</th>
+ <th>Users</th>
+ <th>Url</th>
+ <!-- <th>nodes</th> -->
+ <th>Creation</th>
+ </tr>
+ </table>
+ </div>
+ {% if 'is_pi' in pi %}
+ <div>
+ {% if 'is_pi' in pi %}
+ <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
+ {% else %}
+ <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
+ {% endif %}
+ <button id="renewslices" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
+ <button id="deleteslices" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane row" id="requests">
+ </div>
+</div>
+<script>
+$(document).ready(function() {
+ {% if person %}
+ {% if user_details.parent_authority %}
+
+ $.post("/rest/slice/",{'fields':['slice_hrn','users','url','slice_date_created'],'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
+ var list_slices = [];
+ var table_slices = [];
+ /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
+ $.each( data, function( key, val ) {
+ list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+ if(val.nodes=="undefined" || val.nodes==null){
+ nodes_length=0;
+ }else{
+ nodes_length=val.nodes.length;
+ }
+ console.log(val);
+ if(val.users=="undefined" || val.users==null){
+ users_length=0;
+ }else{
+ users_length=val.users.length;
+ }
+
+ if(val.url=="undefined" || val.url==null){
+ slice_url="";
+ }else{
+ slice_url="<a href='"+val.url+"' target='_blank'>"+val.url+"</a>";
+ }
+
+ slice_row = "<tr id='"+val.slice_hrn+"'>";
+ slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
+ slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
+ slice_row += "<td>"+users_length+"</td>";
+ slice_row += "<td>"+slice_url+"</td>";
+ //slice_row += "<td>"+nodes_length+"</td>";
+ slice_row += "<td>"+val.slice_date_created+"</td>";
+ slice_row += "</tr>";
+ table_slices.push(slice_row);
+
+ });
+
+ /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
+ $("table#slice-tab tr:last").after(table_slices.join( "" ));
+ $("div#slice-tab-loaded").css("display","block");
+ $("div#slice-tab-loading").css("display","none");
+ });
+
+
+ $.post("/rest/user/",{'fields':['user_hrn','user_email'],'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
+ var list_users = [];
+ var table_users = [];
+ /* Available fields
+ user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
+ user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
+ */
+ $.each( data, function( key, val ) {
+ list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+ user_row = "<tr id='"+val.user_hrn+"'>";
+ user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
+ user_row += "<td>"+val.user_email+"</td>";
+ user_row += "<td>"+val.user_hrn+"</td>";
+ /*
+ user_row += "<td>"+val.user_first_name+"</td>";
+ user_row += "<td>"+val.user_last_name+"</td>";
+ user_row += "<td>"+val.user_enabled+"</td>";
+ */
+ user_row += "</tr>";
+ table_users.push(user_row);
+ });
+ $("table#user-tab tr:last").after(table_users.join( "" ));
+ $("div#user-tab-loaded").css("display","block");
+ $("div#user-tab-loading").css("display","none");
+ });
+
+ {% endif %}
+ {% endif %}
+
+}); // End document.ready
+
+$(document).ready(function() {
+ $('.nav-tabs a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ var id = $(this).attr('href').substr(1);
+ if ((id == 'requests') || (id == 'about'))
+ $("#" + id).load('/management/' + id);
+ });
+ var hash = window.location.hash;
+ if (hash) {
+ $('.nav-tabs a[href='+hash+']').click();
+ } else {
+ $('.nav-tabs a[href=#about]').click();
+ }
+});
+</script>
+{% endblock %}
--- /dev/null
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("li#nav-request").addClass("active");
+ });
+ function on_click_event() {
+ var ids = [];
+ $('.portal__validate__checkbox').each(function(i, el) {
+ if ($(el).prop('checked')) {
+ // portal__validate__checkbox__slice__2
+ var id_array = $(el).attr('id').split('__');
+ // push(slice__2)
+ ids.push(id_array[3] + '__' + id_array[4]);
+ }
+ });
+ if (ids.length > 0) {
+ var id_str = ids.join('/');
+ // XXX spinner
+ $.getJSON('/portal/validate_action/' + id_str,
+ function(status) {
+ $.each(status, function(request_type__id, request_status) {
+ // request_status: NAME -> dict (status, description)
+ var status_str = '';
+ $.each(request_status, function(name, result) {
+ if (status_str != '')
+ status_str += ' -- ';
+
+ if (result.status) {
+ status_str += '<font color="green">OK</font>';
+ $('#portal__validate__checkbox__' + request_type__id).hide();
+ } else {
+ status_str += '<font color="red">ERROR: ' + result.description + '</font>';
+ }
+ });
+ $('#portal__status__' + request_type__id).html(status_str);
+
+
+ });
+ }
+ );
+ }
+ }
+</script>
+
+<div class="col-md-12">
+ <h2>From your authorities</h2>
+</div>
+{% if my_authorities %}
+
+ {% for authority, requests in my_authorities.items %}
+
+ <div class="col-md-12">
+ <h2>{{authority}}</h2>
+ </div>
+
+ <table class="table">
+ <th>
+ <td>Type</td>
+ <td>Id</td>
+ <td>Details</td>
+ <td>Timestamp</td>
+ <td>Status</td>
+ </th>
+ {% for request in requests %}
+
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ <b>{{request.first_name}} {{request.last_name}}</b> <a href="mailto:{{request.email}}">{{request.email}}</a>
+ {% else %}
+ {% if request.type == 'slice' %}
+ <b>{{request.slice_name}}</b> -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ <b>{{request.site_name}}</b> ({{request.site_authority}}) -- {{request.address_city}}, {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+
+ {% endfor %}
+ </table>
+ {% endfor %}
+
+{% else %}
+ <div class="col-md-12">
+ <i>There is no pending request waiting for validation.</i>
+ </div>
+{% endif %}
+<div>nnllknjkn<br /><br /></div>
+<div class="col-md-12">
+ <h2>From your sub-authorities</h2>
+</div>
+{% if sub_authorities %}
+
+ {% for authority, requests in sub_authorities.items %}
+ <div class="col-md-12">
+ <h2>{{authority}}</h2>
+ </div>
+
+ <table class="table">
+ <th>
+ <td>Type</td>
+ <td>Id</td>
+ <td>Details</td>
+ <td>Timestamp</td>
+ <td>Status</td>
+ </th>
+ {% for request in requests %}
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+ {% else %}
+ {% if request.type == 'slice' %}
+ Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+ {% endfor %}
+ </table>
+ {% endfor %}
+{% else %}
+<div class="col-md-12">
+ <i>There is no pending request waiting for validation.</i>
+</div>
+{% endif %}
+
+<div class="col-md-12">
+ <h2>From your authorities with delegation</h2>
+</div>
+
+{% if delegation_authorities %}
+
+ {% for authority, requests in delegation_authorities.items %}
+ <div class="col-md-12">
+ <h3>{{authority}}</h3>
+ </div>
+ <table class="table">
+ <th>
+ <td>Type</td>
+ <td>Id</td>
+ <td>Details</td>
+ <td>Timestamp</td>
+ <td>Status</td>
+ </th>
+ {% for request in requests %}
+ <tr>
+ <td>
+ {% if request.allowed == 'allowed' %}
+ <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+ {% else %}
+ {% if request.allowed == 'expired' %}
+ expired
+ {% else %} {# denied #}
+ denied
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.type }}</td>
+ <td>{{ request.id }}</td>
+ <td>
+ {% if request.type == 'user' %}
+ Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
+ {% else %}
+ {% if request.type == 'slice' %}
+ Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
+ {% else %} {# authority #}
+ Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>{{ request.timestamp }}</td>
+
+ <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+ <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+ </tr>
+ {% endfor %}
+ </table>
+ {% endfor %}
+{% else %}
+<div class="col-md-12">
+ <i>There is no pending request waiting for validation.</i>
+</div>
+{% endif %}
+<div class="col-md-12">
+ <button class="btn btn-onelab" type="button" id="portal__validate" onclick="on_click_event();"><span class="glyphicon glyphicon-ok"></span> Validate</button>
+</div>
--- /dev/null
+{% extends "layout.html" %}
+{% load i18n %}
+
+{% block content %}
+ <div class="row">
+ <div class="col-md-12">
+ <div class="breadcrumbs">
+ Experiment > Request a new Slice
+ </div>
+ </div>
+ </div>
+
+ {% if errors %}
+ <div class="row">
+ <div class="col-md-12">
+ <ul class="error">
+ {% for error in errors %}
+ <li>{{ error }}</li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+
+ <div class="row">
+ <div class="col-md-8 el">
+ <form role="form" method="post">
+ {% csrf_token %}
+ <div class="form-group" style="display:none">
+ <input type="email" class="form-control" id="email" style="width:300px" value="{{ email }}" readonly="readonly">
+ </div>
+ <div class="form-group">
+ <input type="text" class="form-control" name="slice_name" id="slice_name" style="width:300px" placeholder="Slice name" value="{{slice_name}}"
+ title="Please enter a name for your slice"required="required">
+ </div>
+ <div class="form-group">
+ {%if 'is_pi' in pi %}
+ <input type="text" class="form-control" id="authority_hrn" name="org_name" style="width:300px" placeholder="Organization"
+ title="An authority responsible for vetting your slice" required="required">
+ {%else%}
+ <input type="text" class="form-control" id="authority_hrn" name="org_name" placeholder="Organization" style="width:300px;"
+ title="An authority responsible for vetting your slice" required="required" readonly>
+ {%endif%}
+ </div>
+ <div class="form-group">
+ <input type="text" class="form-control" name="url" id="url" style="width:300px" placeholder="Experiment URL (if one exists)"
+ title="Please provide the url of your experiment if you have one." value="{{url}}">
+ </div>
+ <div class="form-group">
+ <textarea id="purpose" name="purpose" class="form-control" rows="6" placeholder="Experiment purpose" style="width:300px"
+ title="Purpose of your experiment (informative)" required="required">{{ purpose }}</textarea>
+ </div>
+ {%if 'is_pi' in pi %}
+ <button type="submit" id=submit_pi class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
+ {%else%}
+ <button type="submit" class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
+ {%endif%}
+ </form>
+
+ </div>
+ </div>
+
+<script>
+jQuery(document).ready(function(){
+
+ /*$("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
+ var jsonData = JSON.parse(data);
+ $(this).attr("value", jsonData[0]['parent_authority']);
+ });*/
+ $("#authority_hrn").val("{{authority_name}}");
+ var availableTags = [
+ {% if authorities %}
+ {% for authority in authorities %}
+ {% if authority.name %}
+ {value:"{{ authority.name }}",label:"{{authority.name}}"},
+ // to show only full name
+ // {% else %}
+ // {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
+ {% endif %}
+ {% endfor %}
+ {% else %}
+ {value:"",label:"No authority found !!!"}
+ {% endif %}
+ ];
+ // sorting the list
+ availableTags.sort(function(a,b){
+ var nameA=a.value.toLowerCase(), nameB=b.value.toLowerCase();
+ if (nameA < nameB) {
+ return -1;
+ }
+ if (nameA > nameB) {
+ return 1;
+ }
+ return 0;
+ });
+ $( "#authority_hrn" ).autocomplete({
+ source: availableTags,
+ minLength: 0,
+ select: function( event, ui ) {console.log(jQuery(this));}
+ });
+
+ $("#submit_pi").click(function() {
+ localStorage.clear();
+ });
+});
+</script>
+{% endblock %}
+
--- /dev/null
+<div class="login-form">
+ {% if state %}
+ <span class="help-block">{{ state }}</span>
+ {% endif %}
+ <form action="/login/" method="post" role="form">
+ {% csrf_token %}
+ {% if next %}
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% endif %}
+ <div class="form-group">
+ <input type="email" name="username" placeholder="Enter Email / Username">
+ </div>
+ <div class="form-group">
+ <input type="password" name="password" placeholder="Password">
+ </div>
+ <div class="login-submit">
+ <input type="submit" class="btn btn-onelab" value="Sign In" />
+ <span class="lost-password"> | <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> -->
+ </div>
+ </form>
+</div>
--- /dev/null
+{% load portal_filters %}
+<div class="header">
+<div class="container">
+ <div class="row">
+ <div class="col-sm-3 col-md-3 logo">
+ <a href="/"><img height="60" src="{{ STATIC_URL }}img/SmartFIRE_logo.png" alt="SmartFIRE | sinis.ipv6.lip6.fr Portal - SmartFIRE" /></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>
+ {% endif %}
+ <div class="col-sm-5 col-md-5 secondary">
+ <ul>
+
+ <li><a target="_blank" href="http://status.testbeds.eu">Services Status</a></li>
+ <li><a target="_blank" href="http://testbeds.eu">Web site</a></li>
+ </ul>
+ {% if username %}
+ <div class="account">You are logged in as <a href="/account/">{{ username }}</a> | <a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</a></div>
+ {% endif %}
+ </div>
+ </div>
+</div>
+</div>
+
+<div class="row">
+{% widget '_widget-message.html' %}
+</div>
+<script>
+ $(document).ready(function() {
+ $('li.slices').mouseenter(function() {
+ $('div#menu-slice-list').fadeIn(100);
+ });
+ $('div#menu-slice-list').mouseleave(function(e) {
+ if (!$('li.slices').is(":hover")) {
+ $(this).fadeOut(100);
+ }
+ });
+ // var slices = localStorage.getItem('slices');
+ // if (slices.length == 0) {
+ // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ // var items = [];
+ // localStorage.setItem('slices', data[0].slice);
+ // });
+ // }
+ // $.each(slices, function( key, val ) {
+ // items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+ // });
+ // $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+ });
+</script>