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

<%
boolean readEntry = false;

try {
	AnnouncementsFlagLocalServiceUtil.getFlag(user.getUserId(), entry.getEntryId(), AnnouncementsFlagConstants.READ);

	readEntry = true;
}
catch (NoSuchFlagException nsfe1) {
	try {
		AnnouncementsFlagLocalServiceUtil.getFlag(user.getUserId(), entry.getEntryId(), AnnouncementsFlagConstants.HIDDEN);

		readEntry = true;
	}
	catch (NoSuchFlagException nsfe2) {
	}
}

if (readEntry) {
	className += " read";
}

if (entry.getPriority() > 0) {
	className += " important";
}
%>

<div class="entry<%= className %>" id="<portlet:namespace /><%= entry.getEntryId() %>">
	<h3 class="entry-title">
		<c:choose>
			<c:when test="<%= Validator.isNotNull(entry.getUrl()) %>">
				<a class="entry-url" href="<%= entry.getUrl() %>"><%= HtmlUtil.escape(entry.getTitle()) %></a>
			</c:when>
			<c:when test="<%= Validator.isNull(entry.getUrl()) %>">
				<%= HtmlUtil.escape(entry.getTitle()) %>
			</c:when>
		</c:choose>

		<c:if test='<%= !tabs1.equals("preview") %>'>
			<%@ include file="/html/portlet/announcements/entry_action.jspf" %>
		</c:if>
	</h3>

	<%
	boolean showScopeName = false;
	%>

	<p class="<%= readEntry ? "aui-helper-hidden" : "" %> entry-content entry-type-<%= entry.getType() %>">
		<%@ include file="/html/portlet/announcements/entry_scope.jspf" %>

		<%= HtmlUtil.escape(entry.getContent()) %>
	</p>
</div>