<%@ include file="/common/taglibs.jsp" %>

<head>
	<title><fmt:message key="title.admin.settings"/></title>
    <meta name="menu" content="admin"/>
</head>


    <c:set var="panelContent">
        <s:form method="post" action="settings">
    <div class="Pane">

        <h2><fmt:message key='heading.settings'/></h2>
			<span class="Field MediumField"><s:textfield id="title" name="fixx.config.name" key="label.setup.title" theme="xhtml" value="%{config.getString('fixx.config.name')}"/></span>
        	<span class="Field MediumField">
                <s:textfield id="baseurl" name="fixx.config.baseurl" key="label.setup.baseurl" theme="xhtml" value="%{applicationUrl}"/>
            </span>
            <p><fmt:message key="help.setup.baseurl"/></p>    
            <span class="Field HugeField inline">
	        	<input type="checkbox" name="fixx.config.public" id="public" class="Checkbox inline" value="true" <s:if test="%{config.getBoolean('fixx.config.public')}">checked="checked"</s:if>/>
	            <label for="public"><fmt:message key="label.settings.public"/></label>
        	</span>
    </div>
    
    <div class="Pane">
		<h2><fmt:message key="heading.setup.email"/></h2>
        <p><fmt:message key="help.testemail"/></p>            
        <span class="Field MediumField"><s:textfield id="email_host" name="fixx.mail.host" key="label.email.host" theme="xhtml" value="%{config.getString('fixx.mail.host')}"/></span>
		<span class="Field"><s:textfield id="email_port" name="fixx.mail.port" key="label.email.port" theme="xhtml" value="%{config.getString('fixx.mail.port')}"/></span>
		<span class="Field MediumField"><s:textfield id="email_username" name="fixx.mail.username" key="label.email.username" theme="xhtml" value="%{config.getString('fixx.mail.username')}"/></span>
		<span class="Field MediumField"><s:password id="email_password" name="fixx.mail.password" key="label.email.password" theme="xhtml" value="%{config.getString('fixx.mail.password')}"/></span>
		<span class="Field MediumField"><s:textfield id="email_from" name="fixx.mail.from" key="label.email.from" theme="xhtml" value="%{config.getString('fixx.mail.from')}"/></span>
	</div>

    <div class="Pane">
        <h2><fmt:message key="heading.settings.performance"/></h2>
        <span class="Field HugeField inline">
	        	<input type="checkbox" name="fixx.config.disabledashboardcharts" id="disabledashboardcharts" class="Checkbox inline" value="true" <s:if test="%{config.getBoolean('fixx.config.disabledashboardcharts')}">checked="checked"</s:if>/>
	            <label for="public"><fmt:message key="label.settings.disabledashboardcharts"/></label>
        	</span>
    </div>
	
    <div class="Pane">
    	<h2><fmt:message key="heading.settings.notifications"/></h2>
        <p><fmt:message key="text.settings.twitter"/></p>
        <span class="Field "><s:textfield key="label.settings.twitterid" name="fixx.config.twitter_id" theme="xhtml" value="%{config.getString('fixx.config.twitter_id')}"/></span>
        <span class="Field "><s:password key="label.settings.twitterpassword" name="fixx.config.twitter_password" theme="xhtml" value="%{config.getString('fixx.config.twitter_password')}"/></span>
    	 <div class="Actions">
	         <ul>
	             <li><s:submit key="action.update"/></li>
	         </ul>
	    </div>
    </div>
    </s:form>
    </c:set>

<div class="rightPanel">
    <div class="PropertyPane">
        <h2><fmt:message key="heading.actions"/></h2>
        <div class="Pane">
            <ul style="width:100%;display:block;">
           		<li><a href="${ctx}/admin/reindex"><fmt:message key="action.reindex"/></a></li>
                <li><a href="${ctx}/admin/sendtestemail"><fmt:message key="action.sendtestemail"/></a></li>
            </ul>
        </div>
    </div>
</div>

<div class="realContent">
    <c:import url="/WEB-INF/pages/includes/administration/menu/default.jsp">
        <c:param name="pageName" value="Settings"/>
        <c:param name="content" value="${panelContent}"/>
    </c:import>
</div>