<?php $data = $this->data; ?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span3" id="sidebar" style="width:250px;position:fixed;z-index:100;display:none;">
            <ul class="nav nav-list bs-docs-sidenav nav-collapse collapse">
                <li <?php if($data["uri"]["seg"][1] == "/"){echo "class='active'";} ?> onclick="leftSwich(this)" id="left_home">
                    <a><i class="icon-chevron-right"></i> 首页</a>
                </li>
                <li <?php if($data["uri"]["seg"][1] == "showDevs"){echo "class='active'";} ?> onclick="leftSwich(this)" id="left_show_dev">
                    <a><i class="icon-chevron-right"></i> 查看设备</a>
                </li>
                <li <?php if($data["uri"]["seg"][1] == "showDevDetail"){echo "class='active'";} ?> onclick="leftSwich(this)" id="left_show_dev_detail">
                    <a><i class="icon-chevron-right"></i> 设备详情</a>
                </li>
            </ul>
        </div>
    </div>
</div>

<script>
/*******************************************
 *     左侧菜单切换
 /******************************************/
 function leftSwich(e){
    var id = $(e).attr("id");
    var host = window.location.host;
    var username = $.cookie('username');
    var token = $.cookie('token');
    if(username == undefined){
        username = "";
    }
    if(token == undefined){
        token = "";
    }
    
    if(id == "left_home"){
        window.location.href = "http://" + host + "?username=" + username + "&token=" + token;
    }else if(id == "left_show_dev"){
        window.location.href = "http://" + host + "/home/showDevs" + "?username=" + username + "&token=" + token;
    }else if(id == "left_show_dev_detail"){
        window.location.href = "http://" + host + "/home/showDevDetail" + "?username=" + username + "&token=" + token;
    }
}

</script>