<%@ include file="/common/taglibs.jsp" %>
<head>
    <title><fmt:message key="title.setup"/></title>
    <script type="text/javascript" src="/scripts/com/jquery/jquery-1.3.2.min.js?<fmt:message key="webapp.version"/>"></script>
    <script type="text/javascript" src="/scripts/com/hedgehoglab/solomon/application/SetupApplication.js?<fmt:message key="webapp.version"/>"></script>
    <style>
    	span.Field { float: left!important; width: 30%!important; }
    	span.Field label { width: 100%!important; clear: both!important; }
    	span.Long input { width: 20em!important; }
    	span.LongField { width: 100%!important; }
    	span.LongField label { width: 70%!important; float: none!important; margin-top: 0.5em!important;  }
    	input#freeVersion { width: auto!important; }
    </style>
</head>

<div class="realContent">
	<div class="TabPanel">
	<s:form method="post" action="do" enctype="multipart/form-data">        
	<div class="Pane">
	<s:if test="hasActionErrors()">
    <div class="feedback error">
        <ul>
            <s:iterator value="actionErrors">
                <li><s:property/></li>
            </s:iterator>
        </ul>
    </div>
	</s:if>
	<%-- Success Messages --%>
	<c:if test="${not empty messages}">
	    <div class="feedback notification">
	        <ul>
	            <c:forEach var="msg" items="${messages}">
	                <li><c:out value="${msg}" escapeXml="false"/></li>
	            </c:forEach>
	        </ul>
	    </div>
	    <c:remove var="messages" scope="session"/>
	</c:if>
		<h2><fmt:message key="heading.setup"/></h2> 
		<span class="Field "><s:textfield id="email" name="email" key="label.user.admin.email" required="true" theme="xhtml" value="%{request.getParameter('email')}"/></span>
		<span class="Field "><s:password id="password" name="password" key="label.user.admin.password" required="true" theme="xhtml" value="%{request.getParameter('password')}"/></span>
		<span class="Field "><s:password id="confirmpassword" name="confirmpassword" key="label.user.admin.confirmpassword" required="true" theme="xhtml" value="%{request.getParameter('confirmpassword')}"/></span>

		<span class="Field "><s:textfield id="title" name="solomon.config.name" key="label.setup.title" theme="xhtml"  value="%{request.getParameter('fixx.config.name')}"/></span>
        <span class="Field Long">
            <s:textfield id="baseurl" name="solomon.config.baseurl" key="label.setup.baseurl" theme="xhtml" value="%{baseUrl}"/>
            <p><fmt:message key="help.setup.baseurl"/></p>                
        </span>
    </div>
	
	<div class="Pane">
		<h2><fmt:message key="heading.setup.license"/></h2>
		<c:choose>
			<c:when test="${validLicense}">
				<div class="feedback notification">
					<p>
						<fmt:message key="text.setup.validlicense"/>
					</p>
				</div>
			</c:when>
			<c:otherwise>
				<span class="Field LongField">
		    		<s:checkbox id="freeVersion" label="%{getText('label.setup.license.freeVersion')}" name="freeVersion" fieldValue="true" theme="xhtml" cssClass="Checkbox"/>
		    	</span>
				<div class="feedback Cleared" id="iFreeVersionMessage">
					<p><fmt:message key="text.setup.license.freeVersion"/></p>
					</div>
				<div id="iMultiUser">
				    <span class="Field "><s:file name="license" cssClass="text file" theme="xhtml" key="label.setup.license"/></span>
				</div>
		   </c:otherwise>
		</c:choose>
		<p><fmt:message key="help.setup.info"/></p>
	</div>

	<div class="Pane">
		<div class="Actions">
	    <ul id="submit">
	        <li>
	            <s:submit key="action.setup"/>
	        </li>
	    </ul>
	</div>
	</s:form>
	</div>
</div>
