{layout @admin.html}
{block content}
<div class="top-space bottom-space">
  <h1>{_}settings{/_}</h1>
  {import forms.html}
  <div class="column-group">
    <div class="xlarge-50 large-50 medium-60 small-100 tiny-100">
      <form name="settings" id="settingsform" action="{=BASE_URL}system/settings" method="POST" enctype="multipart/form-data" class="ink-form">
	<div class="control-group">
	  <label for="site_title">{_}site_title{/_}</label>
	  <div class="control">
	    {include input, name => 'site_title', value => ($settings['site_title'])}
	  </div>
	</div>
	<div class="control-group">
	  <label for="site_description">{_}description{/_}</label>
	  <div class="control">
	    {include textarea, name => 'site_description', value => ($settings['site_description'])}
	  </div>
	</div>
	<div class="control-group">
	  <label for="from_name">{_}from_name{/_}</label>
	  <div class="control">
	    {include input, name => 'from_name', value => ($settings['from_name'])}
	  </div>
	</div>
	<div class="control-group">
	  <label for="from_email" title="{_}from_email_tip{/_}">{_}from_email{/_}</label>
	  <div class="control">
	    {include input, name => 'from_email', value => ($settings['from_email']), 'type' => 'email'}
	  </div>
	</div>
	{if $showHomepageControl}
	<div class="control-group">
	  <label for="home_page">{_}home_page{/_}</label>
	  <div class="control">
	    {var $pages = array_column( models\Page::findMany( ['page_id', 'title'], ['parent_id' => null, 'status' => models\Page::PUBLISHED] ), 'title', 'page_id' ) }
	    {include select, name => 'home_page', value => ($settings['home_page']), options => $pages}
	  </div>
	</div>
	{/if}
	<div class="control">
	  {include input, name => 'save', value => ( 'save'|translate ), 'type' => 'submit', class => 'ink-button green push-right'}
	</div>
      </form>
    </div>
  </div>
</div>
{/block}
