{layout @layout.html}
{block title}<title>LemonCMS {=CMS_VERSION} | Installation</title>{/block}
{block header}
{include header.html}
{/block}
{block content}
<div class="xlarge-80 large-80 medium-90 small-100 tiny-100 push-center">
  <h2 class="align-center">{_}step_3{/_} - {_}installation_information{/_}</h2>
  {import forms.html}
  <form action="?rt=install/step4" method="POST" enctype="multipart/form-data" class="ink-form">
    <fieldset>
      <legend class="large">{_}database_connection{/_}</legend>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_type" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_type{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include select, name => 'database[type]', options => ['mysql' => 'MySQL', 'pgsql' => 'PostgreSQL'], value => $databaseType}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_server" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_server{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'database[server]', required => true, size => 40, value => 'localhost'}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_username" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_username{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'database[username]', required => true, size => 40}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_password" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_password{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'database[password]', 'type' => 'password',  required => true, size => 40}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_name" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_name{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'database[name]', required => true, size => 40, value => 'lemoncms'}
	</div>
      </div>
      {if 'pgsql' == $databaseType}
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="database_schema" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}database_schema{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'database[schema]', required => true, size => 40, value => 'lemoncms'}
	</div>
      </div>
      {/if}
    </fieldset>
    <fieldset>
      <legend class="large">{_}other_information{/_}</legend>
      <div class="control-group column-group half-horizontal-gutters">
	<label for="settings_site_title" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}site_title{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[site_title]', size => 60}
	</div>
      </div>
      <div class="control-group column-group half-horizontal-gutters">
	<label for="settings_site_description" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}description{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include textarea, name => 'settings[site_description]', rows => 2, cols => 60}
	</div>
      </div>
      <div class="control-group column-group half-horizontal-gutters">
	<label for="settings_from_name" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}from_name{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[from_name]', size => 60}
	</div>
      </div>
      <div class="control-group column-group half-horizontal-gutters">
	<label for="settings_from_email" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right" title="{_}from_email_tip{/_}">{_}from_email{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[from_email]', 'type' => 'email', size => 60}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="settings_administrator_username" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}administrator_username{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[administrator_username]', value => 'admin', required => true, size => 40}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="settings_administrator_password" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}administrator_password{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[administrator_password]', 'type' => 'password', required => true, size => 40}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="settings_administrator_email" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}administrator_email{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[administrator_email]', 'type' => 'email', required => true, size => 60}
	</div>
      </div>
      <div class="control-group column-group required half-horizontal-gutters">
	<label for="settings_base_url" class="xlarge-25 large-30 medium-40 small-50 tiny-50 align-right">{_}base_url{/_}</label>
	<div class="control xlarge-75 large-70 medium-60 small-50 tiny-50">
	  {include input, name => 'settings[base_url]', 'type' => 'url', required => true, value => $baseURL, size => 40}
	</div>
      </div>
    </fieldset>
    <div class="column-group">
      <div class="xlarge-25 large-30 medium-50 small-70 tiny-70 half-top-space quarter-bottom-space push-center align-center">
	<a class="ink-button push-center" href="?rt=install/step2">{_}previous{/_}</a>
	{include input, name => 'next', value => ('next'|translate), 'type' => 'submit', class => 'ink-button green push-center'}
      </div>
    </div>
  </form>
    </div>
    <script>
     database_type.onchange = function() {l}window.location.href = "./?rt=install/step3&database=" + this.options[this.selectedIndex].value;{r};
    </script>
{/block}
