@{
    ViewBag.Title = "帮助管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
    string key = ViewBag.key;
    List<DXHelp.BLL.Model.HelpContentInfo> list = ViewBag.list as List<DXHelp.BLL.Model.HelpContentInfo>;
}
@section header{
    <script type="text/javascript">
        $(function () {
            $(".del").click(function (e) {
                var href = $(this).attr("href");
                e.preventDefault();
                $.confirm({
                    title: '确认',
                    content: "你确认删除此项及此项下所有子级?",
                    confirm: function () {
                        self.location = href;
                    },
                    cancel: function () {
                        return;
                    }
                });
            });
        });
    </script>
}
@section menu_left{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Left.cshtml", 1)
}
@section menu_top{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Top.cshtml", 1)
}
<div class="nv">
    <div class="nv-left">
        当前位置：帮助管理 > 列表
    </div>
    <div class="nv-right">
        <a href="@Url.Content("~/help/add?ParentId=0")" class="icon-add">新增</a>
    </div>
</div>
<div class="content">
    @using (Html.BeginForm("index", "help", FormMethod.Get))
    {
        <div class="s-area">
            <input class="s-text" type="text" id="key" name="key" placeholder="请输入标题或内容关键字" value="@key" />
            <input type="submit" class="s-btn" value="" />
        </div>
    }
    <table class="list-table">
        <tr>
            <th>
                标题
            </th>
            <th>
                添加时间
            </th>
            <th>
                关键字
            </th>
            <th>
                排序码
            </th>
            <th>
                操作
            </th>
        </tr>
        @foreach (var m in list)
        {
            <tr>
                <td style="text-align: left">
                    ├@string.Format("{0} {1}", DXHelp.Common.stringHelper.GetLayer(m.Layer), m.Title)
                </td>
                <td>
                    @Convert.ToDateTime(m.AddTime).ToShortDateString()
                </td>
                <td>
                    @m.Key
                </td>
                <td>
                    @m.SortNumber
                </td>
                <td class="center">
                    <a class="op" href="@Url.Content("~/help/add?ParentId=" + m.HelpId + "&parentName=" + Server.UrlEncode(m.Title))">
                        添加子级
                    </a>
                    <span class="op-fg">|</span> 
                    <a class="op" href="@Url.Content("~/help/edit?helpId=" + m.HelpId)">
                        编辑
                    </a>
                    <span class="op-fg">|</span> 
                    <a class="op" href="@Url.Content("~/feedback/index?helpId=" + m.HelpId)">
                        查看反馈
                    </a>
                    <span class="op-fg">|</span> 
                    <a class="op del" href="@Url.Content("~/help/del?helpId=" + m.HelpId)">
                        删除
                    </a>
                </td>
            </tr>
        }
    </table>
    @Html.Raw(ViewBag.pagestr)
</div>
