{% load portal_filters %}
{# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
<html lang="en"><head>
-<title>OneLab Portal - {{ section }}</title>
+<title>{{theme}} portal - {{ section }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/static/img/favicon.ico">
{# This is where insert_str will end up #}{% media_container prelude %}
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
+
+<script type="text/javascript">
+/*
+XXX TODO: session
+This list of slices should go into SESSION !
+*/
+$(document).ready(function() {
+ {% if username %}
+ myslice.login();
+
+ user = myslice.user();
+
+ var slices = [];
+ if($.isEmptyObject(user)){
+ $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ if(data.length > 0){
+ slices = data[0].slices;
+ }else{
+ slices.push("no slice");
+ }
+ drawSlices(slices);
+ });
+ }else{
+ slices = user.slices;
+ drawSlices(slices);
+ }
+ function drawSlices(slices){
+ var items = [];
+ $.each( slices, function(i, val) {
+ items.push( "<li><a href=\"/slice/"+val+"\">" + val + "</a></li>" );
+ });
+ $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+ $("ul#dropdown-slice-list").append(items.join( "" ));
+ }
+ {% endif %}
+});
+</script>
</head>
<body>
{% block container %}