<%@ 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/submissionArticle.js'></script>
</head>
<body>

<h4 class="title">
<c:choose>
	<c:when test="${param['action'] eq 'modify'}">
		<fmt:message key="submission.modify" />
	</c:when>
	<c:otherwise>
		<fmt:message key="submission.title" />
	</c:otherwise>
</c:choose>
</h4>

<c:choose>
<c:when test="${currentConferenceId == null}">
	<div class="warningBox">
    	<fmt:message key="article.post.noconference" />
    	<a href="<c:url value="listConference.htm"/>"><fmt:message key="home.link.choose" /></a>
    </div>
</c:when>
<c:when test="${currentConferenceId != null}">

<form:form method="post" enctype="multipart/form-data" commandName="submissionArticle" id="account_data">

<p class="legend"><fmt:message key="form.article.information" /></p>

<fieldset>
	<span class="info"><fmt:message key="form.field.necessary" /></span>
	<div>
		<form:label path="title"><fmt:message key="form.submission.article.title" /></form:label>
		<form:input path="title"/>*
		<span class="formError"><form:errors path="title" /></span>
	</div>
	<div>
		<form:label path="theme"><fmt:message key="form.submission.article.theme" /></form:label>
		<form:input path="theme"/>*
		<span class="formError"><form:errors path="theme" /></span>
	</div>
	<div>
		<form:label path="theme"><fmt:message key="form.submission.article.abstractText" /></form:label>
		<form:textarea path="abstractText" cols="60" rows="10" />*<br />
		<span class="abstractText"><form:errors path="theme" /></span>
	</div>
</fieldset>

<p class="legend"><fmt:message key="form.article.author.information" /></p>

<fieldset>
	<div>
		<form:label path="theme"><fmt:message key="form.submission.mainauthor" /></form:label>
		<b>${currentUser.firstName} ${currentUser.lastName}</b><br />
	</div>
	<div>
		<form:label path="theme"><fmt:message key="form.submission.secondaryauthor" /></form:label>
		<input id="newSecondaryAuthorInput" type="text" name="newSecondaryAuthor" />
		<input type="button" id="addSecondaryButton" name="addSecondary" value="<fmt:message key="button.add" />">
			<div id="secondaryAuthorList" class="dynamicList">
				<div class="dynamicListHeader"><fmt:message	key="form.submission.secondaryauthor" /></div>
				<c:if test="${param['action'] eq 'modify'}">
					<c:forEach items="${listSecondaryAuthors}" var="secAuthor" varStatus="i">
						<div class="dynamicListItem" style="height: 0px; width: 0px;"
							id="liste[${i.index}]">${secAuthor}<input type="hidden"
							id="liste[${i.index}]" name="liste[${i.index}]"
							value="${secAuthor}" /></div>
					</c:forEach>
				</c:if>
			</div>
		<input type="button" id="removeSecondaryButton"	name="removeSecondary" value="<fmt:message key="button.removeSelected" />" />	
	</div>
</fieldset>

<p class="legend"><fmt:message key="form.article.submit.info" /></p>

<fieldset>
	<div>
		<form:label path="file"><fmt:message key="form.article.file" /></form:label>
		<input type="file" name="file" />*
		<span class="abstractText"><form:errors path="file" /></span>
	</div>
</fieldset>


	<input type="submit" value="<fmt:message key="button.OK" />" />

</form:form>

</c:when>
</c:choose>

</body>
</html>
