From 4255dded54bdfd1eb19d6af8c2d6b48919a92de9 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Wed, 15 Feb 2017 00:23:57 +0900
Subject: [PATCH] #169

---
 src/web/app/desktop/tags/post-detail.tag | 43 +++++++++++++++++++-----
 src/web/app/mobile/tags/post-detail.tag  | 35 ++++++++++++++++---
 2 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/src/web/app/desktop/tags/post-detail.tag b/src/web/app/desktop/tags/post-detail.tag
index 01486bcb2e..e29107d5bf 100644
--- a/src/web/app/desktop/tags/post-detail.tag
+++ b/src/web/app/desktop/tags/post-detail.tag
@@ -3,7 +3,10 @@
 		<mk-ellipsis-icon></mk-ellipsis-icon>
 	</div>
 	<div class="main" if={ !fetching }>
-		<button class="read-more" if={ p.reply_to && p.reply_to.reply_to_id && context == null } title="会話をもっと読み込む" onclick={ loadContext } disabled={ loadingContext }><i class="fa fa-ellipsis-v" if={ !loadingContext }></i><i class="fa fa-spinner fa-pulse" if={ loadingContext }></i></button>
+		<button class="read-more" if={ p.reply_to && p.reply_to.reply_to_id && context == null } title="会話をもっと読み込む" onclick={ loadContext } disabled={ loadingContext }>
+			<i class="fa fa-ellipsis-v" if={ !loadingContext }></i>
+			<i class="fa fa-spinner fa-pulse" if={ loadingContext }></i>
+		</button>
 		<div class="context">
 			<virtual each={ post in context }>
 				<mk-post-detail-sub post={ post }></mk-post-detail-sub>
@@ -13,16 +16,33 @@
 			<mk-post-detail-sub post={ p.reply_to }></mk-post-detail-sub>
 		</div>
 		<div class="repost" if={ isRepost }>
-			<p><a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username } data-user-preview={ post.user_id }><img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=32' } alt="avatar"/></a><i class="fa fa-retweet"></i><a class="name" href={ CONFIG.url + '/' + post.user.username }>{ post.user.name }</a>がRepost</p>
+			<p>
+				<a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username } data-user-preview={ post.user_id }>
+					<img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=32' } alt="avatar"/>
+				</a>
+				<i class="fa fa-retweet"></i><a class="name" href={ CONFIG.url + '/' + post.user.username }>
+				{ post.user.name }
+			</a>
+			がRepost
+		</p>
 		</div>
-		<article><a class="avatar-anchor" href={ CONFIG.url + '/' + p.user.username }><img class="avatar" src={ p.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ p.user.id }/></a>
-			<header><a class="name" href={ CONFIG.url + '/' + p.user.username } data-user-preview={ p.user.id }>{ p.user.name }</a><span class="username">@{ p.user.username }</span><a class="time" href={ url }>
-					<mk-time time={ p.created_at }></mk-time></a></header>
+		<article>
+			<a class="avatar-anchor" href={ CONFIG.url + '/' + p.user.username }>
+				<img class="avatar" src={ p.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ p.user.id }/>
+			</a>
+			<header>
+				<a class="name" href={ CONFIG.url + '/' + p.user.username } data-user-preview={ p.user.id }>{ p.user.name }</a>
+				<span class="username">@{ p.user.username }</span>
+				<a class="time" href={ url }>
+					<mk-time time={ p.created_at }></mk-time>
+				</a>
+			</header>
 			<div class="body">
 				<div class="text" ref="text"></div>
 				<div class="media" if={ p.media }>
 					<virtual each={ file in p.media }><img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/></virtual>
 				</div>
+				<mk-poll if={ p.poll } post={ p }></mk-poll>
 			</div>
 			<footer>
 				<button onclick={ reply } title="返信"><i class="fa fa-reply"></i>
@@ -38,11 +58,15 @@
 			</footer>
 			<div class="reposts-and-likes">
 				<div class="reposts" if={ reposts && reposts.length > 0 }>
-					<header><a>{ p.repost_count }</a>
+					<header>
+						<a>{ p.repost_count }</a>
 						<p>Repost</p>
 					</header>
 					<ol class="users">
-						<li class="user" each={ reposts }><a class="avatar-anchor" href={ CONFIG.url + '/' + user.username } title={ user.name } data-user-preview={ user.id }><img class="avatar" src={ user.avatar_url + '?thumbnail&size=32' } alt=""/></a></li>
+						<li class="user" each={ reposts }>
+							<a class="avatar-anchor" href={ CONFIG.url + '/' + user.username } title={ user.name } data-user-preview={ user.id }>
+							<img class="avatar" src={ user.avatar_url + '?thumbnail&size=32' } alt=""/></a>
+						</li>
 					</ol>
 				</div>
 				<div class="likes" if={ likes && likes.length > 0 }>
@@ -50,7 +74,10 @@
 						<p>いいね</p>
 					</header>
 					<ol class="users">
-						<li class="user" each={ likes }><a class="avatar-anchor" href={ CONFIG.url + '/' + username } title={ name } data-user-preview={ id }><img class="avatar" src={ avatar_url + '?thumbnail&size=32' } alt=""/></a></li>
+						<li class="user" each={ likes }>
+							<a class="avatar-anchor" href={ CONFIG.url + '/' + username } title={ name } data-user-preview={ id }>
+							<img class="avatar" src={ avatar_url + '?thumbnail&size=32' } alt=""/></a>
+						</li>
 					</ol>
 				</div>
 			</div>
diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag
index 8f8c8bd5ac..35e20f65fc 100644
--- a/src/web/app/mobile/tags/post-detail.tag
+++ b/src/web/app/mobile/tags/post-detail.tag
@@ -3,7 +3,10 @@
 		<mk-ellipsis-icon></mk-ellipsis-icon>
 	</div>
 	<div class="main" if={ !fetching }>
-		<button class="read-more" if={ p.reply_to && p.reply_to.reply_to_id && context == null } onclick={ loadContext } disabled={ loadingContext }><i class="fa fa-ellipsis-v" if={ !loadingContext }></i><i class="fa fa-spinner fa-pulse" if={ loadingContext }></i></button>
+		<button class="read-more" if={ p.reply_to && p.reply_to.reply_to_id && context == null } onclick={ loadContext } disabled={ loadingContext }>
+			<i class="fa fa-ellipsis-v" if={ !loadingContext }></i>
+			<i class="fa fa-spinner fa-pulse" if={ loadingContext }></i>
+		</button>
 		<div class="context">
 			<virtual each={ post in context }>
 				<mk-post-preview post={ post }></mk-post-preview>
@@ -13,15 +16,31 @@
 			<mk-post-preview post={ p.reply_to }></mk-post-preview>
 		</div>
 		<div class="repost" if={ isRepost }>
-			<p><a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username }><img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=32' } alt="avatar"/></a><i class="fa fa-retweet"></i><a class="name" href={ CONFIG.url + '/' + post.user.username }>{ post.user.name }</a>がRepost</p>
+			<p>
+				<a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username }>
+					<img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=32' } alt="avatar"/></a>
+					<i class="fa fa-retweet"></i><a class="name" href={ CONFIG.url + '/' + post.user.username }>
+					{ post.user.name }
+				</a>
+				がRepost
+			</p>
 		</div>
 		<article>
-			<header><a class="avatar-anchor" href={ CONFIG.url + '/' + p.user.username }><img class="avatar" src={ p.user.avatar_url + '?thumbnail&size=64' } alt="avatar"/></a><div><a class="name" href={ CONFIG.url + '/' + p.user.username }>{ p.user.name }</a><span class="username">@{ p.user.username }</span></div></header>
+			<header>
+				<a class="avatar-anchor" href={ CONFIG.url + '/' + p.user.username }>
+					<img class="avatar" src={ p.user.avatar_url + '?thumbnail&size=64' } alt="avatar"/>
+				</a>
+				<div>
+					<a class="name" href={ CONFIG.url + '/' + p.user.username }>{ p.user.name }</a>
+					<span class="username">@{ p.user.username }</span>
+				</div>
+			</header>
 			<div class="body">
 				<div class="text" ref="text"></div>
 				<div class="media" if={ p.media }>
 					<virtual each={ file in p.media }><img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/></virtual>
 				</div>
+				<mk-poll if={ p.poll } post={ p }></mk-poll>
 			</div><a class="time" href={ url }>
 				<mk-time time={ p.created_at } mode="detail"></mk-time></a>
 			<footer>
@@ -42,7 +61,10 @@
 						<p>Repost</p>
 					</header>
 					<ol class="users">
-						<li class="user" each={ reposts }><a class="avatar-anchor" href={ CONFIG.url + '/' + user.username } title={ user.name }><img class="avatar" src={ user.avatar_url + '?thumbnail&size=32' } alt=""/></a></li>
+						<li class="user" each={ reposts }>
+							<a class="avatar-anchor" href={ CONFIG.url + '/' + user.username } title={ user.name }>
+							<img class="avatar" src={ user.avatar_url + '?thumbnail&size=32' } alt=""/></a>
+						</li>
 					</ol>
 				</div>
 				<div class="likes" if={ likes && likes.length > 0 }>
@@ -50,7 +72,10 @@
 						<p>いいね</p>
 					</header>
 					<ol class="users">
-						<li class="user" each={ likes }><a class="avatar-anchor" href={ CONFIG.url + '/' + username } title={ name }><img class="avatar" src={ avatar_url + '?thumbnail&size=32' } alt=""/></a></li>
+						<li class="user" each={ likes }>
+							<a class="avatar-anchor" href={ CONFIG.url + '/' + username } title={ name }>
+							<img class="avatar" src={ avatar_url + '?thumbnail&size=32' } alt=""/></a>
+						</li>
 					</ol>
 				</div>
 			</div>