<mt:setvarblock name="html_title">
<mt:if name="version_warning">
  <__trans phrase="Welcome to Movable Type">
<mt:else>
  <__trans phrase="Create Your Account">
</mt:if>
</mt:setvarblock>

<mt:setvarblock name="page_title">
<mt:if name="version_warning">
  <span id="version-warning-header"><__trans phrase="Welcome to Movable Type"></span>
</mt:if>
<span id="welcome-header"<mt:if name="version_warning"> style="display: none;"</mt:if>><__trans phrase="Create Your Account"></span>
</mt:setvarblock>

<mt:setvar name="complete" value="1">
<mt:include name="include/chromeless_header.tmpl">

<style type="text/css">
div.warning#version-warning {
    position: relative;
    padding: 1em;
}
</style>

<mt:setvar name="version_warning">

<div class="upgrade">
<mt:if name="version_warning">
  <div class="warning" id="version-warning">
    <p><__trans phrase="The version of Perl installed on your server ([_1]) is lower than the minimum supported version ([_2])." params="<mt:var name="perl_version">%%<mt:var name="perl_minimum">"></p>
    <p><__trans phrase="While Movable Type may run, it is an <strong>untested and unsupported environment</strong>.  We strongly recommend upgrading to at least Perl [_1]." params="<mt:var name="perl_minimum">"></p>
    <p><__trans phrase="Do you want to proceed with the installation anyway?"></p>
    <div class="actions-bar">
      <input type="hidden" name="continue" value="1" />
      <button
         onclick="dismiss('version-warning'); show('welcome'); return false;"
         type="submit"
         accesskey="s"
         title="<__trans phrase="Yes (s)">"
         class="action primary button">
        <__trans phrase="Yes">
      </button>
      <button
         onclick="javascript:location.href='mt-check.cgi'"
         type="submit"
         accesskey="x"
         title="<__trans phrase="View MT-Check (x)">"
         class="action button">
        <__trans phrase="No">
      </button>
    </div>
  </div>
  </mt:if>
  
  <div id="welcome"<mt:if name="version_warning"> style="display: none;"</mt:if>>
    <p class="intro"><__trans phrase="Please create an administrator account for your system. When you are done, Movable Type will initialize your database."></p>
  <mt:if name="error">
    <mtapp:statusmsg
       id="generic-error"
       class="error"
       can_close="0">
      <mt:var name="error" escape="html">
    </mtapp:statusmsg>
  </mt:if>
  
    <form id="install_form" method="post" action="<mt:var name="script_url">">
      <input type="hidden" name="__mode" value="init_user" />
    <mt:if name="auth_mode_ldap">
      <p><__trans phrase="To proceed, you must authenticate properly with your LDAP server."></p>
    </mt:if>
    <mt:if name="auth_mode_mt">
      <mtapp:setting
         id="admin_username"
         label="<__trans phrase="Username">"
         label_class="top-label"
         hint="<__trans phrase="The name used by this user to login.">">
        <input type="text" id="admin_username" class="text full required" name="admin_username" value="<mt:var name="admin_username" escape="html">" />
      </mtapp:setting>
    
      <mtapp:setting
         id="admin_nickname"
         label="<__trans phrase="Display Name">"
         label_class="top-label"
         hint="<__trans phrase="The name used when published.">">
        <input type="text" name="admin_nickname" id="admin_nickname" class="text full required" value="<mt:var name="admin_nickname" escape="html">" />
      </mtapp:setting>
    
      <mtapp:setting
         id="admin_email"
         label="<__trans phrase="Email Address">"
         label_class="top-label"
         hint="<__trans phrase="The user&rsquo;s email address.">">
        <input type="text" id="admin_email" class="text full required email" name="admin_email" value="<mt:var name="admin_email" escape="html">" />
      </mtapp:setting>

      <mt:unless name="config.emailaddressmain">
          <mtapp:setting
             id="use_system_email"
             lebel="<__trans phrase="System Email">"
             label_class="no-header"
             hint="<__trans phrase="This email address is used in the 'From:' header of each email sent by Movable Type.  Email may be sent for password recovery, commenter registration, comment and trackback notification, user or IP address lockout, and a few other minor events.">"
             show_hint="1">
            <input type="checkbox" name="use_system_email" <mt:if name="use_system_email">checked="checked"</mt:if> id="use_system_email" />
            <label for="use_system_email"><__trans phrase="Use this as system email address"></label>
          </mtapp:setting>
      </mt:unless>

      <mtapp:setting
         id="preferred_language"
         label="<__trans phrase="Language">"
         label_class="top-label"
         hint="<__trans phrase="The user&rsquo;s preferred language.">">
        <select name="preferred_language" id="preferred_language"><mt:loop name="languages">
          <option value="<mt:var name="l_tag">"<mt:if name="l_selected"> selected="selected"</mt:if>><mt:var name="l_name"></option></mt:loop>
        </select>
      </mtapp:setting>

      <mtapp:setting
         id="admin_password"
         label="<__trans phrase="Password">"
         label_class="top-label"
         hint="<__trans phrase="Select a password for your account."> (<$mt:PasswordValidationRule$>)"
         show_hint="1">
        <input type="password" id="admin_password" class="text password required" name="admin_password" />
      </mtapp:setting>
    
      <mtapp:setting
         id="admin_password_confirm"
         label="<__trans phrase="Confirm Password">"
         label_class="top-label"
         hint="<__trans phrase="Repeat the password for confirmation.">">
        <input type="password" id="admin_password_confirm" class="text password" name="admin_password_confirm" />
      </mtapp:setting>
      <script type="text/javascript">
      /* <![CDATA[ */
        <$mt:PasswordValidation form="install_form" password="admin_password" username="admin_username"$>
      /* ]]> */
      </script>
    </mt:if>
    
    <mt:if name="auth_mode_ldap">
      <mtapp:setting
         id="admin_username"
         label="<__trans phrase="Username">"
         label_class="top-label"
         hint="<__trans phrase="Your LDAP username.">">
        <input type="text" id="admin_username" class="text full" name="admin_username" value="<mt:var name="admin_username" escape="html">" />
      </mtapp:setting>

      <mtapp:setting
         id="preferred_language"
         label="<__trans phrase="Language">"
         label_class="top-label"
         hint="<__trans phrase="The user&rsquo;s preferred language.">">
        <select name="preferred_language" id="preferred_language"><mt:loop name="languages">
          <option value="<mt:var name="l_tag">"<mt:if name="l_selected"> selected="selected"</mt:if>><mt:var name="l_name"></option></mt:loop>
        </select>
      </mtapp:setting>

      <mtapp:setting
         id="admin_password"
         label="<__trans phrase="Password">"
         label_class="top-label"
         hint="<__trans phrase="Enter your LDAP password.">">
        <input type="password" id="admin_password" class="text password" name="admin_password" />
      </mtapp:setting>
    </mt:if>
    
      <div class="actions-bar">
        <input type="hidden" name="continue" value="1" />
        <button
           type="submit"
           accesskey="s"
           title="<__trans phrase="Continue (s)">"
           class="save action primary button">
          <__trans phrase="Continue">
        </button>
      </div>
    </form>
  </div>
</div>

<script type="text/javascript">
/* <![CDATA[ */
function dismiss(id) {
    jQuery('#'+id).hide();
    jQuery('#'+id+'-header').hide();
}

function show(id) {
    jQuery('#'+id).show();
    jQuery('#'+id+'-header').show();
}

jQuery(function() {
    jQuery('#admin_username').focus();
    jQuery.mtValidateAddRules({
        '#admin_password_confirm': function ($e) {
            return $e.val() == jQuery('#admin_password').val() ? true : false;
        }
    });
    jQuery.mtValidateAddMessages({
        '#admin_username.required': '<__trans phrase="The initial account name is required." escape="singlequotes">'
<mt:if name="auth_mode_mt">,
        '#admin_nickname.required': '<__trans phrase="The display name is required." escape="singlequotes">',
        '#admin_email.required': '<__trans phrase="The e-mail address is required." escape="singlequotes">',
        '#admin_password_confirm': '<__trans phrase="Both passwords must match." escape="singlequotes">'
</mt:if>
    });
    jQuery('#install_form').submit(function() {
        return jQuery(this).find('input, select').mtValidate('simple') ? true : false;
    });
});
/* ]]> */
</script>
<mt:include name="include/chromeless_footer.tmpl">
