<div class="mdui-container">
	<h1 style="font-weight: 400;">{{post.title}}</h1>
	<p style="font-weight:100;">
		<i class="mdui-icon material-icons">{{tags.icon}}</i><a class="mdui-ripple" href="/t/{{ tags.id }}"
			style="text-decoration: none;color:#0c0d0e;font-weight:100;">{{post.tags}}</a> > <a class="mdui-ripple"
			href="/p/{{ post.id }}" style="text-decoration: none;color:#0c0d0e;font-weight:100;">{{post.title}}</a>
		{%if post.lock%}<i class="mdui-icon material-icons" mdui-tooltip="{content: '讨论已被锁定'}"
			style="color: #1C6BF5">lock</i>{%endif%}{%if post.top%}<i class="mdui-icon material-icons"
			mdui-tooltip="{content: '讨论已被顶置'}"
			style="color: #FF0000;">assistant_photo</i>{%endif%}{%if user.user_group=='管理员'%}<i
			class="mdui-icon material-icons" mdui-tooltip="{content: '由管理员发布'}"
			style="color:#1CF53D">assignment_turned_in</i>{%endif%}{%if userObj in post.star_user_list and auth%}<i
			class="mdui-icon material-icons" mdui-tooltip="{content: '星标讨论'}"
			style="color:#FFC300;">stars</i>{% endif %}<i class="mdui-icon material-icons">remove_red_eye</i> 浏览
		{{ post.read()}}
	</p>
	<div class="mdui-divider">
	</div>
	<br>
	<br>
	<div class="mdui-row mdui-row-gapless">
		<div class="mdui-col-xs-10">
			<!--Title And Tags-->
			<div class="mdui-row mdui-row-gapless">
				<div class="mdui-col-xs-1">
					<a href="/u/{{ user.id }}"><img width="60" height="60" class="mdui-img-circle"
							mdui-tooltip="{content: '{{ user.nickname }}'}" src="{{ user.avater }}" /></a>
				</div>
				<div class="mdui-col-xs-9">
					<a href="/u/{{ user.id }}" style="font-weight: 500;text-decoration: none;color:#0c0d0e;"
						mdui-tooltip="{content: '{{ user.nickname }}'}">{{user.nickname}} </a>最后编辑于
					{{getTimer(post.pushingtime)}}
					<div class=" mdui-typo">
						<br>
						{{post.body}}
					</div>
				</div>
				<div class="mdui-col-xs-2">
				</div>
			</div>
			<div class="mdui-row mdui-row-gapless">
				<div class="mdui-col-xs-11">
				</div>
				<div class="mdui-col-xs-1">
					<i class="mdui-icon material-icons" mdui-menu="{target: '#post-op'}" mdui-btn-icon>more_vert</i>
					<ul class="mdui-menu" id="post-op">
						<li class="mdui-menu-item">{%if userObj in post.star_user_list and auth%}{%else%}<a
								class="mdui-ripple" href="/stared/{{ post.id }}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">star_border</i>设为星标</a>
						<li class="mdui-divider"></li>
						
						{%endif%}
						{% if userObj != '' %}
						{% for i in post_menu %}
						{% if i["type"] == "options" %}
						<li class="mdui-menu-item"><a href="{{ i["url"] }}" class="mdui-ripple"><i
									class="mdui-menu-item-icon mdui-icon material-icons">{{ i["icon"] }}</i>{{ i["name"] }}</a>
						</li>
						{% else %}
						<li class="mdui-divider"></li>
						{% endif %}
						{% endfor %}
						{% endif %}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="#reply"
								style="text-decoration: none;color:#0c0d0e;"><i
									class="mdui-menu-item-icon mdui-icon material-icons">chat_bubble</i>回复</a></li>
						{%if userObj.user_group=='管理员'and auth and not post.top%}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="/top/{{post.id}}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">pin_drop</i>设为顶置</a></li>
						{%endif%}{%if userObj.user_group=='管理员'and auth and post.top%}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="/untop/{{post.id}}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">pin_drop</i>取消顶置</a></li>
						{%endif%}{%if post.lock==False and userObj.user_group=='管理员'and auth%}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="/lock/{{post.id}}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">lock</i>锁定</a></li>
						{%endif%}{%if post.lock and userObj.user_group=='管理员'and auth%}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="/unlock/{{post.id}}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">lock_open</i>取消锁定</a>
						</li>
						{%endif%}{%if (userObj.user_group == '管理员') or (userObj.id == int(post.pusher))%}
						<li class="mdui-menu-item"><a class="mdui-ripple" href="/rmpost/{{post.id}}"><i
									class="mdui-menu-item-icon mdui-icon material-icons">delete</i>删除</a></li>
						{%endif%}
					</ul>
				</div>
			</div>
			<br />
			<p style="font-weight:300;">
				{%for i in post.star_user_list[:13]%} {{i.nickname}}
				,{%endfor%}等{{len(list(post.star_user_list))}}人将帖子设为星标
			</p>
			<br /><br />{%for a in ReplyList%}
			<div class="mdui-divider">
			</div>
			<br>
			<br>
			<div class="mdui-row mdui-row-gapless">
				<div class="mdui-col-xs-1">
					<a href="/u/{{a.user.id}}"><img width="60" height="60" class="mdui-img-circle"
							mdui-tooltip="{content:'{{ a.user.nickname }}'}" src="{{a.user.avater}}" /></a>
				</div>
				<div class="mdui-col-xs-9">
					<a href="/u/{{a.user.id}}" style="font-weight:500;text-decoration:none;color:#0c0d0e;"
						mdui-tooltip="{content:'{{ a.user.nickname }}'}">{{a.user.nickname}}</a> 回复于
					{{getTimer(a.reply.pushingtime)}}<br>
					<br>
					<div class="mdui-typo">
						{{a.reply.body}}
					</div>
				</div>
				<div class="mdui-col-xs-2">
				</div>
			</div>
			<div class="mdui-row mdui-row-gapless">
				<div class="mdui-col-xs-11">
				</div>
				<div class="mdui-col-xs-1">
					{%if (userObj.user_group=='管理员') or (userObj.id == int(a.reply.pusher))%}<i
						class="mdui-icon material-icons mdui-btn-icon mdui-btn-icon"
						mdui-menu="{target:'#post-op{{ a.reply.id }}'}">more_vert</i><br>
					<br>
					<br>
					<ul class="mdui-menu" id="post-op{{a.reply.id}}">
						<li class=" mdui-menu-item"><a class="mdui-ripple" href="/rmreply/{{ a.reply.id }}"><i
									class="mdui-menu-item-icon mdui-icon material-icons ">delete</i>删除</a></li>
						<li class=" mdui-menu-item"><a class="mdui-ripple"><i
									class="mdui-menu-item-icon mdui-icon material-icons" href="#reply">forum</i>回复</a>
						</li>
					</ul>
					{%endif%}
				</div>
			</div>
			{%endfor%}
			<!--Wrie Reply-->
			<link rel="stylesheet" type="text/css" href="/static/simditor/styles/simditor.css" />
			<script type="text/javascript" src="/static/simditor-2.3.28/site/assets/scripts/jquery.min.js"></script>
			<script type="text/javascript" src="/static/simditor-2.3.28/site/assets/scripts/module.js"></script>
			<script type="text/javascript" src="/static/simditor-2.3.28/site/assets/scripts/hotkeys.js"></script>
			<script type="text/javascript" src="/static/simditor-2.3.28/site/assets/scripts/uploader.js"></script>
			<script type="text/javascript" src="/static/simditor-2.3.28/site/assets/scripts/simditor.js"></script>
			<div id="reply" class="mdui-container">
				<form method="POST" action="/postreply/{{ post.id }}" style="padding-bottom: 100px;">
					<br /><textarea name="body" id="editor" placeholder="编辑回复(默认参与讨论组并订阅)" autofocus=""></textarea>
					<script>var editor = new Simditor({ toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', 'ol', 'ul', 'blockquote', 'code', 'table', 'link', 'image', 'hr', 'alignment'], textarea: '#editor', placeholder: '编辑回复(默认参与讨论组并订阅)', imageButton: ['upload'], upload: { url: '', params: null, fileKey: 'upload_file', connectionCount: 3, leaveConfirm: 'Uploading is in progress, are you sure to leave this page?' } });</script>
					<script>
						function reply(body) {
							editor.setValue = editor.getValue + "<br>回复<code>" + body + "</code>"
						}	
					</script>
					{% if auth and (not post.lock) %}
					<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent mdui-text-color-white"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;">回复</button>{% elif not auth %}<button
						class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent mdui-text-color-white"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;"
						disabled>登入后回复</button>{% else %}<button
						class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent mdui-text-color-white"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;"
						disabled>讨论被锁定</button>{% endif %}
				</form>
			</div>
		</div>
		<!--Right Column-->
		<div class="mdui-col-xs-2">
			<div class="mdui-container">
				{%if userObj==''%}
				<button class="mdui-btn mdui-btn-raised mdui-btn-block mdui-ripple mdui-color-grey">
					<div mdui-tooltip="{content: '注册/登入'}" mdui-menu="{target: '#account-op'}"
						class="mdui-text-color-white mdui-btn-block"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;">
						<i class="mdui-icon material-icons mdui-text-color-white">account_circle</i> 登入后回复
					</div>
				</button>{%elif not post.lock%}
				<button class="mdui-btn mdui-btn-raised mdui-btn-block mdui-ripple mdui-color-theme-accent">
					<a href="#reply" mdui-tooltip="{content: '回复以参与'}" class="mdui-text-color-white mdui-btn-block"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;">
						<i class="mdui-icon material-icons mdui-text-color-white">textsms</i> 回复以参与
					</a>
				</button>{%else%}
				<button class="mdui-btn mdui-btn-raised mdui-btn-block mdui-ripple mdui-color-grey">
					<a href="#" mdui-tooltip="{content: '讨论被锁定'}" class="mdui-text-color-white mdui-btn-block"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;">
						<i class="mdui-icon material-icons mdui-text-color-white">lock</i> 讨论被锁定
					</a>
				</button>
				{%endif%}<br>
				{% if not userObj == '' %}
				{%if not userObj in post.star_user_list and auth%}
				<button class="mdui-btn mdui-btn-raised mdui-btn-block mdui-ripple mdui-color-amber">
					<a href="/stared/{{ post.id }}" mdui-tooltip="{content: '设为星标'}"
						class="mdui-text-color-white mdui-btn-block"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e;margin-right: 45px;">
						<i class="mdui-icon material-icons">stars</i> 设为星标
					</a>
				</button>
				{%else%}
				<button class="mdui-btn mdui-btn-raised mdui-btn-block mdui-ripple mdui-color-amber">
					<a href="/unstar/{{ post.id }}" mdui-tooltip="{content: '取消星标星标'}"
						class="mdui-text-color-white mdui-btn-block"
						style="text-decoration: none;font-weight: 300;color:#0c0d0e; margin-right: 45px;">
						<i class="mdui-icon material-icons mdui-text-color-white">stars</i> 取消星标
					</a>
				</button>
				{%endif%}
				{%endif%}<br><br><br><br>
				<h3><i class="mdui-icon material-icons">supervisor_account</i> 参与者</h3>
				{% for i in post.getParticipant() %}
				<ul class="mdui-list mdui-list-dense">
					<a href="/u/{{ i.id }}" class="mdui-list-item">
						<div class="mdui-list-item-avatar"><img src="{{ i.avater }}" /></div>
						<div class="mdui-list-item-content">{{ i.nickname }}</div>
					</a>
				</ul>
				{% endfor %}


			</div>
		</div>
	</div>
	<!--End Write Reply--><br />
	<!--End Body and Reply-->
</div>