Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git] / portal / templates / home-view.html
index 1c887a3..8cf7ca4 100644 (file)
-{# fine for either layout-unfold1.html (logged in) or layout-unfold2.html (needs a login prompt) #}
-{% extends layout_1_or_2 %}
+{% extends "layout.html" %}
+{% load portal_filters %}
 
-{% block unfold_margin %}
-{% include 'widget-login.html' %}
-{% endblock unfold_margin %}
-
-{% block unfold_main %}
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
-<!-- xxx ideally only onelab.css but ... xxx -->
-<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
-<div class='well well-lg onelab-title'>
-  <h2 style="font-weight: bold;">Welcome to the OneLab portal !</h2>
-  <h4>New to OneLab? Please <a href="/portal/register">register</a> or learn more about <a href="http://www.onelab.eu/" target="_blank">the project</a>.</h3>
+{% block content %}
+<div class="row">
+{% widget '_widget_news.html' %}
 </div>
-<div class='well'>
-<p>
-Experimentally-driven research is key to success in exploring the possible
-futures of the Internet. The OneLab initiative provides an open,
-general-purpose, shared experimental facility, both large-scale and
-sustainable, which allows European industry and academia to innovate and assess
-the performance of their solutions. Based on the results of several different
-European and national projects, OneLab offers access to a range of  tools and
-testbeds including PlanetLab Europe, the NITOS wireless testbed, and other
-federated testbeds.
-</p>
-<p>This UI server is connected to the manifold backend running at <code>{{ MANIFOLD_URL }}</code>.</p>
+<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 %}
+                               {% endif %}
+                               </td>
+                               <td class="support">
+                                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+                                       <div>
+                                               <a href="/portal/contact">Contact</a> <br />
+                                               <a href="/portal/support/documentation">Documentation</a>
+                                       </div>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+       <div class="home-panel" id="manager">
+               <table>
+                       <tr>
+                               <td>INSTITUTION</td>
+                               <td>SLICES</td>
+                               <td>REQUESTS</td>
+                       </tr>
+                       <tr>
+                               <td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
+                               <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
+                               <td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
+                       </tr>
+                       <tr>
+                               {% if person %}
+                               <td class="logged-in">
+                                       <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                               {% else %}
+                               <td>
+                                       {% widget '_widget-login-manager.html' %}
+                               {% endif %}
+                               </td>
+                               <td>
+                                       {% if person %}
+                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
+                                       {% endif %}
+                               </td>
+                               <td class="support">
+                                       {% if person %}
+                                   <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+                                       {% endif %}
+                               </td>
+                       </tr>
+               </table>
+       </div>
 </div>
-
-{% endblock unfold_main %}
+<script type="text/javascript">
+       $(document).ready(function() {
+               $('a.home-tab').click(function() {
+                       $('ul.nav-tabs li').removeClass('active');
+                       $(this).parent().addClass('active');
+                       $('div.home-panel').hide();
+                       $('div#'+$(this).data('panel')).show();
+               });
+               $('button#validaterequestbtn').click(function() {
+                       window.location="/portal/validate/";
+               });
+               $('button#ticketbtn').click(function() {
+                       window.location="/portal/contact/";
+               });
+               $('button#slicerequestbtn').click(function() {
+                       window.location="/portal/slice_request/";
+               });
+/*-------
+List of slices has been moved in 
+portal/templates/base.html
+This should go into session
+--------*/
+});
+</script>
+{% endblock %}