greenlight/app/views/sessions/ldap_signin.html.erb
felix-itz 5760bea00b
LDAP Sign-In form: user field attributes (#2014)
- autocomplete="username": Tell the browser a user name should be filled, if any.
  Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
- autocapitalize="none": Tell browsers (especially on mobile devices like iOS) not to
  capitalize the first letter
  Reference: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#//apple_ref/doc/uid/TP40008058-autocapitalize
- spellcheck="false": Do not spell-check the user name
  Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck
- autofocus: indicates that the input should automatically have focus, which makes sense
  because this form is shown after having clicked the "login" button so it's not an issue that
  the screen reader will skip the "Sign in to your account" text.
  Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus

This PR will improve usability especially on mobile devices. It does *not* not attempt to improve WCAG compliance.

Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
2020-08-26 14:03:19 -04:00

35 lines
1.7 KiB
Plaintext

<div class="container">
<div class="row pt-7">
<div class="col col-lg-6 offset-lg-3">
<div class="card">
<div class="card-header background">
<h4 class="mt-2"><%= t("login_title") %></h4>
</div>
<div class="card-body background">
<%= form_for(:session, url: ldap_callback_path) do |f| %>
<div class="form-group">
<div class="input-icon">
<span class="input-icon-addon">
<i class="fas fa-user"></i>
</span>
<%= f.text_field :username, class: "form-control", placeholder: t("administrator.users.table.username"), value: "", autocomplete: "username", autocapitalize: "none", spellcheck: "false", autofocus: "" %>
</div>
</div>
<div class="form-group">
<div class="input-icon">
<span class="input-icon-addon">
<i class="fas fa-key"></i>
</span>
<%= f.password_field :password, class: "form-control", placeholder: t("password"), value: "" %>
</div>
</div>
<div>
<%= f.submit t("login"), class: "btn btn-primary btn-block signin-button" %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>