<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="ArticleDetail.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Info.ArticleDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <form class="auto" method="post" action="" 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="categoryId" name="categoryId" class="iconfont" data-vtype="must" data-vmsg="请选择所属栏目">
                            <option value="">请选择所属栏目</option>
                            <ruson:Repater runat="server" ID="categoryList" ItemType="WAP2P.Article.Category">
                                <ItemTemplate>
                                    <option value="<%# Item.Id %>" <%# Model.CategoryId == Item.Id ? "selected" : string.Empty %>><%# Item.SelectLevelOption() %></option>
                                </ItemTemplate>
                            </ruson:Repater>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>文章名称</th>
                    <td>
                        <input type="text" name="title" id="title" class="w250" maxlength="100" data-vtype="must" data-vmsg="请输入文章名称" value="<%= Model.Title.HtmlEncode() %>" />    
                    </td>
                </tr>
                <tr>
                    <th>作者</th>
                    <td><input type="text" name="author" id="author" class="w250" maxlength="50" value="<%= Model.Author.HtmlEncode() %>" /></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 id="coverResult" class="mb10"><% = IsNew || string.IsNullOrEmpty(Model.Cover) ? string.Empty : string.Format("<img src=\"{0}\" alt=\"\">", Model.Cover) %></div>
                        <div class="pl136"><input type="hidden" name="cover" id="cover" value="<% =Model.Cover.HtmlEncode() %>" /></div>
                        <input type="file" id="coverFile" />
                        <em>请上传尺寸为 <i class="fcred-3">640 X 480 像素</i> 以内的封面图片</em>
                    </td>
                </tr>
                <tr>
                    <th>是否启用</th>
                    <td><div class="ui-checkbox"><% =HtmlHelper.CheckBox("active", "启用", IsNew ? true : Model.Active) %></div></td>
                </tr>
                <tr>
                    <th>文章发布平台</th>
                    <td>
                        <div class="ui-checkbox"><% =HtmlHelper.CheckBox("pcShow", "网站",  IsNew ? true : Model.PcShow) %> <% =HtmlHelper.CheckBox("mobileShow", "移动端", Model.MobileShow) %></div>
                    </td>
                </tr>
                <tr>
                    <th>外部链接</th>
                    <td>
                        <input type="text" name="url" id="url" class="w250" maxlength="500" data-vtype="url" data--vmsg="请输入正确的链接地址" data-vmust="false" value="<%=Model.Url.HtmlEncode() %>" />
                        <em>以http://开头 (如果外部链接有值时，点击文章将直接跳转到外部链接)</em>
                    </td>
                </tr>
                <tr>
                    <th>文章简介</th>
                    <td><textarea name="description"><%=Model.Description.HtmlEncode() %></textarea></td>
                </tr>
                <tr>
                    <th>文章内容</th>
                    <td><script id="detail" name="detail" class="ui-editor" type="text/plain"><%= Model.Detail %></script></td>
                </tr>
                <tr>
                    <th>点击次数</th>
                    <td><%=Model.Hits %></td>
                </tr>
                <tr>
                    <th>最后修改人</th>
                    <td><%=Model.ModifyBy %></td>
                </tr>
                <tr>
                    <th>最后修改时间</th>
                    <td><%=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>
        setTimeout(function () {
            $('#coverFile').uploadify({
                width: 120,
                height: 32,
                multi: false,
                removeTimeout: 0,
                swf: '../res/uploadify/uploadify.swf?v=<% =CryptoHelper.Random(100000,999999) %>',
                uploader: '../res/uploadify/SwfUpload.aspx?type=image&width=640&height=480',
                buttonClass:'iconfont',
                buttonText: '&#xe629; 上传封面图片',
                fileTypeExts: '<% =WAP2P.Web.PC.Admin.Res.uploadify.SwfUpload.AllowImages %>',
                formData: {
                    <% =WAP2P.Web.Admin.Membership.CookieName %> : '<% =Request.Cookies[WAP2P.Web.Admin.Membership.CookieName].Value %>'
                },
                onUploadSuccess: function(res, data) {
                    eval('var d = ' + data);
                    if (d.Success) {
                        $('#cover').val(d.Message).trigger('blur');
                        $('#coverResult').html('<img src="' + d.Message + '" />');
                    } else {
                        $.jError(d.Message);
                    }
                }
            });
        }, 10);
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>
