视图

@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 %}

访问

添加轮播图的模态对话框

{% 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" data-toggle="modal" data-target="#banner-dialog">添加轮播图</button>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>名称</th>
<th>图片链接</th>
<th>跳转链接</th>
<th>优先级</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
</table>
<!-- 模态对话框,需包含上面button包含的属性(#属性),如这里用的#banner-dialog -->
<div class="modal fade" id="banner-dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">添加轮播图</h4>
</div>
<div class="modal-body">
<form action="" class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">名称:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" placeholder="轮播图名称">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图片:</label>
<div class="col-sm-7">
<input type="text" class="form-control" name="image_url" placeholder="轮播图图片链接">
</div>
<button class="btn btn-info col-sm-2">添加图片</button>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">跳转:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="link_url" placeholder="跳转链接">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">权重:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="priority" placeholder="优先级,优先级高则显示在前面">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
{% endblock %}

访问

一百二十六:CMS系统之轮播图管理页面布局和添加轮播图的模态对话框制作的更多相关文章

  1. 一百二十:CMS系统之注册功能前后端逻辑

    给提交按钮加一个id,方便写js js //发送ajax请求注册请求$(function () { $('#submit-btn').click(function (event) { event.pr ...

  2. Flask实战第49天:cms轮播图管理页面布局

    新建cms_banners.html继承cms_base.html {% extends 'cms/cms_base.html' %} {% block title %} 轮播图管理-CMS管理系统 ...

  3. 一百二十七:CMS系统之添加轮播图前后台逻辑

    后台逻辑 模型 from exts import dbfrom datetime import datetime class BannerModel(db.Model): __tablename__ ...

  4. Java开发笔记(一百二十六)Swing的窗口

    前面介绍了AWT界面编程的若干技术,在编码实践的时候,会发现AWT用起来甚是别扭,它的毛病包括但不限于下列几点:1.对中文的支持不好,要想在界面上正常显示汉字,还得在运行时指定额外的运行参数“-Dfi ...

  5. 一百三十:CMS系统之七牛js和python的SDK使用示例

    1.安装: pip install qiniu 2.编写获取uptoken的接口 @app.route('/uptoken/')def uptoken(): access_key = '' secre ...

  6. 一百二十三:CMS系统之登录功能

    配置文件中加入前台用户的身份标识 form class SigninForm(BaseForm): telephone = StringField(validators=[Regexp(r'1[345 ...

  7. 一百二十一:CMS系统之注册后跳转到上一个页面

    实现功能,访问测试页面的时候,跳转到注册页面,注册成功后跳转到测试页面 使用参数:若是从其他地址跳转过来时,头部信息中会携带参数referrer,此参数为从从哪个地址跳转到当前地址的,若是直接从浏览器 ...

  8. 测开之路一百二十六:flask之获取request请求数据

    可以根据flask的request对象获取所有的请求信息 path = request.path # 获取请求地址method = request.method # 获取请求方法ip = reques ...

  9. VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management

    VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management 实验失败告终,启动VMware View Persona Management服务报10 ...

随机推荐

  1. 使用 visual studio 2019 社区版打开touchgfx工程注意项

    @2019-09-23 [环境] touchgfx designer 4.10.0 visual studio 2019 社区版 [问题] #error 1 使用 visual studio 2019 ...

  2. linux入门常用指令2.安装nginx

    下载nginx包 nginx-1.10.3.tar.gz 解压 [root@localhost src]# tar -zxvf nginx-1.10.3.tar.gz [root@localhost ...

  3. How to export Overload functions from DLL?

    Library that exports functions library liba; procedure F(X: Integer); stdcall; overload; begin end; ...

  4. PAT Basic 1064 朋友数 (20 分)

    如果两个整数各位数字的和是一样的,则被称为是“朋友数”,而那个公共的和就是它们的“朋友证号”.例如 123 和 51 就是朋友数,因为 1+2+3 = 5+1 = 6,而 6 就是它们的朋友证号.给定 ...

  5. P4390 [BOI2007]Mokia 摩基亚 (CDQ解决三维偏序问题)

    题目描述 摩尔瓦多的移动电话公司摩基亚(Mokia)设计出了一种新的用户定位系统.和其他的定位系统一样,它能够迅速回答任何形如"用户C的位置在哪?"的问题,精确到毫米.但其真正高科 ...

  6. Mac&Appium&Python自动化测试-Appium安装

    基础配置 1.JAVA和Git就不用多说了 2.Brew,也就是homebrew,它是MacOSX上的软件包管理工具,它就等同于linux上的apt-get.yum,如果没有安装,可以通过如下命令安装 ...

  7. golang map多层嵌套使用及遍历方法汇总

    原文:https://blog.csdn.net/boyhandsome7/article/details/79734847 ------------------------------------- ...

  8. HTML嵌入多媒体对象

    [问题描述]如何在HTML中嵌入pdf.word,音频(如mp3),视频(如mp4),flash呢? [分析] 1 嵌入pdf (1) 利用object <object classid=&quo ...

  9. 2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018) D. Delivery Delays (二分+最短路+DP)

    题目链接:https://codeforc.es/gym/101933/problem/D 题意:地图上有 n 个位置和 m 条边,每条边连接 u.v 且有一个距离 w,一共有 k 个询问,每个询问表 ...

  10. mysql批量新增和批量删除

    首先推荐使用PreparedStatement的批量处理操作. Connection conn = null; PreparedStatement stmt = null; try{ Class.fo ...