<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ 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,print" />
<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="wrap1">
<div id="wrap2">
<div id="wrap3">
<div id="wrap4">

<c:import url="/include.do">
	<c:param name="path" value="/include_header.jsp" />
</c:import>

<c:import url="/blog.do?method=nav" />
	
<div id="content">
<div id="mainwrap">
<div id="main">

<div class="post" id="firstpost">
<h2 class="title"><a href="<c:url value="/articles.do?method=article&id=${article.id}"/>"><c:out value="${article.title}" /></a></h2>
<p class="postdate"><fmt:formatDate value="${article.createdOn}" pattern="${blog.dateFormat} ${blog.timeFormat}" /></p>
<p class="tags"><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 class="content">
<c:out value="${article.content}" escapeXml="false" />
</div>
</div>

<c:if test="${article.allowComment||article.allowTrackback}">

<c:if test="${article.allowTrackback}">
<div id="comments" class="comments">
<h2>引用</h2>
<div class="blognav"><p>引用地址: <A HREF="<c:url value="/articles.do?method=trackback&id=${article.id}"/>"><c:url value="${blog.options.blog_url.value}/articles.do?method=trackback&id=${article.id}"/></A></p></div>
<c:set var="number" value="1" />
<c:forEach var="trackback" items="${article.trackbacks}">
<div class="comment<c:out value="${number%2}"/>" id="trackback-<c:out value="${trackback.id}"/>">
<div class="top">
<div class="bot">
<div class="text"><p>《<A HREF="<c:out value="${trackback.url}"/>" rel='external nofollow'><c:out value="${trackback.title}" /></a>》:</p><c:out value="${trackback.excerpt}" escapeXml="false"/></div>
<p class="comment-by"><span class="comment-user"> By 
<a href='<c:out value="${trackback.url}"/>' class="username" rel='external nofollow'><c:out value="${trackback.blogName}" /></a>
, </span>  <span class="commentdate"><fmt:formatDate value="${trackback.time}" pattern="${blog.dateFormat} ${blog.timeFormat}" /></span></p>
</div>
</div>
</div>
<c:set var="number" value="${number+1}" />
</c:forEach>
</div>
</c:if>

<c:if test="${article.allowComment}">
<div class="comments">
<h2>评论</h2>
<c:set var="number" value="1" />
<c:forEach var="comment" items="${article.comments}">
<div class="comment<c:out value="${number%2}"/>" id="comment-<c:out value="${comment.id}"/>">
<div class="top">
<div class="bot">
<div class="text"><c:out value="${comment.content}" escapeXml="false"/></div>
<p class="comment-by"><span class="comment-user"> By 
<c:choose>
<c:when test="${comment.url!=''}">
<a href='<c:out value="${comment.url}"/>' class="username" rel='external nofollow'><c:out value="${comment.author}" /></a>
</c:when>
<c:otherwise>
<c:out value="${comment.author}" />
</c:otherwise>
</c:choose>, </span>  <span class="commentdate"><fmt:formatDate value="${comment.time}" pattern="${blog.dateFormat} ${blog.timeFormat}" /></span></p>
</div>
</div>
</div>
<c:set var="number" value="${number+1}" />
</c:forEach>
</div>
</c:if>

<div class="w100 m30">
<h2><span>发表评论</span></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 : "333",
			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();">
<div>
<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">评论内容:(500字以内)</label><textarea name="content"
	id="comment" 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>
</div>
</form>
</div>
</div>
</c:if>
</div>

<div id="sidewrap">
<div id="side">
	<div id="blogsearch" class="sidebox">
	<h2><label for="searchbox">搜索</label></h2>
	<form action="<c:url value="/search.do"/>" method="post" name="search" onsubmit="return validateSearchForm();">
	<div class="pad"><input name="s" value="" id="searchbox" maxlength="128" type="text"> <input src="<c:url value="/themes/${blog.options.theme_dir_name.value}/resources/images/search.gif"/>" alt="search" id="submitsearch" type="image" ></div>
	</form>
	</div>
	<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>
</div>


<c:import url="/include.do">
	<c:param name="path" value="/include_footer.jsp" />
</c:import>

</div></div></div></div></div>
</body>
</html>