[%# 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 REMO Bugzilla Extension.
  #
  # The Initial Developer of the Original Code is the Mozilla Foundation
  # Portions created by the Initial Developers are Copyright (C) 2011 the
  # Initial Developer. All Rights Reserved.
  #
  # Contributor(s): Byron Jones <glob@mozilla.com>
  #%]

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

[% PROCESS global/header.html.tmpl
   title              = "Mozilla Reps - Application Form"
   generate_api_token = 1
   style_urls         = [ "extensions/REMO/web/styles/moz_reps.css" ]
   jquery             = []
   javascript_urls    = [ "extensions/REMO/web/js/moz_reps.js", "js/field.js" ]
%]

<noscript>
  <h1>JavaScript is required to use this form.</h1>
</noscript>

<h1>Mozilla Reps - Application Form</h1>

<p>
  If you have questions while completing this form, please contact the
  <a href="mailto:reps-council@mozilla.com">Reps Council</a> for assistance.
</p>

<form method="post" action="[% basepath FILTER none %]post_bug.cgi" id="tmRequestForm">
  <input type="hidden" name="filed_via" value="custom_form">
  <input type="hidden" name="bug_type" value="task">
  <input type="hidden" name="product" value="Mozilla Reps">
  <input type="hidden" name="component" value="Mentorship">
  <input type="hidden" name="rep_platform" value="All">
  <input type="hidden" name="op_sys" value="Other">
  <input type="hidden" name="version" value="unspecified">
  <input type="hidden" name="groups" value="mozilla-reps">
  <input type="hidden" name="format" value="[% format FILTER html %]">
  <input type="hidden" name="created-format" value="[% format FILTER html %]">
  <input type="hidden" name="comment" id="comment" value="">
  <input type="hidden" name="short_desc" id="short_desc" value="">
  <input type="hidden" name="groups" id="groups" value="mozilla-reps">
  <input type="hidden" name="groups" id="groups" value="mozilla-reps-admins">
  <input type="hidden" name="token" value="[% token FILTER html %]">

  <table id="reps-form">
    <tr>
      <th><label for="first_time">Is this the first time you have applied for Reps?</label></th>
      <td>
        <select id="first_time">
          <option value="Yes">Yes</option>
          <option value="No">No</option>
        </select>
      </td>
    </tr>

    <tr id="prior_bug" style="display: none">
      <th><label for="dependson">Please reference the previous [% terms.bug %] number: </label></th>
      <td><input id="dependson" name="dependson" type="text" value=""></td>
    </tr>

    <tr>
      <th><label class="required" for="first_name">First Name:</label></th>
      <td><input id="first_name" name="first_name" size="40" placeholder="John"></td>
    </tr>

    <tr>
      <th><label class="required" for="last_name">Last Name:</label></th>
      <td><input id="last_name" name="last_name" size="40" placeholder="Doe"></td>
    </tr>

    <tr>
      <th><label for="age">Are you 18 years or older?</label></th>
      <td>
        <select id="age">
          <option value="No">No</option>
          <option value="Yes">Yes</option>
        </select>
      </td>
    </tr>

    <tr id="age_warning" style="display: none">
      <td colspan="2">
        Mozilla Reps program is not currently accepting people under 18 years old.
        Sorry for the inconvenience. In the meantime please check with your local Mozilla
        group for other contribution opportunities.
      </td>
    </tr>

    <tr>
      <th><label class="required" for="city">City:</label></th>
      <td><input id="city" name="city" size="40" placeholder="Your city"></td>
    </tr>

    <tr>
      <th><label class="required" for="country">Country:</label></th>
      <td><input id="country" name="country" size="40" placeholder="Your country"></td>
    </tr>

    <tr>
      <th><label for="languages">Languages spoken:</label></th>
      <td><input id="languages" name="languages" size="40"></td>
    </tr>

    <tr>
      <th><label for="pmo_account" class="required">Do you have a people.mozilla.org account?</label></th>
      <td>
        <select id="pmo_account">
          <option value="Yes">Yes</option>
          <option value="No">No</option>
        </select>
      </td>
    </tr>

    <tr id="pmo_warning" style="display: none">
      <td colspan="2">
        You require a people.mozilla.org account to apply to the Reps Program.
      </td>
    </tr>

    <tr>
      <th><label class="required" for="mozillian">people.mozilla.org Profile URL:</label></th>
      <td>
        <input type="url" id="mozillian" name="mozillian" size="40" placeholder="https://people.mozilla.org/p/name">
      </td>
    </tr>

    <tr>
      <th>
        <label for="information">
          Is your people.mozilla.org profile filled with the <a href="https://wiki.mozilla.org/Reps/Application_Process/Selection_Criteria" target="_blank">required information</a>?
        </label>
      </th>
      <td>
        <select id="information">
          <option value="Yes">Yes</option>
          <option value="No">No</option>
        </select>
      </td>
    </tr>

    <tr id="information_warning" style="display: none">
      <td colspan="2">
        Please fill out your people.mozilla.org profile according to the <a href="https://wiki.mozilla.org/Reps/Application_Process/Selection_Criteria" target="_blank">Selection Criteria</a>.
      </td>
    </tr>

    <tr>
      <th colspan="2">
        <label class="required" for="cc">
          Mozillians who vouch for your application. They need to add a comment to your application [% terms.bug %] why they endorse your application.
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2">
        [% INCLUDE global/userselect.html.tmpl
           id       => "cc"
           name     => "cc"
           value    => cc
           size     => 60
           classes  => ["bz_userfield"]
           multiple => 5
        %]
      </td>
    </tr>

    <tr>
      <th>
        <label class="required" for="firstcontribute">
          When did you first start contributing to Mozilla?
        </label>
      </th>
      <td>
        <input name="firstcontribute" size="20" id="firstcontribute" value=""
              onchange="updateCalendarFromField(this)">
        <button type="button" class="calendar_button"
                id="button_calendar_firstcontribute"
                onclick="showCalendar('firstcontribute')">
          <span>Calendar</span>
        </button>
        <div id="con_calendar_firstcontribute"></div>
        <script [% script_nonce FILTER none %]>
          createCalendar('firstcontribute')
        </script>
      </td>
    </tr>

    <tr>
      <th colspan="2">
        <label class="required" for="involved">
          In which area are you active in Mozilla?
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2">
        <textarea id="involved" name="involved" rows="4" placeholder="Add-ons, Localization,  SUMO, QA, etc."></textarea>
      </td>
    </tr>

    <tr>
      <th><label class="required" for="learn">How did you learn about Mozilla Reps?</label></th>
      <td><input id="learn" name="learn" size="40"></td>
    </tr>

    <tr>
      <th colspan="2">
        <label class="required" for="motivation">
          What motivates you most about joining Mozilla Reps?
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2">
        <textarea id="motivation" name="motivation" rows="4"
                  placeholder="[% INCLUDE motivation_placeholder FILTER html %]"></textarea>
      </td>
    </tr>

    [% BLOCK motivation_placeholder -%]
      Tell us your goals and what you would be able to do as a Rep that you can't do right now
    [%- END %]

    <tr>
      <th colspan="2">
        <label for="mdm">
          What are Mission Driven Mozillans?
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2">
        <textarea id="mdm" name="mdm" rows="4"></textarea>
      </td>
    </tr>

    <tr>
      <th colspan="2">
        <label class="required" for="activity">
          What have you done in the last 6 months for Mozilla?
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2">
        <textarea id="activity" name="activity" rows="8"
                  placeholder="[% INCLUDE activity_placeholder FILTER html %]"></textarea>
      </td>
    </tr>

    [% BLOCK activity_placeholder -%]
      List some activities you organized or participated in and support this with links to blogposts/articles/events/etc
    [%- END %]

    <tr>
      <th colspan="2">
        <label for="comments">
          Do you want to add something we need to know?
        </label>
      </th>
    </tr>

    <tr>
      <td colspan="2"><textarea id="comments" name="comments" rows="4"></textarea></td>
    </tr>

    <tr>
      <th>
        <label class="required" for="privacy">
          I have read the
          <a href="https://www.mozilla.org/privacy/" target="_blank" rel="noopener noreferrer">Mozilla Privacy Policy</a>:
        </label>
      </th>
      <td><input id="privacy" name="privacy" type="checkbox" value="1"></td>
    </tr>

    <tr>
      <td>&nbsp;</td>
      <td align="right">
        <button id="submit">Submit</button>
      </td>
    </tr>
  </table>
</form>

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