    [% META title = 'Login' %]
<!-- BEGIN [% template.name %] -->

    [% # session password_check (also needs to go on lab_user_login_page redirect page):
        IF c.session.param('password_strength'); # cleared in password_strength.tt
            # c.debug("==== have session.password_strength ====");
            INCLUDE 'user/password_strength.tt';
        END;
    %]

  <p class="bold">
    [% user = c.authen.store.fetch('yooza_profile') %]
    Hello [% user.first_name | ucfirst %] [% user.last_name | ucfirst %],
  </p>

    [% # INCLUDE login/local_messages.tt %]

    <script language="javascript">
      <!--
        pos = navigator.userAgent.indexOf("MSIE");
        semic1  = navigator.userAgent.indexOf(";");
        semic2  = navigator.userAgent.indexOf(";", semic1+1);
      -->
    </script>

    <!--[if IE 7]>
      <p class="indent highlight">
        Your browser [Internet Explorer <script language="javascript">
          document.write (navigator.userAgent.substring(pos+4, semic2));
        </script>] cannot display site content optimally. Please consider
        upgrading to a <a href="http://browsehappy.com/"> modern browser</a>
        (eg Mozilla Firefox, Google Chrome, Opera).
      </p>
    <![endif]-->
    <!--[if lt IE 7]>
      <p class="indent highlight">
        Unfortunately your browser [Internet Explorer <script language="javascript">
          document.write (navigator.userAgent.substring(pos+4, semic2));
        </script>] is too old to display our new report format properly.
          Please <a href="http://browsehappy.com/">upgrade to a modern browser</a>
          (eg Mozilla Firefox, Google Chrome, Opera). Internet Explorer versions
          below 8 are not suitable.
      </p>
    <![endif]-->

  <ul>
    [% UNLESS last_login.datetime.match('T00:00:00') # new user %]
      <li>
        your last login was: [% last_login.strftime('%A %d.%b.%Y @ %H:%M') %]
      </li>
    [% END %]
    [% UNLESS user_type == 'internal' AND user.email # don't need to see this: %]
      [% IF user.email %]
      <li>
        your registered email address is: [% user.email %]
       [<a href="[% app_url %]/user/change_email">change</a>]
      </li>
      [% ELSE %]
      <li class="red">
        *** no registered email address, please update
        <a href="[% app_url %]/user/change_email">here</a> ***
      </li>
      [% END %]
      <li>
        your registered location is: [% user.user_location.location_name %]
        [<a href="[% app_url %]/user/change_location">change</a>]
      </li>
    [% END %]
    [% IF c.cfg('settings').have_online_requests AND token;
        base_addr = url_base.replace(':8000', '');
        usr = token.username;
        ctr = token.centre;
    %]
        <li>
            <img class="mid-align" src="/images/new.png" /> online HMDS request form:
            <a href="[% base_addr %]/request-form?u=[% usr %];c=[% ctr %]"
               target="_blank"><img class="mid-align link" src="/images/table.png" />
            </a>
            <span class="info">[also available from Resources &#187; Request forms]</span>
        </li>
    [% END %]
  </ul>

  [% INCLUDE site/messages.tt %]

  <form action="[% app_url %]/search/do_search" method="get">
    <div class="indent">
      <strong>Quick search</strong>:
      <input type="text" name="last_name"   placeholder="last name" />
      <input type="text" name="first_name"  placeholder="first name" />
      <input type="text" name="unit_number" placeholder="unit number" />
      <input type="text" name="nhs_number"  placeholder="NHS number" />
      [% site.html.submit %] [% site.html.reset %]
    </div>
  </form>

  [% # new.diagnoses.tt only required for external users - has 'results' tt_param,
     # but could be empty so *don't* use results.size:
    INCLUDE resources/new_diagnoses.tt IF results;
  %]

  <!--[if lt IE 10]>
    <script type="text/javascript" src="/js/jquery.placeholder.min.js"></script>
    <script>
      $('input, textarea').placeholder();
    </script>
  <![endif]-->

<!-- END [% template.name %] -->
