<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{% block title%}car{% endblock %}</title>
<link href="{{ url_for('static',filename='css/base.css') }}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="{{ url_for('static',filename='js/base.js') }}"></script>
{% block head %}
{% endblock %}
<style>
nav navbar-nav li {
list_style: none;
float: left;
margin: 10px;
}
.nav1 li{
list-style: none;
float: left;
margin: 10px;
}
</style>
</head>
<body id="mybody">
<div class="daohang_box"><form action="{{ url_for('search')}}" method="get" >
<nav class="navbar" role="navigation" style="">
<div class="container-fluid" id="container">
<div class="navbar-header">
<a class="navbar-brand" href="{{ url_for('index') }}">首页</a>
</div>
<div>
<ul class="nav navbar-nav">
{% if username %}
<li><a href={{ url_for('usercenter',user_id=session.get('userid'),tag=1) }}>{{ username }}</a></li>
<li><a href="{{ url_for('logout') }}">注销 </a></li>
{% else %}
<li><a href="{{ url_for('login') }}" onclick="">登录</a></li>
<li><a href="{{ url_for('regist') }}" onclick="">注册</a></li>
{% endif %}
<li><a href="{{ url_for('lable') }}" onclick="">发布问答</a></li>
</ul>
</div>
<div style="float: right">
<img style="width: 50px; height: 50px" id="myonoff" onclick="mySwitch()" src="http://up.enterdesk.com/edpic/78/9a/ac/789aacfb997963e7a3516dd916448acc.jpg" style="width:50px" >
</div>
<div><input id="search_box" name='q'type="text" placeholder="请输入关键词查找">
<button id="search" type="submit">搜索</button>
</div>
{# <body background="http://p5.so.qhimgs1.com/bdr/_240_/t01fb87f1928a69d5eb.jpg" style="width: 100%; height: 100%"></body>#}
</div>
</nav>
</form>
{% block main %}{% endblock %}
</body >
</html>
</body>
{% extends 'base.html' %}
{% block title %}detail{% endblock %}
{% block head %}
{# <script src="{{ url_for('static',filename='js/base.js') }}" type="text/javascript"></script>#}
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/detail.css') }}">
{% endblock %}
{% block main %}
<div align="center">
<div class="a1">
<h3>{{ ques.title }}<br><small>{{ ques.author.Username }}
<span class="badge">{{ ques.creat_time }}</span></small></h3></div>
<p class="lead">{{ ques.detail }}</p>
<h3>
<form action="{{ url_for('comment') }}" method="post">
{
<br></div>
<div class="a2" style="margin-left: 25%">
<div class="pinglun"><label for="comment">评论</label><br></div>
<textarea id="comment" rows="5" name="commentdetail" style="width: 90ch"></textarea></div>
<input name="question_id" type="hidden" value="{{ ques.id }}"/>
<button type="submit" class="fasong" style="margin-left: 25%">发送评论</button>
<h4 style="margin-left: 25%">comment:({{ ques.comments|length }})</h4>
</div>
</form>
<ul class="list-group" style="margin-left:20%;margin-top: 5%;margin-right:20%">
{% for foo in ques.comments %}
<li class="list-group-item" >
<a href={{ url_for('usercenter',user_id=foo.author_id,tag=1 )}}>{{ foo.author.username }} </a><br>
<a href={{ url_for('detail',question_id=foo.id)}}>{{ foo.title }}</a>
<span class="badge">{{ foo.creat_time }}</span>
<p class="abstract">{{ foo.detail }}</p>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{% block head %}
<link href="{{ url_for('static',filename='css/index.css') }}" rel="stylesheet" type="text/css">
<script src="{{ url_for('static',filename='js/index.js') }}"></script>
{% endblock %}
{% block main %}
<ul class="list-group" style="margin-left:20%;margin-top: 5%;margin-right:20%">
{# <li class="list-group-item">#}
{# <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span>#}
{# <a href="{{ url_for('detail')}}">username</a>#}
{# <br>#}
{# <a href="#)"title></a>#}
{# <span class="badge">create_time</span>#}
{# <p>detauk</p>#}
{% for foo in question %}
<li class="list-group-item" >
<a href={{ url_for('usercenter',user_id=foo.author_id,tag=1 )}}>{{ foo.author.username }} </a><br>
<a href={{ url_for('detail',question_id=foo.id)}}>{{ foo.title }}</a>
<span class="badge">{{ foo.creat_time }}</span>
<p class="abstract">{{ foo.detail }}</p>
</li>
{% endfor %}
</ul>
<div>
</div>
{% endblock %}
{% extends 'base.html' %}
{% block title %}
发布问答
{% endblock %}
{% block head %}
{% endblock %}
{% block main %}
<form class="all" action="{{ url_for('lable') }}" method="POST">
<div style="margin-left:30%;margin-top: 10%" >
<h3 >发布问答</h3>
<div class="form_group"></div>
<div class="form_group">
<!--<label for="questionDetial">标题</label>-->
<!--<textarea class="form-control" rows="1" id="questionDetial"></textarea>-->
<label for="biaoti">标题</label>
<input id="biaoti" type="text" placeholder="请输入标题!" name="title">
</div>
<div class="form_group" >
<label for="questionDetial">详情</label>
<textarea class="form-control" rows="5" id="questionDetial" style="width:60rem " name="detail"></textarea>
</div>
</div>
<div class="checkbox" style="margin-left:30%;margin-top: 1%">
<button type="submit" class="btn bun-default">发布</button>
</div>
</form>
{% endblock %}
{% extends 'base.html' %}
{% block title %}登录{% endblock %}
{% block head %}
<link href="{{ url_for('static',filename='css/login.css') }}" rel="stylesheet" type="text/css">
<script src="{{ url_for('static',filename='js/login.js') }}"></script>
{% endblock %}
{% block main %}
<div class="a" >
<div class="login" ><h2>登录</h2></div>
<form action="{{ url_for('login') }}"method="post">
<div class="a1" >
用户名:<input id="name" type="text"placeholder="请输入用户名" name="username"><br>
密 码: <input id="password" type="password"placeholder="请输入密码" name="password"><br>
</div>
<div id="error_box"><br></div>
<div class="a2" >
<button onclick="myLogin()">登录</button>
<button type="button" onclick=window.alert("是否取消登录!")>取消</button>
</div>
</div>
</form>
{% endblock %}
{% extends 'base.html' %}
{% block title %}注册{% endblock %}
{% block head %}
<link href="{{ url_for('static',filename='css/regist.css') }}" rel="stylesheet" type="text/css">
<script src="{{ url_for('static',filename='js/regist.js') }}"></script>
{% endblock %}
{% block main %}
<div class="a" >
<div class="regist" ><h2>注册</h2></div>
<form action="{{ url_for('regist') }}"method="post" onsubmit="return myLogin()">
<div class="a1" >
用户名:<input id="name" type="text"placeholder="请输入用户名" name="username"><br>
昵 称: <input id="nickname" type="text"placeholder="请输入昵称" name="nickname"><br>
密 码: <input id="password" type="password"placeholder="请输入密码" name="password"><br>
密 码: <input id="password1" type="password"placeholder="请再次输入密码" name="password1"><br>
</div>
<div id="error_box"><br></div>
<div class="a2" >
<button >注册</button>
<button type="button" onclick=window.alert("是否取消登录!")>取消</button>
</div>
</div>
</div>
</form>
{% endblock %}
{% extends 'userbase.html' %}
{% block user %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/userbase.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/user.css') }}">
{% endblock %}
<div class="a1">
<h3>{{ username }}</h3><br>
{# <small>全部问答</small>#}
</div>
<ul>
{% for foo in user.question %}
<li class="list-group-item" >
<a href={{ url_for('index')}}>{{ foo.author.username }} </a><br>
<a href={{ url_for('detail',question_id=foo.id)}}>{{ foo.title }}</a>
<span class="badge">{{ foo.creat_time }}</span>
<p class="abstract">{{ foo.detail }}</p>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% extends 'userbase.html' %}
{% block user %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/userbase.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/user.css') }}">
{% endblock %}
<div class="a1">
<h3>{{ username}}
{# <small>个人信息</small>#}
</h3><br>
<ul>
<li href={{ url_for('index' )}}>用户:{{ username}}</li>
<li>编号:{{ user.id}}</li>
<li>昵称:{{ user.nickname}}</li>
<li>文章篇数:{{ user.question|length }}</li>
<li>评论数:{{ user.comment|length }}</li>
</ul>
</div>
{% endblock %}
{% extends 'base.html' %}
{% block title %}个人中心{% endblock %}
{% block head %}
<style>
.nav1 >li{
list-style: none;
float: left;
margin: 10px;
}
</style>
{% endblock %}
{% block main %}
<div class="nav1">
<ul>
<li role="presentation"><a href="{{ url_for('usercenter',user_id=user.id ,tag='1')}}">全部问答</a></li>
<li role="presentation"><a href="{{ url_for('usercenter',user_id=user.id ,tag='2')}}">全部评论</a></li>
<li role="presentation"><a href="{{ url_for('usercenter',user_id=user.id ,tag='3')}}">个人资料</a></li>
</ul>
</div>
{% block user %}{% endblock %}
{% endblock %}
{% extends 'base.html' %}
{% block title %}个人中心{% endblock %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/usercenter.css') }}">
{% endblock %}
{% block main %}
<div class="a1">
<h3>{{ username }}<br>
<small>全部问答</small>
</h3></div>
<ul>
{% for foo in ques.question %}
<li class="list-group-item" >
<a href="#">{{ foo.author.username }} </a><br>
<a href={{ url_for('detail',question_id=foo.id)}}>{{ foo.title }}</a>
<span class="badge">{{ foo.creat_time }}</span>
<p class="abstract">{{ foo.detail }}</p>
</li>
{% endfor %}
<div class="a1">
<h3>{{ username }}<br>
<small>全部评论</small>
</h3></div>
<ul>
{% for foo in ques.comments %}
<li class="list-group-item" >
<a href="#">{{ foo.author.username }} </a><br>
<a href={{ url_for('detail',question_id=foo.id)}}>{{ foo.title }}</a>
<span class="badge">{{ foo.creat_time }}</span>
<p class="abstract">{{ foo.detail }}</p>
</li>
{% endfor %}
<div class="a1">
<h3>{{ username}}
{# <small>个人信息</small>#}
</h3><br>
<ul>
<li>用户:{{ username}}</li>
<li>编号:{{ user.id}}</li>
<li>昵称:{{ user.nickname}}</li>
<li>文章篇数:{{ user.questions|length }}</li>
</ul>
{% endblock %}