<html lang="en"><head>
<title>{{theme}} portal - {{ section }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link rel="shortcut icon" href="/static/img/favicon_fed4fire.ico">
+<link rel="shortcut icon" href="/static/img/favicon.ico">
{# This is where insert_str will end up #}{% media_container prelude %}
{% include 'messages-transient-header.html' %}
<script type="text/javascript"> {# raw js code - use {% insert prelude_js %} ... {% endinsert %} #} {% container prelude_js %}</script>
This list of slices should go into SESSION !
*/
$(document).ready(function() {
- {% if username %}
- myslice.login();
+{% if username %}
+ myslice.login(function(){
+ user = myslice.user();
+
+ var slices = [];
+ if($.isEmptyObject(user)){
+ $("div#home-slice-list").html(
+ "<div>You do not yet have a slice</div>");
+ $("ul#dropdown-slice-list").append("<li>no slice</li>");
+ slices.push("no slice");
+ }else{
+ slices = user.slices;
+ drawSlices(slices);
+ }
+ {% if theme == "fed4fire" %}
+ myslice.loadProjects(function(){
+ p = myslice.projects();
+ drawProjects(p);
+ });
+ {% endif %}
+ });
- user = myslice.user();
-
- var slices = [];
- if($.isEmptyObject(user)){
- $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
- if(data.length > 0){
- drawSlices(data[0].slices);
- }else{
- $("div#home-slice-list").html(
- "<div>You do not yet have a slice</div>");
- $("ul#dropdown-slice-list").append("<li>no slice</li>");
- slices.push("no slice");
- }
- });
- }else{
- slices = user.slices;
- drawSlices(slices);
- }
function drawSlices(slices){
var items = [];
$("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
$("ul#dropdown-slice-list").append(items.join( "" ));
}
+
+ {% if theme == "fed4fire" %}
+ function drawProjects(projects){
+ var items = [];
+
+ $.each( projects, function(i, val) {
+ items.push( "<li><a href=\"/portal/project/"+val.authority_hrn+"\">" + val.authority_hrn + "</a></li>" );
+ });
+ $("div#home-project-list").html($( "<ul/>", { html: items.join( "" ) }));
+ $("ul#dropdown-project-list").append(items.join( "" ));
+ }
{% endif %}
+{% endif %}
jQuery('[title!=""]').qtip();
});
</script>
{% block topmenu %}
{% widget "_widget-topmenu.html" %}
{% endblock topmenu %}
- {% include 'messages-transient.html' %}
{% block base_content %}
{% endblock %}
{% endblock container %}
+{% widget "_footer.html" %}
+<div class="loading">
+ <div><img src="{{ STATIC_URL }}/img/loading.gif" /> Loading...</div>
+ <div> </div>
+ <div class="message"></div>
+</div>
</body>
</html>