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

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	name="thread"
>

	<%
	String[] threadPriority = MBUtil.getThreadPriority(mbGroupServiceSettings, themeDisplay.getLanguageId(), thread.getPriority());
	%>

	<c:if test="<%= (threadPriority != null) && (thread.getPriority() > 0) %>">
		<span class="text-default <%= threadPriority[1] %>" title="<%= HtmlUtil.escapeAttribute(threadPriority[0]) %>"></span>
	</c:if>

	<c:if test="<%= thread.isLocked() %>">
		<i class="icon-lock" title="<liferay-ui:message key="thread-locked" />"></i>
	</c:if>

	<c:if test="<%= message != null %>">
		<%= message.getSubject() %>
	</c:if>
</liferay-ui:search-container-column-text>

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	name="started-by"
	value='<%= ((message == null) || message.isAnonymous()) ? LanguageUtil.get(request, "anonymous") : PortalUtil.getUserName(message) %>'
/>

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	name="replies"
	value="<%= String.valueOf(Math.max(thread.getMessageCount() - 1, 0)) %>"
/>

<liferay-ui:search-container-column-text
	href="<%= rowURL %>"
	name="views"
	value="<%= String.valueOf(thread.getViewCount()) %>"
/>

<liferay-ui:search-container-column-user
	date="<%= thread.getLastPostDate() %>"
	name="last-post"
	property="lastPostByUserId"
	userId="<%= thread.getLastPostByUserId() %>"
/>

<c:if test='<%= mvcRenderCommandName.equals("/message_boards/view_my_posts") %>'>
	<liferay-ui:search-container-column-status
		href="<%= rowURL %>"
		name="status"
		status="<%= thread.getStatus() %>"
	/>
</c:if>

<%
row.setObject(new Object[] {message, threadSubscriptionClassPKs});
%>

<c:if test="<%= message != null %>">
	<liferay-ui:search-container-column-jsp
		align="right"
		cssClass="entry-action"
		path="/message_boards/message_action.jsp"
	/>
</c:if>