标签:indent ext one 完成 信息 时间 hit 列表 creat
首页列表显示全部问答:
{% extends ‘base.html‘ %} {% block title %} 首页 {% endblock %} {% block head %} <link type="text/css" rel="stylesheet" href="{{ url_for(‘static‘,filename=‘css/index.css‘) }}"> {% endblock %} {% block main %} <ul class="list1" > {% for foo in questions %} <img src="../static/images/myself.jpg" width="60" height="60"> <li class="list-group-item"> <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> {% if username %} <li class="zero"><a href="{{ url_for(‘detail‘) }}">{{ username }}</a></li> {% endif %} <a class="#"></a> <br> <span class="badge">{{ foo.creat_time }}</span> <li class="one" href="#">{{ foo.title }}</li> <li class="two"><p style="text-indent: 18px">{{ foo.detail }}</p></li> </li> {% endfor %} </ul> {% endblock %}
@app.route(‘/index‘) def index(): context={ ‘questions‘: Question.query.all(), } return render_template(‘index.html‘,**context)
{% extends ‘base.html‘ %} {% block title %} 问答详情页 {% endblock %} {% block head %} <link type="text/css" rel="stylesheet" href="../static/css/detail.css"> {% endblock %} {% block main %} <ul class="list"> <p>用户名</p> <p>问题</p> <li class="answer"><p style="text-indent: 18px">回答</p></li> <span class="badge">时间</span> <a href="a">回复?</a> <a href="b">送礼</a> <div> <input id="com" name="comment" type="text" placeholder="我也说一句..." > </div> </ul> {% endblock %}
.list{ margin-top: 50px; margin-left: 50px; margin-right: 50px; width:500px; height:600px; background-color:azure; box-shadow: 10px 10px 5px #888888; border:2px solid antiquewhite; padding:20px 40px 20px 40px; border-radius:25px; list-style: none; } .answer{ border: 1px solid; border-color: aquamarine; height: 50px; font-size: 15px; }
@app.route(‘/detail‘) def detail(): return render_template("detail.html")
标签:indent ext one 完成 信息 时间 hit 列表 creat
原文地址:http://www.cnblogs.com/892356821qqcom/p/7992220.html