@using GBLab.Common.Expand;
@using System.Text;
@{
    Layout = "~/Views/School_Pre/Shared/_Layout.cshtml";
    var data = ViewData["data"] as GBLab.Entities.T_CmsImg;
    var pre = ViewData["pre"] as GBLab.Entities.T_CmsImg;
    var next = ViewData["next"] as GBLab.Entities.T_CmsImg;
    var top10data = ViewData["top10data"] as List<GBLab.Entities.T_CmsImg>;

    StringBuilder sb = new StringBuilder();
    int count = 0;
}
@section HeadStyle{
}
@section HeadScript{
}
@section JavaScript{
    <script>
        seajs.use(
            [
                @* 可放大和触控的相册 *@
                , "/Resource/Extend/helper/plus/plus_images.js?v=@(ViewBag.Version)"
            ]
            , function (main) {
                // Photoswipe - 相册1
                var imagesdetail = new gblab_images.func();
                imagesdetail.controls.$imgs = $(".detailimage>div>a>img");
                imagesdetail.config.bgOpacity = 1.0;
                imagesdetail.init();
            }
        );
    </script>
}
@{Html.RenderPartial("~/Views/School_Pre/Shared/_Part/_HeaderAd.cshtml");}
@{Html.RenderPartial("~/Views/School_Pre/Views/Module/Common/HeadPath.cshtml");}

<div class="box">
    <div class="col-md-8" id="imagesdetail">
        @{
            sb.AppendFormat(@"
            <div class='detailhead'>
                <div>
                    <a href='#this' target='_blank' class='thumbnail'>
                        <img src='{0}' alt='{1}' data-bd-imgshare-binded='1'>
                    </a>
                    <div>
                        <a href='#this' class='fs14'>{1}</a>
                        <br>
                        <a href='#this' class='minfo'>{2}</a>
                        <div>
                            <span>更新：{3}</span>
                            <span>点击：{4}</span>
                        </div>
                    </div>
                </div>
            </div>"
, data.F_Logo.ChangeToImageUrl("")
, data.F_Name
, data.F_Info.RemoveHTML().SubstringEllipsis(30, "...")
, data.F_UpdateDate.ToString("yyyy-MM-dd")
, data.F_ViewNum.ToString()
);
        }
        @Html.Raw(sb.ToString())

        <div class="container-detail-head">相册图片</div>
        <div class="detailimage col-xs-12 col-md-12">
            @{
                StringBuilder sbImgHead = new StringBuilder();
                string[] imgList = data.F_Imgs.Split('|');
                foreach (var item in imgList) {
                    if (!string.IsNullOrWhiteSpace(item)) {
                        sbImgHead.AppendFormat(@"
<div class='col-xs-6 col-md-4'>
    <a href='#this' class='thumbnail'>
        <img src='{0}' alt='{1}' data-bd-imgshare-binded='1'>
    </a>
    <h5>{1}</h5>
</div>"
                            , item
                            , "图片" + count.ToString()
                        );
                    }
                }
            }
            @Html.Raw(sbImgHead.ToString())
        </div>

        <div class="container-detail-head">相册介绍</div>
        <div class="container-detail-info col-xs-12 col-md-12">
            @Html.Raw(data.F_Info.DefaultIsNullOrEmpty(""))
        </div>

        <div class="container-detail-head">更多相册</div>
        <div class="detailimage col-xs-12 col-md-12">
            @{
                sbImgHead.Clear();
                sbImgHead = new StringBuilder();
                foreach (var item in top10data) {
                    sbImgHead.AppendFormat(@"
<div class='col-xs-6 col-md-4'>
    <a href='{2}' class='thumbnail'>
        <img src='{0}' alt='{1}' data-bd-imgshare-binded='1'>
    </a>
    <h5>{1}</h5>
</div>"
                        , item.F_Logo.ChangeToImageUrl("")
                        , item.F_Name
                        , "/CmsImg/" + item.F_TypeId.ToString() + "/" + item.F_Id.ToString() + ".html"
                    );
                }
            }
            @Html.Raw(sbImgHead.ToString())
        </div>
    </div>
    <div class="col-xs-12 col-md-4">
        @{Html.RenderPartial("~/Views/School_Pre/Views/Module/Common/Menu.cshtml");}
        @{Html.RenderPartial("~/Views/School_Pre/Views/Module/CmsImg/_Part/Top10.cshtml");}
        <div class="container-right-head bs-info">相关相册</div>
        <div class="container-right-info col-xs-12 col-md-12">
            @{sb.Clear();}
            @if (pre != null) {
                sb.AppendFormat(@"
<div class='col-xs-12 col-sm-6 col-md-12'>
<a href='{0}'>上一篇：{1}</a>
</div>"
        , ("/CmsImg/" + pre.F_TypeId.ToString() + "/" + pre.F_Id.ToString() + ".html")
        , pre.F_Name
        );
            }
            @if (next != null) {
                sb.AppendFormat(@"
<div class='col-xs-12 col-sm-6 col-md-12'>
<a href='{0}'>下一篇：{1}</a>
</div>"
        , ("/CmsImg/" + next.F_TypeId.ToString() + "/" + next.F_Id.ToString() + ".html")
        , next.F_Name
        );
            }
            @Html.Raw(sb.ToString())
        </div>
    </div>
</div>