<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="com.blogmethods.basic.domain.Article"%>
<%@ include file="/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><c:out value="${blog.title}"/> - <c:out value="${article.title}"/></title>
<meta name="generator" content="BlogMethods Basic 1.0.0" />
<meta name="description" content="<c:out value="${article.excerpt}" />" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="<c:url value="/themes/${blog.options.theme_dir_name.value}/resources/styles/style.css"/>" type="text/css" media="screen, projection" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<c:url value="/feeds/"/>" />
<link rel="shortcut icon" href="<c:url value="/favicon.ico"/>" type="image/x-icon" />
<script src="<c:url value="/js/blog.js"/>" type="text/javascript" language="JavaScript"></script>
</head>

<body>

<div id="container">
<c:import url="/include.do">
	<c:param name="path" value="/include_header.jsp" />
</c:import>
<c:import url="/blog.do?method=nav"/>


<hr class="low" />

<!-- content ................................. -->
<div id="content">

<div class="entry single">

<h2><a
	href="<c:url value="/articles.do?method=article&id=${article.id}"/>"><c:out
	value="${article.title}" /></a></h2>

<p class="info"><em class="date"><fmt:formatDate value="${article.createdOn}"
	pattern="${blog.dateFormat} ${blog.timeFormat}" /></em></p>
<c:out value="${article.content}" escapeXml="false" />

<p id="filedunder">标签: &nbsp;<c:forEach var="tag"	items="${article.tags}">&nbsp;
	<a href="<c:url value="/articles.do?method=byTag&id=${tag.id}"/>"
		rel="tag"><c:out value="${tag.title}" /></a></c:forEach></p>
</div>

<c:if test="${article.allowComment||article.allowTrackback}">
<hr class="low" />
<!-- comments ................................. -->
<div id="comments">
<c:if test="${article.allowTrackback}">
<h2><c_rt:out value="<%=((Article)request.getAttribute("article")).getTrackbacks().size()+""%>" />条引用<a href="<c:url value="/articles.do?method=trackback&id=${article.id}"/>"
	class="more">引用链接</a></h2>
<ul>
	<c:set var="number" value="1" />
	<c:forEach var="trackback" items="${article.trackbacks}">
		<li id="comment-<c:out value="${trackback.id}"/>" class="trackback">
		<p class="header <c:if test="${number%2==0}">alt</c:if>"><strong><c:out value="${number}" />.</strong><c:out
			value="${trackback.blogName}" /> &nbsp;|&nbsp; <fmt:formatDate
			value="${trackback.time}" pattern="${blog.dateFormat} ${blog.timeFormat}" /></p>
		<p>引用来自<A HREF="<c:out value="${trackback.url}"/>"
			rel='external nofollow'>《<c:out value="${trackback.title}" />》:</A></p>
		<p><c:out value="${trackback.excerpt}" escapeXml="false"/></p>
		</li>
		<c:set var="number" value="${number+1}" />
	</c:forEach>
</ul>
</c:if>
<c:if test="${article.allowComment}">
<h2><c_rt:out value="<%=((Article)request.getAttribute("article")).getComments().size()+""%>" />条评论<a
	href="#commentform" class="more">我要评论</a></h2>
<ul>
	<c:set var="number" value="1" />
	<c:forEach var="comment" items="${article.comments}">
		<li id="comment-<c:out value="${comment.id}"/>" class="comment">
		<p class="header"><strong><c:out value="${number}" />.</strong>
		<c:choose>
		<c:when test="${comment.url!=''}">
		<a href='<c:out value="${comment.url}"/>' rel='external nofollow'><c:out value="${comment.author}" /></a>
		</c:when>
		<c:otherwise>
		<c:out value="${comment.author}" />
		</c:otherwise>
		</c:choose>
		&nbsp;|&nbsp; <fmt:formatDate
			value="${comment.time}" pattern="${blog.dateFormat} ${blog.timeFormat}" /></p>
		<c:out value="${comment.content}" escapeXml="false"/></li>
		<c:set var="number" value="${number+1}" />
	</c:forEach>
</ul>
<h2>发表评论</h2>
<script src="<c:url value="/js/tiny_mce/tiny_mce.js"/>" type="text/javascript" language="JavaScript"></script>
<script type="text/javascript" language="JavaScript"><!--
tinyMCE.init(
			{mode : "exact",
			elements : "comment",
			width : "338",
			height: "200",
			editor_css : "<c:url value="/js/tiny_mce/themes/advanced/css/editor_ui2.css"/>",
			language: "zh_cn_utf8",
			theme : "advanced",
			theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,link,unlink",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_resizing : false,
			browsers : "msie,gecko,opera",
			dialog_type : "modal",
			theme_advanced_resize_horizontal : true,
			entity_encoding : "raw",
			relative_urls : false,
			remove_script_host : false,
			force_p_newlines : true,
			force_br_newlines : false,
			convert_newlines_to_brs : false,
			remove_linebreaks : true,
			auto_reset_designmode : true }
		);
//--> </script>
<form name="commentform" action="<c:url value="/articles.do?method=comment"/>" method="post" id="commentform" onsubmit="return validateCommentForm();">
<fieldset>
<p><label for="author">姓名:</label><input type="text" name="author"
	id="author" value="" tabindex="1" maxlength="100"/><em>需要</em></p>
<p><label for="email">Email:</label> <input type="text" name="email"
	id="email" value="" tabindex="2" maxlength="75"/><em>需要, 隐藏</em></p>
<p><label for="url">链接:</label> <input type="text" name="url" id="url"
	value="" tabindex="3" maxlength="100"/></p>
<p><label for="comment">评论内容:<br/><em>(500字以内)</em></label><textarea name="content"
	id="comment" cols="45" rows="10" tabindex="4"></textarea></p>
<p><label>&nbsp;</label><input type="hidden" name="article_id" value="<c:out value="${article.id}"/>" /><input
	type="submit" name="submit" value="提交" class="button" tabindex="5" /></p>
</fieldset>
</form>
</c:if>
</div><!-- /comments -->
</c:if>
</div><!-- /content -->

<hr class="low" />

<!-- subcontent ................................. -->
<div id="subcontent">
<fmt:formatDate var="date" value="${article.createdOn}" pattern="yyyy-MM"/>
<c:import url="/articles.do?method=calendar"><c:param name="date" value="${date}"/></c:import>
<c:import url="/articles.do?method=recentArticles" />
<c:import url="/include.do"><c:param name="path" value="/include_feeds.jsp" /></c:import>
</div>
<!-- /subcontent -->

<hr class="low" />

<c:import url="/include.do">
	<c:param name="path" value="/include_footer.jsp" />
</c:import></div>
<!-- /container -->
</body>

</html>
