• 首页列表显示全部问答,完成问答详情页布局。


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>首页
            {% block logintitle %}{% endblock %}
            {% block registertitle %}{% endblock %}
        </title>
        <nav style="background-color: white">
            <ul class="nav nav-tabs">
                <li><a href="{{ url_for('lx') }}">首页</a></li>
                {% if username %}
                    <li><a href="#">{{ username }}</a></li>
                    <li><a href="{{ url_for('logout')}}">注销</a></li>
                {% else %}
                    <li><a href="{{ url_for('login') }}">登录</a></li>
                    <li><a href="{{ url_for('regist') }}">注册</a></li>
                {% endif %}
                <li><a href="{{ url_for('fabu') }}">发布</a></li>
                <li><input type="text" class="form-control" style=" 200px"></li>
                <button type="button" class="btn btn-default">搜索</button>
    
            </ul>
        </nav>
        {% block loginhead %}{% endblock %}
        {% block registerhead %}{% endblock %}
    </head>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='css/webb.css') }}">
    
    <body class="body">
    
    <h1  align="center">欢迎进入我的网站</h1>
    {% block body %}
        <div class="container">
        <div class="row clearfix">
            <div class="col-md-2 column">
            </div>
            <div class="col-md-8 column">
                {% for foo in question %}
                <div class="list-group">
                     <a href="" class="list-group-item active">作者:{{ foo.author_id}}</a>
    
                    <div class="list-group-item">
                        <a href="{{ url_for('detail')}}" class="list-group-item-heading">
                            {{ foo.title}}
                        </a>
                        <p class="list-group-item-text">
                            {{foo.detail}}
                        </p>
                    </div>
                    <div class="list-group-item">
                         <span class="badge">发布时间:{{foo.creat_time}}</span> 发布时间
                    </div>
            </div>
                 {% endfor %}
            <div class="col-md-2 column">
            </div>
        </div>
    </div>
    {% endblock %}
    <footer class="foot">
        <div><a href="#"> 联系我们</a> · <a href="#"> 加入我们</a> · <a href="#"> 品牌与徽标 </a> · <a href="#">帮助中心</a> · <a href="#">合作伙伴</a>
        </div>
        <div>©2015-2017 广州商学院信息技术与工程学院 / 粤ICP备278953737号-5 / 粤公网安备2015060050046号 / Smrz 粤公网安备201506050046号 / Wxb
            举报电话:020-15533935928
        </div>
    </footer>
    @app.route('/')
    def lx():
        context = {
           'question':Ques.query.all()
    
        }
        return render_template('lx3.html',**context)
    
    @app.route('/detail/')
    def detail():
        # quest=Ques.query.filter(Ques.id == Ques_id).first()
        return render_template('detail.html')
    

      

  • 相关阅读:
    【掉下巴】枪的制造现场
    不引入第三个变量交换两个变量的方法
    [转]科学计算经典算法
    [小练eVC]常用控件之微调按钮
    【收购】LSI 40亿美元并购Agere
    VB6.0不支持鼠标滚轮的解决办法
    一个简单的BP网络C语言程序
    [转]想成为嵌入式程序员应知道的0x10个基本问题
    [zt]关于左值"lvalue"和右值"rvalue"的一点理解
    [掉下巴]细数非洲大山的肘下亡魂
  • 原文地址:https://www.cnblogs.com/zheng01/p/7941089.html
Copyright © 2020-2023  润新知