完成个人中心 导航标签

      1. 个人中心—视图函数带标签页面参数tag
        @app.route('/usercenter/<user_id>/<tag>')
        def usercenter(user_id, tag):
        if tag == ‘1':
        return render_template('usercenter1.html', **context)

      2. 个人中心—导航标签链接增加tag参数
        <li role=“presentation”><a href=“{{ url_for(‘usercenter’,user_id = user.id,tag = ‘1’) }}">全部问答</a></li>
      3. 个人中心—有链接到个人中心页面的url增加tag参数
        u <a href="{{ url_for('usercenter',user_id = session.get('userid'), tag=1) }}">{{ session.get('user') }}</a>
    1. {% extends 'base.html' %}<br />{% block title %}<br />    个人中心<br />{% endblock %}<br /><br />{% block link %}<br /><br />{% endblock %}<br /><br />{% block box %}<br />    <div class="container"><br />        <div class="row clearfix"><br />            <div class="col-md-2 column"><br />            </div><br />            <div class="col-md-8 column"><br />                <ul class="nav nav-tabs"><br />                    <li role="presentation"><a href="{{ url_for('comment',user_id=user2.id,num='1') }}">全部问题</a></li><br />                    <li role="presentation"><a href="{{ url_for('comment',user_id=user2.id,num='2') }}">全部评论</a></li><br />                    <li role="presentation"><a href="{{ url_for('comment',user_id=user2.id,num='3') }}">个人信息</a></li><br />                </ul><br />                {% block subComment %}{% endblock %}<br />            </div><br />            <div class="col-md-2 column"><br />            </div><br />        </div><br />    </div><br />{% endblock %}<br /><br />{% block script %}<br /><br />{% endblock %}
    2. {% extends 'comment.html' %}<br />{% block subComment %}<br />    <ul class="list-group" style=""><br />        <h1>全部问题</h1><br />        {% for foo in questions %}<br />            <li class="list-group-item" style="width: 800px"><br />                <a class="wrap-img" href="#" target="_blank"><br />                    <img src="http://www.bookmarkye.com/3.jpg" width="50px"><br />                </a><br />                <br />                <a href="{{ url_for('comment',user_id=foo.author.id ,num='1')}}"<br />                   target="_blank">{{ foo.author.username }}</a><br />                <br><br />                <a href="{{ url_for('detail',question_id=foo.id) }}">{{ foo.title }}</a><br />                {{ foo.creat_time }}<br />                <p style="">{{ foo.detail }}<br />                </p><br />            </li><br /><br />        {% endfor %}<br />    </ul><br />{% endblock %}
      <ul class="list-group" style="margin-top: 30px;"><br />    <h1>全部评论</h1><br />    {% for com in comment %}<br />        <li class="list-group-item" style="width: 800px"><br />            <a class="wrap-img" href="#" target="_blank"><br />                <img src="http://www.bookmarkye.com/3.jpg" width="50px"><br />            </a><br />            <br />            <a href="{{ url_for('comment',user_id=com.author.id,num='1') }}"<br />               target="_blank">{{ com.author.username }}</a><br />            <br><br />            {{ com.creat_time }}<br />            <p style="">{{ com.detail }}</p><br />        </li><br />    {% endfor %}<br /></ul>
      <div class="list-group-item" style="margin-top: 30px;width: 800px;"><br />    <h1>名称:<br />        <small>{{ user2.username }}</small><br />    </h1><br />    <h1>问题数:<br />        <small>{{ questions|length }}</small><br />    </h1><br />    <h1>评论数:<br />        <small>{{ comment|length }}</small><br />    </h1><br /></div>