<%doc>Copyright (C) 2009 HDE, Inc.</%doc>
<%inherit file="../include/base.html" />

<%def name="breadcrumbs()">
<%!
from karesansui.lib.template import img_status, str_status, clipping
from karesansui.lib.const import MACHINE_NAME_CLIPPING_RANGE
%>

        <div class="left"></div>
        <div class="text">
            <img src="${ctx.homepath}/static/images/top.png" alt=""/><a href="${ctx.homepath}/" class="path-a">${_('Top')}</a>
            &nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;
            <img src="${ctx.homepath}/static/images/host-icon.png" alt=""/><a href="${ctx.homepath}/host/${model.parent_id}" class="path-a">${clipping(model.parent.name, MACHINE_NAME_CLIPPING_RANGE) | h}</a>
            &nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;
            <img src="${ctx.homepath}/static/images/tree-guest.png" alt=""/><a href="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}" class="path-a">${clipping(model.name, MACHINE_NAME_CLIPPING_RANGE) | h}</a>
        </div>
        <div class="right"></div>
</%def>

<%def name="tab()">
<script type="text/javascript">
<!--
g_current_tree_id = "#tree-guest" + ${model.id};
$(document).ready(function(){
    var tab_url = null;
    $("#tab .text li a").click(function(){
        if(tab_url == null || $("#tab .text ul li[class='ui-tabs-selected']").find("a").attr("id") == tab_url){
            tab_url = $(this).attr("id");
        }
    });
    
    $(function() {
        $('#tab .text > ul').tabs({
            select: function(ev){
                if(tab_url != null){
                    if(tab_url.indexOf("console") != -1){
                        $("#show").html("<iframe frameborder='0' scrolling='no' height='600px' width='99%' src='" + tab_url + "'></iframe>")
                    } else {
                        goto_tab(tab_url, null);
                    }
                } 
            },
        });
    });
});
-->
</script>
	            <div class="text">
	                <ul>
                        <li><a href="#show" id="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}.part"><span>${_('Summary')}</span></a></li>
                        <li><a href="#show" id="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}/snapshot.part"><span>${_('Snapshot')}</span></a></li>
                        <li><a href="#show" id="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}/device.part"><span>${_('Device')}</span></a></li>
                        <li><a href="#show" id="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}/job.part"><span>${_('Job')}</span></a></li>
                        <li><a href="#show" id="${ctx.homepath}/host/${model.parent_id}/guest/${model.id}/console.part"><span>${_('Console')}</span></a></li>
                    </ul>
                </div>
</%def>


<%def name="show()">
<script type="text/javascript">
<!--
$(document).ready(function(){
    $(function() {
        goto_tab('${ctx.homepath}/host/${model.parent_id}/guest/${model.id}.part','');
    });
});
// -->
</script>
</%def>
