<!DOCTYPE html>
<html lang="zh-CN">
<head>
{{template "widgets/head.html" .}}
    <style>a.btn-danger{color: #ffffff !important;}</style>
</head>
<body>
<div class="manual-reader">
    {{template "widgets/header.html" .}}
    <div class="container manual-body">
        <div class="row">
            <div class="page-left">
                {{template "manager/menu.html" .}}
            </div>
            <div class="page-right">
                <div class="m-box">
                    <div class="box-head">
                        <strong class="box-title">项目列表</strong>
                    </div>
                    <ul class="nav nav-tabs" style="margin-top: 15px;">
                        <li {{if ne .Private 1}}class="active"{{end}}><a href="{{urlfor "ManagerController.Books"}}">公开项目</a></li>
                        <li {{if eq .Private 1}}class="active"{{end}}><a href="{{urlfor "ManagerController.Books"}}?private=1">私有项目</a></li>
                    </ul>
                </div>
                <div class="box-body" id="bookList">
                    <div class="book-list">

                        {{range $index,$item := .Lists}}
                        <div class="list-item">
                                <div class="book-title">
                                    <div class="pull-left">
                                        <a href="{{urlfor "DocumentController.Index" ":key" $item.Identify}}" title="查看文档" data-toggle="tooltip">
                                            {{if eq $item.PrivatelyOwned 0}}
                                            <i class="fa fa-unlock" aria-hidden="true"></i>
                                            {{else}}
                                            <i class="fa fa-lock" aria-hidden="true"></i>
                                            {{end}}
                                            {{$item.BookName}}
                                        </a>
                                    </div>

                                    <div class="pull-right">
                                        <a href="{{urlfor "DocumentController.Index" ":key" $item.Identify}}" title="查看文档" class="btn btn-default" data-toggle="tooltip" target="_blank"><i class="fa fa-eye"></i> 查看文档</a>
                                        <a href="{{urlfor "DocumentController.Edit" ":key" $item.Identify ":id" ""}}" title="编辑文档" class="btn btn-default" data-toggle="tooltip" target="_blank"><i class="fa fa-edit" aria-hidden="true"></i> 编辑文档</a>
                                        <a href="{{urlfor "ManagerController.EditBook" ":key" $item.Identify}}" title="项目设置" class="btn btn-default" data-toggle="tooltip" target="_blank"><i class="fa fa-cogs" aria-hidden="true"></i> 项目设置</a>
                                        <a href="{{urlfor "ManagerController.DeleteBook"}}?book_id={{$item.BookId}}" title="删除项目" class="btn btn-danger ajax-get confirm" data-toggle="tooltip" target="_blank"><i class="fa fa-recycle" aria-hidden="true"></i> 删除项目</a>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="desc-text">
                                    {{if eq $item.Description ""}}
                                    &nbsp;
                                    {{else}}
                                            {{$item.Description}}
                                    {{end}}
                                </div>
                                <div class="info">
                                    <span title="创建时间" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-clock-o"></i>
                                        {{date $item.CreateTime "Y-m-d H:i:s"}}
                                    </span>
                                    <span title="创建者" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-user"></i> {{$item.CreateName}}</span>
                                    <span title="文档数量" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-pie-chart"></i> {{$item.DocCount}}</span>
                                   {{if ne $item.LastModifyText ""}}
                                    <span title="最后编辑" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-pencil"></i> 最后编辑: {{$item.LastModifyText}}</span>
                                    {{end}}
                                    <div class="pull-right pull-right-sort">
                                        <div class="form-group">
                                            <input type="number" name="order_index" data-url="{{urlfor "ManagerController.UpdateBookSort"}}?book_id={{$item.BookId}}" class="form-control change-update" placeholder="请输入文档排序值，数值越大越靠前" value="{{$item.OrderIndex}}">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {{else}}
                        <div class="text-center">暂无数据</div>
                        {{end}}
                    </div>
                    <nav class="pagination-container">
                        {{.PageHtml}}
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>

{{/*<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>*/}}
<script src="//apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js" type="text/javascript"></script>
{{/*<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>*/}}
<script src="//apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js" type="text/javascript"></script>

<script src="{{$.StaticDomain}}/static/vuejs/vue.min.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/jquery.form.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/toast.script.js" type="text/javascript"></script>
<script src="/static/js/main.js" type="text/javascript"></script>

</body>
</html>