123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- {{extend './common/layout.art'}}
- {{block 'main'}}
- <!-- 子模板的相对路径相对的是当前文件,因为它是由模板引擎解析的,而不是浏览器-->
- {{include './common/header.art'}}
- <!-- 主体内容 -->
- <div class="content">
- {{include './common/sider.art'}}
- <div class="main">
- <!-- 分类标题 -->
- <div class="title">
- <h4>文章</h4>
- <span>找到1篇文章</span>
- <a href="/admin/article-edit" class="btn btn-primary new">发布新文章</a>
- </div>
- <!-- /分类标题 -->
- <!-- 内容列表 -->
- <table class="table table-striped table-bordered table-hover custom-table">
- <thead>
- <tr>
- <th>ID</th>
- <th>标题</th>
- <th>发布时间</th>
- <th>作者</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- {{each articles.records}}
- <tr>
- <td>{{@$value._id}}</td>
- <td>{{$value.title}}</td>
- <td>{{dateformat($value.publishDate, 'yyyy-mm-dd')}}</td>
- <td>{{$value.author.username}}</td>
- <td>
- <a href="/admin/article-edit?id={{@$value._id}}" class="glyphicon glyphicon-edit"></a>
- <i class="glyphicon glyphicon-remove delete" data-toggle="modal" data-target=".confirm-modal" data-id="{{@$value._id}}"></i>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- <!-- /内容列表 -->
- <!-- 分页 -->
- <ul class="pagination">
- {{if articles.page > 1}}
- <li>
- <a href="/admin/article?page={{articles.page - 1}}">
- <span>«</span>
- </a>
- </li>
- {{/if}}
- {{each articles.display}}
- <li><a href="/admin/article?page={{$value}}">{{$value}}</a></li>
- {{/each}}
- {{if articles.page < articles.pages}}
- <li>
- <a href="/admin/article?page={{articles.page - 0 + 1}}">
- <span>»</span>
- </a>
- </li>
- {{/if}}
- </ul>
- <!-- /分页 -->
- </div>
- </div>
- <!-- /主体内容 -->
- <!-- 删除确认弹出框 -->
- <div class="modal fade confirm-modal">
- <div class="modal-dialog modal-lg">
- <form class="modal-content" action="/admin/article-delete">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"><span>×</span></button>
- <h4 class="modal-title">请确认</h4>
- </div>
- <div class="modal-body">
- <p>您确定要删除这篇文章吗?</p>
- <input type="hidden" name="id" id="id">
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
- <input type="submit" class="btn btn-primary">
- </div>
- </form>
- </div>
- </div>
- <!-- /删除确认弹出框 -->
- {{/block}}
- {{block 'script'}}
- <script>
- $('.delete').on('click', function () {
- $('#id').val($(this).attr('data-id'));
- })
- </script>
- {{/block}}
|