@using GBLab.Common.Expand
@using System.Data;
@using System.Text;
@{
    var menu = ViewData["Menu"] as List<GBLab.Entities.SiteNodes>;
    var CmsConfig = ViewData["CmsConfig"] as GBLab.Entities.Config.CmsConfig;
    StringBuilder sb = new StringBuilder();
}
@* 快速导航 *@
<div class="container-head" style="clear:both;">快速导航</div>
<div class="container-info row footer-link">
    <div class="col-md-8 col-sm-8 col-xs-12 left">

        @{
            sb.Clear();
            sb = new StringBuilder();
            foreach (var item in menu) {
                if (item.midNodes.Count == 0) {
                    sb.Append(string.Format(@"
<div><span><a href='{1}'>{0}</a></span></div>"
            , item.node.F_Name.DefaultIsNullOrEmpty("")
            , nodetourl(item.node)
            ));
                } else {

                    StringBuilder sbMid = new StringBuilder();
                    foreach (var midItem in item.midNodes) {
                        sbMid.Append(string.Format(@"
<li><a href='{1}'>{0}</a></li>"
            , midItem.node.F_Name.DefaultIsNullOrEmpty("")
            , nodetourl(midItem.node)
            ));
                    }


                    sb.Append(string.Format(@"
<div>
<span>{0}</span>
<ul>
{1}
</ul>
</div>"
            , item.node.F_Name.DefaultIsNullOrEmpty("")
            , sbMid.ToString()));
                }
            }
        }
        @Html.Raw(sb.ToString())

        @*<div>
                <span>测试标题</span>
                <ul>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                </ul>
            </div>
            <div>
                <span>测试标题</span>
                <ul>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                </ul>
            </div>
            <div>
                <span>测试标题</span>
                <ul>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                </ul>
            </div>
            <div>
                <span>测试标题</span>
                <ul>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                </ul>
            </div>
            <div>
                <span>测试标题</span>
                <ul>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                    <li><a href="http://www.xuexiaoruanjian.com" title="测试链接">测试链接</a></li>
                </ul>
            </div>*@
    </div>
    <div class="col-md-4 col-sm-4 col-xs-12 right">
        <div class="left w30">校训</div>
        <div class="right w65"><span>@Html.Raw(CmsConfig.Site_XiaoXun.DefaultIsNullOrEmpty("&nbsp;"))</span></div>
        <div class="left w30">办学理念</div>
        <div class="right w65"><span>@Html.Raw(CmsConfig.Site_LiNian.DefaultIsNullOrEmpty("&nbsp;"))</span></div>
        <div class="left w30">育人目标</div>
        <div class="right w65"><span>@Html.Raw(CmsConfig.Site_YuRenMuBiao.DefaultIsNullOrEmpty("&nbsp;"))</span></div>
    </div>
</div>

@helper nodetourl(GBLab.Entities.T_CmsNode node)
{
    string result = "";
    if (node.F_CmsModelId == 3 || node.F_CmsModelId == 10 || node.F_CmsModelId == 2)
    {
            @node.F_Url.DefaultIsNullOrEmpty("");
    }
    else
    {
        switch (node.F_CmsModelId)
        {
            case 1:
                result = Url.Domain_RouteUrl("Site.CmsNews.Node.List", new { typeId = node.F_Type });
                break;
            case 5:
                result = Url.Domain_RouteUrl("Site.CmsVedios.Node.List", new { typeId = node.F_Type });
                break;
            case 6:
                result = Url.Domain_RouteUrl("Site.CmsHire.Node.List", new { typeId = node.F_Type });
                break;
            case 7:
                result = Url.Domain_RouteUrl("Site.CmsImg.Node.List", new { typeId = node.F_Type });
                break;
            case 11:
                result = Url.Domain_RouteUrl("Site.CmsTeacher.Node.List", new { typeId = node.F_Type });
                break;
            case 13:
                result = Url.Domain_RouteUrl("Site.CmsGuestBook.Node.List", new { typeId = node.F_Type });
                break;
            case 14:
                result = Url.Domain_RouteUrl("Site.CmsTeachPlans.Node.List", new { typeId = node.F_Type });
                break;
        }

        @*如果无法识别的，特殊处理*@
        if (string.IsNullOrWhiteSpace(result))
        {
            result = "#this";
        }
        @result;
    }
}