Comments list display and sort, personal center display

Source: Internet
Author: User

1. Comments {% extends"myweb.html"%}{% block Detailtitle%} Quiz details {% Endblock%} {% Block Detailhead%}{% Endblock%} {% Block Mywebbody%}     <divclass="Page-header"style="Color:black"align="Center"> class="badge">{{ques.creat_time}}</span> </small>class=" Lead">{{ques.detail}}</p> "{{url_for (' comment ')}}"Method="Post">Please comment<divclass="Form-group"> <textareaname="new_comment"class="Form-control"Rows="3"Id="new-comment"Placeholder=""></textarea> <input type="Hidden"Name="question_id"Value="{{ques.id}}"> </div> <buttontype="Submit"class="btn Btn-default"> Send </button> </form> class="List-group"style="margin:10px">        {% forFooinchQues.comments%}        <liclass="List-group-item"> <spanclass="Glyphicon Glyphicon-heart-empty"aria-hidden="true"></span> <a href="{{url_for (' usercenter ', User_id=foo.author.id)}}">{{foo.author.username}}</a> <spanclass="badge">{{foo.creat_time}}</span> <p style="">{{foo.detail}}</p> </li>{% ENDFOR%}    </ul> {% Endblock%} define Usercenter@app.route ('/usercenter/<user_id>') @loginfirstdefUsercenter (user_id): User=user.query.filter (user.id==user_id). First () Mycontext={        'username': User.username,'Questions': User.question,'Comments': User.comments,} returnrender_template ('usercenter.html',**mycontext) Personal Center {% extends'myweb.html'%}{% block title%} Personal Center {% endblock%}{% Block main%} <divclass="Page-header"> class="Glyphicon Glyphicon-user"aria-hidden="true"></span>{{username}}<br> <small> all questions and Answers ><spanclass="badge"></span> </small>class="List-group"style="">        {% forFooinchUser.question%}            <liclass="List-group-item"> <spanclass="Glyphicon Glyphicon-heart-empty"aria-hidden="true"></span> <a href="#">{{foo.author.username}}</a> <spanclass="badge">{{foo.creat_time}}</span> <p style="">{{foo.detail}}</p> </li>    {% ENDFOR%}    </ul></div> <divclass="Page-header"> class="Glyphicon Glyphicon-user"aria-hidden="true"></span>{{User}}<br> <small> Personal Information ><spanclass="badge"></span> </small>class="List-group"style="">          {% forFooinchUser.comments%}            <liclass="List-group-item"> <spanclass="Glyphicon Glyphicon-heart-empty"aria-hidden="true"></span> <a href="#">{{foo.author.username}}</a> <spanclass="badge">{{foo.creat_time}}</span> <p style="">{{foo.detail}}</p> </li>    {% ENDFOR%}    </ul></div> <divclass="Page-header"> class="Glyphicon Glyphicon-user"aria-hidden="true"></span>{{User}}<br> <small> Personal Information ><spanclass="badge"></span> </small>class="List-group"style=""> <liclass="List-group-item"> User:{{username}}</li> <liclass="List-group-item"> Ref.:</li> <liclass="List-group-item"> Nickname:</li> <liclass="List-group-item"> Article Article:</li> </ul></div> {% Endblock%}

Comments list display and sort, personal center display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.