您现在的位置是: 网站首页 >Flask >Flask搭建微电影视频网站 Flask

【Flask微电影】11.搭建后台页面-收藏管理、日志管理

admin2018年11月3日 19:11 Flask | Html | Python 399人已围观

Flask搭建微电影视频网站简介 利用Flask搭建微电影视频网站 Github地址:https://github.com/xyliurui/FlaskMovie

## 搭建后台收藏管理页面 ### 添加collect_list.html收藏列表页面 ```html {% extends 'admin/base.html' %} {% block content %} <section class="content-header"> <h1>微电影管理系统</h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> 收藏管理</a></li> <li class="active">收藏列表</li> </ol> </section> <section class="content" id="showcontent"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">收藏列表</h3> <div class="box-tools"> <div class="input-group input-group-sm" style="width: 150px;"> <input type="text" name="table_search" class="form-control pull-right" placeholder="请输入关键字..."> <div class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> </button> </div> </div> </div> </div> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tbody> <tr> <th>编号</th> <th>电影</th> <th>用户</th> <th>添加时间</th> <th>操作事项</th> </tr> {% for i in range(5) %} <tr> <td>1</td> <td>环太平洋</td> <td>张小明</td> <td>2017-06-01</td> <td> <a class="label label-success">编辑</a> &nbsp; <a class="label label-danger">删除</a> </td> </tr> {% endfor %} </tbody> </table> </div> <div class="box-footer clearfix"> <ul class="pagination pagination-sm no-margin pull-right"> <li><a href="#">首页</a></li> <li><a href="#">上一页</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">下一页</a></li> <li><a href="#">尾页</a></li> </ul> </div> </div> </div> </div> </section> {% endblock %} {% block js %} <script> // 激活菜单栏 $(document).ready(function () { $("#g-7").addClass('active'); $("#g-7-1").addClass('active'); }) </script> {% endblock %} ``` ![BLOG_20181103_191444_70](/media/blog/images/2018/11/BLOG_20181103_191444_70.png "博客图集BLOG_20181103_191444_70.png") ### 添加收藏管理视图 ```python @admin.route("/collect/list/") def collect_list(): return render_template('admin/collect_list.html') ``` ### 修改base.html添加收藏管理链接和激活 ```html <li class="treeview" id="g-7"> <a href="#"> <i class="fa fa-heart" aria-hidden="true"></i> <span>收藏管理</span> <span class="label label-primary pull-right">1</span> </a> <ul class="treeview-menu"> <li id="g-7-1"> <a href="{{ url_for('admin.collect_list') }}"> <i class="fa fa-circle-o"></i> 收藏列表 </a> </li> </ul> </li> ``` ## 搭建后台日志管理页面 ### 添加logs_operate_log.html操作日志页面 ```html {% extends 'admin/base.html' %} {% block content %} <section class="content-header"> <h1>微电影管理系统</h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> 日志管理</a></li> <li class="active">操作日志列表</li> </ol> </section> <section class="content" id="showcontent"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">操作日志列表</h3> <div class="box-tools"> <div class="input-group input-group-sm" style="width: 150px;"> <input type="text" name="table_search" class="form-control pull-right" placeholder="请输入关键字..."> <div class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> </button> </div> </div> </div> </div> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tbody> <tr> <th>编号</th> <th>管理员</th> <th>操作时间</th> <th>操作原因</th> <th>操作IP</th> </tr> <tr> <td>1</td> <td>admin</td> <td>2017-06-01</td> <td>添加一个标签:科幻</td> <td>192.168.4.1</td> </tr> </tbody> </table> </div> <div class="box-footer clearfix"> <ul class="pagination pagination-sm no-margin pull-right"> <li><a href="#">首页</a></li> <li><a href="#">上一页</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">下一页</a></li> <li><a href="#">尾页</a></li> </ul> </div> </div> </div> </div> </section> {% endblock %} {% block js %} <script> // 激活菜单栏 $(document).ready(function () { $("#g-8").addClass('active'); $("#g-8-1").addClass('active'); }) </script> {% endblock %} ``` ![BLOG_20181103_191513_62](/media/blog/images/2018/11/BLOG_20181103_191513_62.png "博客图集BLOG_20181103_191513_62.png") ### 添加logs_admin_log.html管理员日志页面 ```html {% extends 'admin/base.html' %} {% block content %} <section class="content-header"> <h1>微电影管理系统</h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> 日志管理</a></li> <li class="active">管理员登录日志列表</li> </ol> </section> <section class="content" id="showcontent"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">管理员登录日志列表</h3> <div class="box-tools"> <div class="input-group input-group-sm" style="width: 150px;"> <input type="text" name="table_search" class="form-control pull-right" placeholder="请输入关键字..."> <div class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> </button> </div> </div> </div> </div> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tbody> <tr> <th>编号</th> <th>管理员</th> <th>登录时间</th> <th>登录IP</th> </tr> <tr> <td>1</td> <td>admin</td> <td>2017-06-01</td> <td>192.168.4.1</td> </tr> </tbody> </table> </div> <div class="box-footer clearfix"> <ul class="pagination pagination-sm no-margin pull-right"> <li><a href="#">首页</a></li> <li><a href="#">上一页</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">下一页</a></li> <li><a href="#">尾页</a></li> </ul> </div> </div> </div> </div> </section> {% endblock %} {% block js %} <script> // 激活菜单栏 $(document).ready(function () { $("#g-8").addClass('active'); $("#g-8-2").addClass('active'); }) </script> {% endblock %} ``` ![BLOG_20181103_191522_64](/media/blog/images/2018/11/BLOG_20181103_191522_64.png "博客图集BLOG_20181103_191522_64.png") ### 添加logs_user_log.html会员日志页面 ```html {% extends 'admin/base.html' %} {% block content %} <section class="content-header"> <h1>微电影管理系统</h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> 日志管理</a></li> <li class="active">会员登录日志列表</li> </ol> </section> <section class="content" id="showcontent"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">会员登录日志列表</h3> <div class="box-tools"> <div class="input-group input-group-sm" style="width: 150px;"> <input type="text" name="table_search" class="form-control pull-right" placeholder="请输入关键字..."> <div class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> </button> </div> </div> </div> </div> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tbody> <tr> <th>编号</th> <th>会员</th> <th>登录时间</th> <th>登录IP</th> </tr> <tr> <td>1</td> <td>张小明</td> <td>2017-06-01</td> <td>192.168.4.1</td> </tr> </tbody> </table> </div> <div class="box-footer clearfix"> <ul class="pagination pagination-sm no-margin pull-right"> <li><a href="#">首页</a></li> <li><a href="#">上一页</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">下一页</a></li> <li><a href="#">尾页</a></li> </ul> </div> </div> </div> </div> </section> {% endblock %} {% block js %} <script> // 激活菜单栏 $(document).ready(function () { $("#g-8").addClass('active'); $("#g-8-3").addClass('active'); }) </script> {% endblock %} ``` ![BLOG_20181103_191542_35](/media/blog/images/2018/11/BLOG_20181103_191542_35.png "博客图集BLOG_20181103_191542_35.png") ### 添加日志管理视图 ```python @admin.route("/logs/operate_log/") def logs_operate_log(): return render_template('admin/logs_operate_log.html') @admin.route("/logs/admin_log/") def logs_admin_log(): return render_template('admin/logs_admin_log.html') @admin.route("/logs/user_log/") def logs_user_log(): return render_template('admin/logs_user_log.html') ``` ### 修改base.html添加日志管理链接和激活 ```html <li class="treeview" id="g-8"> <a href="#"> <i class="fa fa-file-text" aria-hidden="true"></i> <span>日志管理</span> <span class="label label-primary pull-right">3</span> </a> <ul class="treeview-menu"> <li id="g-8-1"> <a href="{{ url_for('admin.logs_operate_log') }}"> <i class="fa fa-circle-o"></i> 操作日志列表 </a> </li> <li id="g-8-2"> <a href="{{ url_for('admin.logs_admin_log') }}"> <i class="fa fa-circle-o"></i> 管理员登录日志列表 </a> </li> <li id="g-8-3"> <a href="{{ url_for('admin.logs_user_log') }}"> <i class="fa fa-circle-o"></i> 会员登录日志列表 </a> </li> </ul> </li> ```

很赞哦! (1)

文章交流

  • emoji
0人参与,0条评论

当前用户

未登录,点击   登录

站点信息

  • 建站时间:网站已运行586天
  • 系统信息:Linux
  • 后台程序:Python: 3.6.6
  • 网站框架:Django: 2.2.9
  • 文章统计:222 篇
  • 文章评论:39 条
  • 腾讯分析网站概况-腾讯分析
  • 百度统计网站概况-百度统计
  • 微信公众号:扫描二维码,关注我们
返回
顶部
标题 换行 登录
网站