<%@ include file="/common/taglibs.jsp" %>
<head>
    <title><fmt:message key="title.setup"/></title>
    <script type="text/javascript" src="/scripts/jquery-1.2.4a.js?<fmt:message key="webapp.version"/>"></script>
    <script type="text/javascript" src="/scripts/com/hedgehoglab/fixx/controller/SetupController.js?<fmt:message key="webapp.version"/>"></script>
</head>

<div class="realContent">
	<div class="TabPanel">
	<s:form method="post" action="do" enctype="multipart/form-data">        
	<div class="Pane">
		<h2><fmt:message key="heading.setup"/></h2> 
		<span class="Field MediumField"><s:textfield id="email" name="email" key="label.user.admin.email" required="true" theme="xhtml" value="%{request.getParameter('email')}"/></span>
		<span class="Field MediumField">
			<label class="desc" for="type"><fmt:message key="label.setup.type"/>  <span class="req">*</span></label>
			<select id="type" size="1" name="type">
				<option selected="selected" value="private"><fmt:message key="label.setup.type.private"/></option>
				<option value="public"><fmt:message key="label.setup.type.public"/></option>
			</select>
		</span>
		<span class="Field MediumField"><s:textfield id="title" name="fixx.config.name" key="label.setup.title" theme="xhtml"  value="%{request.getParameter('fixx.config.name')}"/></span>
        <span class="Field MediumField">
            <s:textfield id="baseurl" name="fixx.config.baseurl" key="label.setup.baseurl" theme="xhtml" value="%{baseUrl}"/>
        </span>
        <p><fmt:message key="help.setup.baseurl"/></p>                
    </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 inline Cleared">
		    		<s:checkbox id="singleUser" label="%{getText('label.setup.license.singleuser')}" name="singleUser" fieldValue="true" theme="xhtml" cssClass="Checkbox inline"/>
		    	</span>
				<div class="hide feedback Cleared" id="iSingleUserMessage">
					<p><fmt:message key="text.setup.license.singleuser"/></p>
					</div>
				<div id="iMultiUser">
			    	<span class="Field MediumField"><s:textfield id="fixx_key" name="fixx.serverkey" key="label.setup.serverkey" readonly="true" value="%{serverKey}"/></span>
				    <span class="Field "><s:file name="license" cssClass="text file" theme="xhtml" key="label.setup.license"/></span>
				</div>
		   </c:otherwise>
		</c:choose>
	</div>
	
	<div class="Pane">
		<h2><fmt:message key="heading.setup.email"/></h2>
        <p><fmt:message key="text.setup.emailsettings"/></p>
        <span class="Field MediumField"><s:textfield id="email_host" name="fixx.mail.host" key="label.email.host" theme="xhtml"  value="%{request.getParameter('fixx.mail.host')}"/></span>
		<span class="Field"><s:textfield id="email_port" name="fixx.mail.port" key="label.email.port" theme="xhtml"  value="%{request.getParameter('fixx.mail.port')}"/></span>
		<span class="Field MediumField"><s:textfield id="email_username" name="fixx.mail.username" key="label.email.username" theme="xhtml"  value="%{request.getParameter('fixx.mail.username')}"/></span>
		<span class="Field MediumField"><s:password id="email_password" name="fixx.mail.password" key="label.email.password" theme="xhtml"  value="%{request.getParameter('fixx.mail.password')}"/></span>
		<span class="Field MediumField"><s:textfield id="email_from" name="fixx.mail.from" key="label.email.from" theme="xhtml"  value="%{request.getParameter('fixx.mail.from')}"/></span>
	</div>

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