{% extends "admin/base.html" %}
{% load admin_static %}

{% block extrahead %}
<link rel="stylesheet"  href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="{% static 'suit/css/suit.css' %}" media="all">
<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables_themeroller.css">
<link rel="stylesheet" type="text/css" href="{% static 'xos.css' %}" media="all">
{% if XOS_BRANDING_CSS %}
    <link rel="stylesheet" type="text/css" href="{{ XOS_BRANDING_CSS }}">
{% endif %}
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="{% static 'log4javascript-1.4.6/log4javascript.js' %}"></script>
<script src="{% static 'js/Leaflet.MakiMarkers.js' %}" > </script>
  
<script>
  $(function() {
    $( "#hometabs" ).tabs({active: 0, //event: "mouseover"
      //collapsible: true
    });
  });

var consoleAppender = new log4javascript.BrowserConsoleAppender();
var patternLayout = new log4javascript.PatternLayout("%d{HH:mm:ss,SSS} %l{s:l} %-5p - %m{1}%n");
consoleAppender.setLayout(patternLayout);
//var log  = log4javascript.getDefaultLogger();
var log  = log4javascript.getRootLogger();
log.addAppender(consoleAppender);
log.setLevel(log4javascript.Level.ERROR);

function confirmDialog(title,msg) {
    var dialog = $('<div>'+msg+'</div>');
    var def = $.Deferred();

    $(dialog).dialog({
        resizable: false,
        title: title,
        autoOpen: true,
        modal: true,
        dialogClass: "dashboard-hpc-instance",
        buttons: {
            'OK': function() {
                def.resolve();
                log.debug("Chose to add a instance");
                $( this ).dialog( "close" );
            },
            'Cancel': function() {
                def.reject();
                $( this ).dialog( "close" );
            }
        },
        close: {
        }
    });
    return def.promise();
}

function errorDialog(title,msg) {
    var dialog = $('<div>'+msg+'</div>');
    var def = $.Deferred();

    $(dialog).dialog({
        resizable: false,
        title: title,
        autoOpen: true,
        modal: true,
        dialogClass: "dashboard-hpc-instance",
        buttons: {
            'OK': function() {
                def.resolve();
                $( this ).dialog( "close" );
            },
        },
        close: {
        }
    });
    return def.promise();
}

</script>
{% endblock %}

{% block content %}
dashboard goes here
{% endblock %}
