<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="CategoryDetail.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Info.CategoryDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <form action="" class="auto" method="post"  onsuccess="parent.$.jPopupEdit.close(true);">
        <div class="m-editbar">
            <input type="submit" class="btn-larger c-priority iconfont" value="&#xe684; 保存" />
            <input type="button" class="btn-larger c-normal iconfont" value="&#xe634; 关闭" onclick="parent.$.jPopupEdit.close();" />
        </div>
        <div class="m-content m-editcontent">
            <table class="m-info" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <th>所属父类</th>
                    <td>
                        <select id="parentId" name="parentId" class="iconfont">
                            <option value="0">顶级</option>
                            <ruson:Repater runat="server" ID="categoryList" ItemType="WAP2P.Article.Category">
                                <ItemTemplate>
                                    <%# IsNew && Request.QueryString["ParentId"] == null ? string.Format("<option value=\"{0}\">{1}</option>",Item.Id,Item.SelectLevelOption()) : Request.QueryString["ParentId"] == null && Item.SelectLevelOption().Contains(Model.Name) ?  string.Empty : string.Format("<option value=\"{0}\" {1}> {2} </option>",Item.Id,Model.ParentId == Item.Id || Request.QueryString["ParentId"].ToInt64(0) == Item.Id ? "selected" : string.Empty,Item.SelectLevelOption())%>
                                </ItemTemplate>
                            </ruson:Repater>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>栏目名称</th>
                    <td>
                        <input type="text" name="name" class="w250" maxlength="50" value="<%=Model.Name.HtmlEncode() %>" data-vtype="must" data-vmsg="请输入栏目名称" />
                    </td>
                </tr>
                <tr>
                    <th>是否启用栏目</th>
                    <td><div class="ui-checkbox"><% =HtmlHelper.CheckBox("active", "启用", IsNew ? true : Model.Active) %></div></td>
                </tr>
                <tr>
                    <th>排序值</th>
                    <td><input type="text" name="orderBy" class="w60 ui-int" value="<%=Model.OrderBy %>" data-vtype="number" data-vmsg="排序必须为数字"/><em>数值越大越靠前</em></td>
                </tr>                
                <tr>
                    <th>栏目是否为单页</th>
                    <td><div class="ui-checkbox"><% =HtmlHelper.CheckBox("isArticle", "启用", Model.IsArticle) %></div></td>
                </tr>
                <tr id="url" class="g-hide">
                    <th>外部链接</th>
                    <td>
                        <input type="text" name="url" class="w250" maxlength="500" value="<%=Model.Url.HtmlEncode() %>" data-vtype="url" data-vmsg="请输入正确的链接地址" data-vmust="false" />
                        <em>以http://开头 (如果外部链接有值时，点击栏目将直接跳转到外部链接)</em>
                    </td>
                </tr>
                <tr id="single" class="g-hide">
                    <th>单页内容面</th>
                    <td><script name="detail" class="ui-editor" type="text/plain"><%= Model.IsArticle ? Model.Detail : string.Empty %></script></td>
                </tr>
                <tr id="detail">
                    <th>栏目简介</th>
                    <td><textarea name="detail"><%= !Model.IsArticle ? Model.Detail.HtmlEncode() : string.Empty %></textarea></td>
                </tr>
                <tr>
                    <th>最后修改人</th>
                    <td><%= Model.ModifyBy %></td>
                </tr>
                <tr>
                    <th>最后修改时间</th>
                    <td><%= IsNew ? string.Empty : Model.ModifyAt.ToDateTimeString() %></td>
                </tr>
                <tr>
                    <th>创建时间</th>
                    <td><%= Model.CreateAt.ToDateTimeString() %></td>
                </tr>
            </table>
        </div>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script src="<% =this.ImportJsCss("../res/ueditor/ueditor.config.js") %>"></script>
    <script src="<% =this.ImportJsCss("../res/ueditor/ueditor.all.min.js") %>"></script>
    <script>
        if ($('#isArticle').is(':checked'))
        {
            $('#url').show();
            $('#single').show();
            $('#detail').hide();
        }

        $('#isArticle').click(function () {
            if ($(this).is(':checked')) {

                $('#url').show();
                $('#single').show();
                $('#detail').hide();

            } else {

                $('#url').hide();
                $('#single').hide();
                $('#detail').show();

            }
        })
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>
