<%
/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
%>

<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);
		%>

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

		<%
		}
		%>

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

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

	<%
	StringBundler sb = new StringBundler(4);

	sb.append(themeDisplay.getPathMain());
	sb.append("/blogs/rss?");

	if (selectionMethod.equals("users")) {
		if (organizationId > 0) {
			sb.append("organizationId=");
			sb.append(organizationId);
		}
		else {
			sb.append("companyId=");
			sb.append(company.getCompanyId());
		}
	}
	else {
		sb.append("groupId=");
		sb.append(themeDisplay.getScopeGroupId());
	}

	String rssURL = sb.toString();
	%>

	<liferay-ui:icon
		image="rss"
		label="<%= true %>"
		method="get"
		target="_blank"
		url="<%= rssURL %>"
	/>
</c:if>

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