[%# -*- mode: html -*- %]
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Terry Weissman <terry@mozilla.org>
  #                 Jacob Steenhagen <jake@bugzilla.org>
  #                 Vitaly Harisov  <vitaly@rathedg.com>
  #                 Guy Pyrzak <guy.pyrzak@gmail.com>
  #%]

[% PROCESS global/variables.none.tmpl %]

[% USE Bugzilla %]
[% PROCESS global/header.html.tmpl
   title = "$terms.Bugzilla Main Page"
   header = "Main Page"
   style_urls = [ 'skins/standard/index.css' ]
   no_yui = 1
%]

[% IF release %]
  <div id="new_release">
    [% IF release.data %]
      [% IF release.eos_date %]
        <p>[% terms.Bugzilla %] [%+ release.branch_version FILTER html %] will
        no longer receive security updates after [% release.eos_date FILTER html %].
        You are highly encouraged to upgrade in order to keep your
        system secure.</p>
      [% END %]
      [% IF release.deprecated %]
        <p>Bugzilla [%+ release.deprecated FILTER html %] is no longer
        supported. You are highly encouraged to upgrade in order to keep your
        system secure.</p>
      [% END %]

      <p>A new Bugzilla version ([% release.data.latest_ver FILTER html %])
      is available at
      <a href="[% release.data.url FILTER html %]">[% release.data.url FILTER html %]</a>.<br>
      Release date: [% release.data.date FILTER html %]</p>

      <p class="notice">This message is only shown to logged in users with admin privs.
      You can configure this notification from the
      <a href="editparams.cgi?section=general#upgrade_notification_desc">Parameters</a> page.</p>
    [% ELSIF release.error == "cannot_download" %]
      <p>The remote file <a href="[% constants.REMOTE_FILE FILTER html %]">
      [%~ constants.REMOTE_FILE FILTER html %]</a> cannot be downloaded
      (reason: [% release.reason FILTER html %]).<br>
      Either the remote server is temporarily unavailable, or your web server cannot access
      the web. If you are behind a proxy, set the
      <a href="editparams.cgi?section=advanced#proxy_url_desc">proxy_url</a> parameter correctly.</p>
    [% ELSIF release.error == "no_write" %]
      <p>The local XML file '[% constants.LOCAL_FILE FILTER html %]' cannot be created
      (reason: [% release.reason FILTER html %]).<br>
      Please make sure the web server can write into this directory.
    [% ELSIF release.error == "no_update" %]
      <p>The local XML file '[% constants.LOCAL_FILE FILTER html %]' cannot be updated.
      Please make sure the web server can edit this file.</p>
    [% ELSIF release.error == "no_access" %]
      <p>The local XML file '[% constants.LOCAL_FILE FILTER html %]' cannot be read.
      Please make sure this file has the correct rights set on it.</p>
    [% ELSIF release.error == "corrupted" %]
      <p>The local XML file '[% constants.LOCAL_FILE FILTER html %]' has an invalid XML format.
      Please delete it and try accessing this page again.</p>
    [% ELSIF release.error == "unknown_parameter" %]
      <p>'[% Param("upgrade_notification") FILTER html %]' is not a valid notification
      parameter. Please check this parameter in the
      <a href="editparams.cgi?section=general#upgrade_notification_desc">Parameters</a> page.</p>
    [% END %]
  </div>
[% END %]

<div id="page-index">
  <table>
    <tr>
      <td>
        <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1>
        <div class="intro">[% Hook.process('intro') %]</div>
        <ul id="tiles">
          [% IF Param('docs_urlbase') %]
          <li id="tile-docs">
            <a href="[% docs_urlbase FILTER html %]">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">Documentation</span>
            </a>
          </li>
          [% END %]
          <li id="tile-search">
            <a href="[% basepath FILTER none %]query.cgi?format=advanced">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">Advanced Search</span>
            </a>
          </li>
          <li id="tile-new-bug">
            <a href="[% basepath FILTER none %]enter_bug.cgi">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">New [% terms.Bug %]</span>
            </a>
          </li>
          [% IF user.id %]
          <li id="tile-prefs">
            <a href="[% basepath FILTER none %]userprefs.cgi">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">Preferences</span>
            </a>
          </li>
          [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %]
          <li id="tile-new-account">
            <a href="[% basepath FILTER none %]createaccount.cgi">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">New Account</span>
            </a>
          </li>
          [% ELSE %]
          <li id="tile-login">
            <a href="?GoAheadAndLogIn=1">
              <span class="icon" aria-hidden="true"></span>
              <span class="label">Log In</span>
            </a>
          </li>
          [% END %]
        </ul>
        <form id="quicksearchForm" name="quicksearchForm" action="[% basepath FILTER none %]buglist.cgi" data-no-csrf>
          <div>
            <input id="quicksearch_main" type="text" name="quicksearch" autofocus
              placeholder="Enter [% terms.abug %] number or some search terms"
              aria-labelledby="find"
              title="Quick Search">
            <input id="find" type="submit" value="Quick Search">
            <ul class="additional_links" id="quicksearch_links">
              <li>
                <a href="[% basepath FILTER none %]page.cgi?id=quicksearch.html">Quick Search help</a>
              </li>
              <li class="bz_default_hidden" id="quicksearch_plugin">
                |
                <a href="javascript:window.external.AddSearchProvider('[% basepath FILTER html %]search_plugin.cgi')">
                 Install the Quick Search plugin
                </a>
              </li>
            </ul>
            <ul class="additional_links">
              <li>
                <a href="[% basepath FILTER none %]page.cgi?id=etiquette.html">[%- terms.Bugzilla %] Etiquette</a>
              </li>
              <li>
                | <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">[%- terms.Bug %] Writing Guidelines</a>
              </li>
              [% Hook.process('additional_links') %]
            </ul>
          </div>
        </form>
        <div class="outro">[% Hook.process('outro') %]</div>
      </td>
    </tr>
  </table>
</div>

[% PROCESS global/footer.html.tmpl %]
