<%@ include file="/WEB-INF/decorators/include.jsp"%>

<html>
<head>
<script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript' src='./javascripts/scriptaculous.js'></script>
<script type='text/javascript' src='./javascripts/effects.js'></script>
<script type='text/javascript' src='./javascripts/yacos/manageArticle.js'></script>
</head>
<body>

<h4 class="title"><fmt:message key="manageArticle.title" /></h4>

<c:if test="${param['delete'] eq 'ok'}">
	<p class="formOk">
		Your article has been successfully deleted.<br/>
	</p>
</c:if>

<c:if test="${param['delete'] eq 'ko'}">
	<p class="errorBox">
		Your article cannot be deleted.<br/>
	</p>
</c:if>

<c:choose>
<c:when test="${empty listArticle}">
	<div class="warningBox">
		You have no article at the moment.<br />
		You can submit an article by clicking 
		<a href="submissionArticle.htm">here</a>
		or using the menu item.<br />
	</div>
</c:when>
<c:otherwise>
	<div id="articleList" class="dynamicFredList">
	<c:forEach var="article" items="${listArticle}" varStatus="i">

	<div id="articleLine${i.index}" align="center" class="articleLine">${article.title}</div>
	
	<div id="articleDetails${i.index}" style="display: none;">
	<table width="100%">
		<tr>
			<td rowspan="3" width="75%">
				<b>Secondary Authors:</b>
					<c:forEach var="sAuthor" items="${article.secondaryAuthors}">
						${sAuthor},&nbsp;				
					</c:forEach>
				<br /><br />
				<b>Topic : </b>
					${article.topic}
				<br /><br />
				<b>Abstract : </b>
					${article.abstractText}
			</td>
			<td align="right" width="25%">
				<a class="manage_link" id="articleURL${i.index}" title="Download" href="<c:url value="/download.htm"><c:param name="articleId" value="${article.id}"/></c:url>">
					Download<img src="./images/cc-download_manager-32x32.png" alt="Download" />
				</a>
			</td>
		</tr>
		<tr>
			<td align="right" width="25%">
				<c:choose>
					<c:when test="${article.state == 'EVALUATED' or article.state == 'REJECTED' or article.state == 'ACCEPTED'}">
						<a href="<c:url value="listReportAuthor.htm?id=${article.id}"/>">
							<fmt:message	key="validate.report" />
						</a>
					</c:when>
					<c:otherwise>
						<a class="manage_link" id="modifyArticle${i.index}" title="Modify" href="<c:url value="/submissionArticle.htm"><c:param name="action" value="modify"/><c:param name="articleID" value="${article.id}"/></c:url>">
							Modify<img src="./images/cc-kedit-32x32.png" alt="Modify" />		
						</a>
					</c:otherwise>
				</c:choose>
			</td>
		</tr>
		<tr>
			<td align="right" width="25%">
				<c:if test="${article.state != 'EVALUATED' and article.state != 'REJECTED' and article.state != 'ACCEPTED'}">
					<a class="manage_link" id="suppressArticle${i.index}" title="Delete" href="javascript:deleteArticle(${article.id});">
						Delete<img src="./images/cc-button_cancel-32x32.png" alt="Delete"/>
					</a>
				</c:if>
			</td>
		</tr>
		</table>

	</div>
	
	</c:forEach>
	</div>
</c:otherwise>

</c:choose>

</body>
</html>