<%--
/**
 * 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.
 *
 *
 *
 */
--%>

<%
User topUser = UserLocalServiceUtil.fetchUserById(statsUser.getUserId());
%>

<c:if test="<%= topUser != null %>">
	<liferay-ui:search-container-column-text>
		<liferay-ui:user-portrait
			userId="<%= statsUser.getUserId() %>"
		/>
	</liferay-ui:search-container-column-text>

	<%
	String[] ranks = MBStatsUserLocalServiceUtil.getUserRank(themeDisplay.getSiteGroupId(), themeDisplay.getLanguageId(), statsUser.getUserId());
	%>

	<liferay-ui:search-container-column-text
		colspan="<%= 2 %>"
	>
		<p class="list-group-title">
			<%= HtmlUtil.escape(topUser.getFullName()) %>
		</p>

		<c:if test="<%= Validator.isNotNull(ranks[0]) %>">
			<p class="list-group-subtitle"><liferay-ui:message key="rank" />: <%= HtmlUtil.escape(ranks[0]) %></p>
		</c:if>

		<p class="list-group-subtitle">
			<c:choose>
				<c:when test="<%= statsUser.getMessageCount() == 1 %>">
					<liferay-ui:message key="post" />: <%= statsUser.getMessageCount() %>
				</c:when>
				<c:otherwise>
					<liferay-ui:message key="posts" />: <%= statsUser.getMessageCount() %>
				</c:otherwise>
			</c:choose>
		</p>

		<p class="list-group-subtitle">
			<liferay-ui:message key="join-date" />: <%= dateFormatDate.format(topUser.getCreateDate()) %>
		</p>

		<p class="list-group-subtitle">
			<liferay-ui:message key="last-post-date" />: <%= dateFormatDate.format(statsUser.getLastPostDate()) %>
		</p>
	</liferay-ui:search-container-column-text>
</c:if>