<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="utf-8" />
	<title>{$tkd.title|parseTPL}</title>
	<meta name="keywords" content="{$tkd.keywords|parseTPL}" />
	<meta name="description" content="{$tkd.description|parsetpl}" />
	{include file="/system/head"}
    <link rel="stylesheet" href="{$kx.config.resurl}/template/kxwebno2/css/font-awesome.min.css">
</head>
<body>
{include file="/system/header"}
<section class="w-all booklist">
	<nav class="mt20">
		<ul class="clearfix">
            <li><a href="{$kx.config.siteurl}" title="{$kx.config.sitename}首页"><i class="pticon pticon-home pticon-lg"></i> {$kx.config.sitename}首页</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.category.list categoryid=$category.id key=$category.key}" title="{$category.name}小说">{$category.name}小说</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.comment.list novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}评论区</a></li>
		</ul>
	</nav>
	<div class="container clearfix mt20">
		<div class="w-left">
			<div class="card commentarea">

				<div class="header line">
					<h3>《{$novel.name}》小说评论详情</h3>
				</div>
                {block method="pagination" name="paginate" page=$page limit=$pagesize count=$comment.post_num maxpage=50 section=3}
                {block method="comment.replyList" name=replyList commentid=$comment.id num=$paginate.limit page=$paginate.current}
				<div class="body">
					<ul class="commentlist">
						<li class="clearfix">
							<div class="avatar">
								<a href=""><img src="{$comment.user.avatar}" alt=""></a>
								<span>{$comment.user.name}</span>
							</div>
							<div class="item">
								<div class="title">
									<span class="time">{$comment.datetime|date="Y-m-d H:i:s"}</span>
									<span class="fr" data-id="{$comment.id}">
										<a class="up" title="赞同 {$comment.good_num}"><i class="fa fa-thumbs-up"></i> <span>{$comment.good_num}</span></a>
										<a class="down" title="反对 {$comment.bad_num}"><i class="fa fa-thumbs-down"></i> <span>{$comment.bad_num}</span></a>
										<a href="{$comment.url}" title="回贴 {$comment.post_num}"><i class="fa fa-comment"></i> {$comment.post_num}</a>
										<a>楼主</a>
									</span>
								</div>
								<div class="content">
									{$comment.content|nl2br}
								</div>
							</div>
						</li>
                        {section loop=$replyList item=$loop}
						<li class="clearfix" id="p{$loop.num}">
							<div class="avatar">
								<a href="{$loop.user.space}"><img src="{$loop.user.avatar}" alt=""></a>
								<span>{$loop.user.name}</span>
							</div>
							<div class="item">
								<div class="title">
									<span class="time">{$loop.datetime|date="Y-m-d H:i:s"}</span>
									<span class="fr">
										<a>{=($page-1) * $pagesize + $i.order}楼</a>
									</span>
								</div>
								<div class="content">
									{$loop.content|nl2br}
								</div>
							</div>
						</li>
						{/loop}
					</ul>
                    <div class="footer pagination comment">
                        <span>共{$paginate.total}页 {$paginate.count}条</span>
                        {if $paginate.total>1}
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$paginate.first}" class="first number"><<</a>
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$paginate.prev}" class="prev number"><</a>
                        {loop=$paginate.items}
                        {if $loop.status}
                        <a class="current" href="javascript:;">{$loop.num}</a>
                        {else}
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$loop.num}" class="number">{$loop.num}</a>
                        {/if}
                        {/loop}
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$paginate.next}" class="next number">&gt;</a>
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$paginate.last}" class="last number">&gt;&gt;</a>
                        {/if}
                    </div>
					<div class="addcomment clearfix">
						{if IS_LOGIN}
						<form action="{link=novel.comment.reply}" method="post">
							<input type="hidden" name="comment_id" value="{$comment.id}">
							<textarea name="content" class="text"></textarea>
							<button class="btn btn-success fr">回复评论</button>
						</form>
						{else}
						<div class="tips">请您 <a href="{link=user.auth.register}">注册</a> 或 <a href="{link=user.auth.login}">登陆</a> 之后再发布评论</div>
						{/if}
					</div>
				</div>
			</div>
		</div>
		<div class="w-right">
            <div class="card pt-tab">
                <div class="header line">
                    <h3>小说信息</h3>
                </div>
                <div class="body" style="height:245px;overflow: hidden">
                    <ul class="rightlist">
                        <li><b>书名：</b><a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}">{$novel.name}</a></li>
                        <li><b>作者：</b><a href="{link=author.space.index authorid=$author.id pinyin=$author.pinyin name=$author.name}">{$author.name}</a></li>
                        <li><b>分类：</b><a href="{link=novel.category.list categoryid=$category.id key=$category.key}">{$category.name}</a></li>
                        <li><b>来源：</b>{$source.name}({$source.host})</li>
                        <li><b>点击：</b>{$data.allvisit}</li>
                        <li><b>推荐：</b>{$data.vote}</li>
                        <li><b>收藏：</b>{$data.mark}</li>
                        <li><b>评分：</b>{$data.star}</li>
                    </ul>
                </div>
            </div>
            <div class="card pt-tab mt20">
                <div class="header tab pt-tab-nav">
                    <ul class="clearfix">
                        <li class="active">本月热门</li>
                        <li>本周热门</li>
                    </ul>
                </div>
                <div class="body pt-tab-con">
                    <ul class="rightlist">
                        {block method="novel.list" name="list" order="monthvisit" num=15}
                        {section loop=$list}
                        <li><i {if $i.order<4}class="first"{/if}>{$i.order}</i><span><a href="{link=author.space.index authorid=$loop.author.id pinyin=$loop.author.pinyin name=$loop.author.name}" title="{$loop.author.name} 作品大全">{$loop.author.name}</a></span><a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" title="{$loop.novel.name}">{$loop.novel.name}</a>
                        </li>
                        {/section}
                    </ul>
                    <ul class="rightlist none">
                        {block method="novel.list" name="list" order="weekvisit" num=15}
                        {section loop=$list}
                        <li><i {if $i.order<4}class="first"{/if}>{$i.order}</i><span><a href="{link=author.space.index authorid=$loop.author.id pinyin=$loop.author.pinyin name=$loop.author.name}" title="{$loop.author.name} 作品大全">{$loop.author.name}</a></span><a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" title="{$loop.novel.name}">{$loop.novel.name}</a>
                        </li>
                        {/section}
                    </ul>
                </div>
            </div>
		</div>
	</div>
</section>
{include file="/system/footer"}
<script type="text/javascript" src="{$kx.config.resurl}/template/kxwebno2/script/jquery.raty.js"></script>
<script type="text/javascript" src="{$kx.config.resurl}/template/kxwebno2/script/layer/layer.js"></script>
<script type="text/javascript">
	$(function(){
		$('.g-star').each(function(){
			$(this).raty({score: $(this).data('score')})
		});
		$('.open').on('click',function(){
			$(this).hide();
			$('.close').show();
			$('.intro').addClass('full');
		});
		$('.close').on('click',function(){
			$(this).hide();
			$('.open').show();
			$('.intro').removeClass('full');
		});
        $('.commentlist a').on('click', function () {
            var param = {comment_id: $(this).parent().data('id')}, $num = $(this).find('span'), url;
            if ($(this).hasClass('up')) {
                url = '{link=novel.comment.rating}';
                param.action='good';
            } else if ($(this).hasClass('down')) {
                url = '{link=novel.comment.rating}';
                param.action='bad';
            } else {
                return true;
            }
            $.post(url, param, function (res) {
                if (res.code === 0) {
                    layer.alert(res.msg,{icon:6},function(i){
                        $num.text(parseInt($num.text())+1);
                        layer.close(i)
                    });
                } else {
                    layer.alert(res.msg, {icon: 5})
                }
            }, 'json')
        })
	})
</script>
</body>
</html>