<commit_before><%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% js_bundle :mobile_login %>

<% extend Api::V1::Account %>

  <div class="mobileLogin-Header">
    <span class="screenreader-only">
      <%= t 'Canvas by Instructure' %>
    </span>
  </div>
<%= form_for :pseudonym_session, :url => url_for({ action: :create }.merge(params.slice(:id).to_unsafe_h)), :html => {:id => "login_form", :class => "front face", :novalidate => 'novalidate', :autocomplete => "off" } do |f| %>

  <div class="ic-Form-control">
    <input
      class="ic-Input"
      autocomplete="off"
      autocorrect="off"
      placeholder="<%= @login_handle_name%>"
      type="<%= @login_handle_is_email ? 'email' : 'text' %>"
      name="pseudonym_session[unique_id]"
      value="<%= params[:pseudonym_session].try(:[], :unique_id) %>" >
  </div>
  <div class="ic-Form-control">
    <input
      class="ic-Input"
      type="password"
      name="pseudonym_session[password]"
      autocomplete="off"
      autocorrect="off"
      placeholder="<%= t :password, "Password" %>" />
  </div>
  <button
    type="submit"
    class="Button Button--primary Button--block"><%= t('log_in', 'Log In') %>
  </button>

  <% if request.post? && flash[:error] %>
    <div class="error"><%= flash[:error] %></div>
  <% end %>

  <div class="forgotBlock">
    <% if url = params[:canvas_login].blank? && @domain_root_account.try(:forgot_password_external_url) %>
      <%= link_to t('dont_know_password', "Forgot Password?"), url, :class => 'forgot-password' %>
    <% else %>
      <a class="forgot-password flip-to-back"><%= t('dont_know_password', "Forgot Password?") %></a>
    <% end %>
  </div>
<% end %>
<%= form_for :pseudonym_session, :url => forgot_password_path, :html => {:id => "forgot_password_form", :class => 'back face', :autocomplete => "off" } do |f| %>
  <div class="ic-Form-control">
    <label for="pseudonym_session_unique_id_forgot" class="screenreader-only"><%= t('login_handle', "Enter your %{login_handle_name} and we'll send you a link to change your password.", :login_handle_name => @login_handle_name) %></label>
    <input
      class="ic-Input"
      autocomplete="off"
      autocorrect="off"
      type="<%= @login_handle_is_email ? 'email' : 'text' %>"
      name="pseudonym_session[unique_id_forgot]"
      value=""
      placeholder="<%= @login_handle_name %>"
      id="pseudonym_session_unique_id_forgot" />
  </div>
  <button
    type="submit"
    class="Button Button--primary Button--block"
    data-text-while-loading="<%= t :sending, "Sending..." %>" class="request-password-button"><%= t('buttons.request_password', 'Request Password') %>
  </button>
  <div class="forgotBlock">
    <a class="flip-to-front"><%= t('back_to_login', "Back to Login") %></a>
  </div>
<% end %>

<% if @domain_root_account && @domain_root_account.self_registration? %>
  <% if @domain_root_account.self_registration_type == 'observer' %>
    <% js_env :ACCOUNT => account_json(@domain_root_account, nil, session, ['registration_settings']),
              :PASSWORD_POLICY => @domain_root_account.password_policy %>
    <div id='coenrollment_link'>
      <div class="ic-Login__banner-title">
        <%= t('Parent of a Canvas User?') %>
      </div>
      <%= link_to '#',
          :class => "ic-Login__link ic-Login__register-banner ic-Login__banner-subtitle",
          data: reg_link_data(@domain_root_account.parent_auth_type)  do %>
        <%= t('Create Account') %>
      <% end %>
    </div>
  <% end %>
<% end %>

<%= # for plugin use
  render "shared/login_trailer" %><commit_msg>(Mobile Web Login): ensure Forgot password link can receive focus<commit_after><%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% js_bundle :mobile_login %>

<% extend Api::V1::Account %>

  <div class="mobileLogin-Header">
    <span class="screenreader-only">
      <%= t 'Canvas by Instructure' %>
    </span>
  </div>
<%= form_for :pseudonym_session, :url => url_for({ action: :create }.merge(params.slice(:id).to_unsafe_h)), :html => {:id => "login_form", :class => "front face", :novalidate => 'novalidate', :autocomplete => "off" } do |f| %>

  <div class="ic-Form-control">
    <input
      class="ic-Input"
      autocomplete="off"
      autocorrect="off"
      placeholder="<%= @login_handle_name%>"
      type="<%= @login_handle_is_email ? 'email' : 'text' %>"
      name="pseudonym_session[unique_id]"
      value="<%= params[:pseudonym_session].try(:[], :unique_id) %>" >
  </div>
  <div class="ic-Form-control">
    <input
      class="ic-Input"
      type="password"
      name="pseudonym_session[password]"
      autocomplete="off"
      autocorrect="off"
      placeholder="<%= t :password, "Password" %>" />
  </div>
  <button
    type="submit"
    class="Button Button--primary Button--block"><%= t('log_in', 'Log In') %>
  </button>

  <% if request.post? && flash[:error] %>
    <div class="error"><%= flash[:error] %></div>
  <% end %>

  <div class="forgotBlock">
    <% if url = params[:canvas_login].blank? && @domain_root_account.try(:forgot_password_external_url) %>
      <%= link_to t('dont_know_password', "Forgot Password?"), url, :class => 'forgot-password' %>
    <% else %>
      <a tabindex="0" role="link" class="forgot-password flip-to-back"><%= t('dont_know_password', "Forgot Password?") %></a>
    <% end %>
  </div>
<% end %>
<%= form_for :pseudonym_session, :url => forgot_password_path, :html => {:id => "forgot_password_form", :class => 'back face', :autocomplete => "off" } do |f| %>
  <div class="ic-Form-control">
    <label for="pseudonym_session_unique_id_forgot" class="screenreader-only"><%= t('login_handle', "Enter your %{login_handle_name} and we'll send you a link to change your password.", :login_handle_name => @login_handle_name) %></label>
    <input
      class="ic-Input"
      autocomplete="off"
      autocorrect="off"
      type="<%= @login_handle_is_email ? 'email' : 'text' %>"
      name="pseudonym_session[unique_id_forgot]"
      value=""
      placeholder="<%= @login_handle_name %>"
      id="pseudonym_session_unique_id_forgot" />
  </div>
  <button
    type="submit"
    class="Button Button--primary Button--block"
    data-text-while-loading="<%= t :sending, "Sending..." %>" class="request-password-button"><%= t('buttons.request_password', 'Request Password') %>
  </button>
  <div class="forgotBlock">
    <a tabindex="0" role="link" class="flip-to-front"><%= t('back_to_login', "Back to Login") %></a>
  </div>
<% end %>

<% if @domain_root_account && @domain_root_account.self_registration? %>
  <% if @domain_root_account.self_registration_type == 'observer' %>
    <% js_env :ACCOUNT => account_json(@domain_root_account, nil, session, ['registration_settings']),
              :PASSWORD_POLICY => @domain_root_account.password_policy %>
    <div id='coenrollment_link'>
      <div class="ic-Login__banner-title">
        <%= t('Parent of a Canvas User?') %>
      </div>
      <%= link_to '#',
          :class => "ic-Login__link ic-Login__register-banner ic-Login__banner-subtitle",
          data: reg_link_data(@domain_root_account.parent_auth_type)  do %>
        <%= t('Create Account') %>
      <% end %>
    </div>
  <% end %>
<% end %>

<%= # for plugin use
  render "shared/login_trailer" %>
{'fraction_non_alphanumeric': 0.17326616682286786, 'fraction_numerical': 0.0016401124648547328, 'mean_word_length': 3.917626728110599, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 177, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5890367', 'n_tokens_mistral': 2947, 'n_tokens_neox': 2747, 'n_words': 667}