<%@ 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="${date}"/>”存档</title>
<meta name="generator" content="BlogMethods Basic 1.0.0" />
<meta name="description" content="" />
<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">
	<c:param name="selected" value="index" />
</c:import>

<div id="content">
<div id="mainwrap">
<div id="main">

<h2 id="archive"><c:out value="${date}"/></h2>
<c:forEach var="article" items="${pageResult.results}">
<div class="post">
<h2 class="title"><a href="<c:url value="/articles.do?method=article&id=${article.id}"/>" title="Permalink"><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}"/>"><c:out value="${tag.title}"/></a>, </c:forEach></p>
<div class="content"><c:out value="${article.content}" escapeXml="false" /></div>
<p class="postinfo"><span><a href="<c:url value='/articles.do?method=article&id=${article.id}'/>#comments"><span><c_rt:out value="<%=((Article)pageContext.getAttribute("article")).getComments().size()+""%>"/></span> 条评论</a></span> | <span ><a href="<c:url value='/articles.do?method=article&id=${article.id}'/>#trackbacks" class="trackbacklink"><span><c_rt:out value="<%=((Article)pageContext.getAttribute("article")).getTrackbacks().size()+""%>"/></span> 条引用</a></span></p>
</div>
</c:forEach>

<p class="pagebar">
		<c:if test="${pageResult.pageIndex!=1}"><A HREF="<c:url value="/articles.do?method=byArchive&date=${sDate}&p=${pageResult.prevIndex}"/>">上一页</A></c:if>
		<c:set var="begin" value="1"/>
		<c:if test="${(pageResult.pageIndex-6)>0}"><c:set var="begin" value="${pageResult.pageIndex-6}"/></c:if>
		<c:set var="end" value="${pageResult.pagesAmount}"/>
		<c:if test="${pageResult.pagesAmount==0}"><c:set var="end" value="1"/></c:if>
		<c:if test="${(pageResult.pagesAmount-pageResult.pageIndex)>5}"><c:set var="end" value="${pageResult.pageIndex+4}"/></c:if>
		<c:forEach var="i" begin="${begin}" end="${end}">
		<c:choose>
		<c:when test="${i==pageResult.pageIndex}"><em><c:out value="${i}"/></em></c:when>
		<c:otherwise><a href="<c:url value="/articles.do?method=byArchive&date=${sDate}&p=${i}"/>"><c:out value="${i}"/></a></c:otherwise>
		</c:choose>
		</c:forEach>
		<c:if test="${(pageResult.pagesAmount-pageResult.pageIndex)>0}"><A HREF="<c:url value="/articles.do?method=byArchive&date=${sDate}&p=${pageResult.nextIndex}"/>">下一页</A></c:if>
		<span>(共<b><c:out value="${pageResult.allResultsAmount}"/></b>篇文章)</span></p>
</div>
</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="get" 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" onclick="document.forms.search.submit();"></div>
	</form>
	</div>
	<c:import url="/pages.do?method=pages" /> 
	<c:import url="/articles.do?method=tags" /> 
	<c:import url="/articles.do?method=recentArticles" /> 
	<c:import url="/articles.do?method=recentComments" /> 
	<c:import url="/articles.do?method=recentTrackbacks" /> 
	<c:import url="/articles.do?method=archives" /> 
	<c:import url="/links.do" />
	<c:import url="/message.do?method=recentMessages"/>
	<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>
