<%= javascript_include_tag 'jquery' %>

<div class='login'>
  <div class='login-image'></div>

  <p class='login-course'><%= MarkusConfigurator.markus_config_course_name %></p>

  <div class='login-error'>
    <%= render 'shared/flash_message' %>
  </div>

  <div class='login-form'>
    <%= form_tag({ action: 'login',
                   id: nil },
                 { # Quotes for onsubmit must be like this to show string properly
                   onsubmit: "jQuery('#submit').prop('disabled', true);
                              jQuery('#submit').val('#{ t(:logging_in) }');",
                   id: 'login_form' }) do %>
      <%= text_field_tag 'user_login',
                         nil,
                         tabindex: 10,
                         placeholder: t(:login),
                         autocorrect: 'off' %>
      <%= password_field_tag 'user_password',
                             nil,
                             tabindex: 20,
                             placeholder: t(:password) %>
      <div class='submit'>
        <%= submit_tag t(:log_in),
                       tabindex: 100,
                       id: 'submit' %>
      </div>
    <% end %>
  </div>
</div>

<script>
  <%# Try to put focus on the login text field on load %>
  jQuery(document).ready(function() {
    document.getElementById('user_login').focus();
  });
</script>

<%= javascript_include_tag 'jquery' %>
<%= javascript_include_tag 'jquery_ujs' %>

<div class='login'>
  <div class='login-image'></div>

  <p class='login-course'>
    <%= MarkusConfigurator.markus_config_course_name %>
  </p>

  <div class='login-error'>
    <%= render 'shared/flash_message' %>
  </div>

  <div class='login-form'>
    <%= form_tag({ action: 'login' }) do %>
      <%= text_field_tag 'user_login',
                         nil,
                         tabindex: 1,
                         placeholder: t(:login),
                         autocorrect: 'off',
                         autofocus: true %>
      <%= password_field_tag 'user_password',
                             nil,
                             tabindex: 2,
                             placeholder: t(:password) %>
      <div class='submit'>
        <%= submit_tag t(:log_in),
                       data: { disable_with: t(:logging_in) },
                       tabindex: 3 %>
      </div>
    <% end %>
  </div>
</div>

Remove hacky way of focusing username field and disabling submit button
Remove hacky way of focusing username field and disabling submit button
