<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<c:choose>
	<c:when test="<%= results.isEmpty() %>">
		<liferay-ui:message key="there-are-no-blogs" />

		<br /><br />
	</c:when>
	<c:otherwise>

		<%
		for (int i = 0; i < results.size(); i++) {
			BlogsEntry entry = (BlogsEntry)results.get(i);

			Date displayDate = entry.getDisplayDate();

			if (displayDate.after(new Date())) {
				searchContainer.setTotal(searchContainer.getTotal() - 1);

				continue;
			}
		%>

			<%@ include file="/blogs_aggregator/view_entry_content.jspf" %>

		<%
		}
		%>

	</c:otherwise>
</c:choose>

<c:if test="<%= enableRSS %>">

	<%
	String rssURLParams = null;

	if (selectionMethod.equals("users")) {
		if (organizationId > 0) {
			rssURLParams = "&organizationId=" + organizationId;
		}
		else {
			rssURLParams = "&companyId=" + company.getCompanyId();
		}
	}
	else {
		rssURLParams = "&groupId=" + themeDisplay.getScopeGroupId();
	}
	%>

	<liferay-rss:rss
		delta="<%= rssDelta %>"
		displayStyle="<%= rssDisplayStyle %>"
		feedType="<%= rssFeedType %>"
		url='<%= themeDisplay.getPathMain() + "/blogs/rss?plid=" + plid + rssURLParams %>'
	/>
</c:if>

<c:if test="<%= !results.isEmpty() %>">
	<div class="search-container">
		<liferay-ui:search-paginator
			searchContainer="<%= searchContainer %>"
		/>
	</div>
</c:if>