视图
@bp.route('/banners/')@login_required@permission_required(CMSPersmission.POSTER)def banners(): return render_template('cms/cms_banners.html')
给这个url添加选中事件
else if(url.indexOf('banners') >= 0) { var bannerManageLi = $('.banner-manage'); bannerManageLi.addClass('unfold').siblings().removeClass('unfold');}
base模板
页面
{% extends 'cms/cms_base.html' %}{% block title %} 轮播图管理{% endblock %}{% block head %} <style> .top-box{ overflow: hidden; background: #ecedf0; padding: 5px; } .top-box button{ float: right; } </style>{% endblock %}{% block page_title %} {{ self.title() }}{% endblock %}{% block main_content %} <div class="top-box"> <button class="btn btn-warning">添加轮播图</button> </div> <table class="table table-bordered"> <thead> <tr> <th>名称</th> <th>图片链接</th> <th>跳转链接 </th> <th>优先级</th> <th>创建时间</th> <th>操作</th> </tr> </thead> </table>{% endblock %}
访问