SumOfUs/Champaign

View on GitHub
app/views/devise/sessions/new.html.erb

Summary

Maintainability
Test Coverage
<h1 class="centered-overlay__title">Log in</h1>

<%- if devise_mapping.omniauthable? %>
  <section class="col-xs-12">
    <%= link_to "Sign in with your SumOfUs email", omniauth_authorize_path(resource_name, 'google_oauth2'), class: 'btn btn-primary btn-lg' %><br />
  </section>
<% end -%>

<section class="col-xs-12">
  <h4>or log in with a password</h4>
  <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
    <div class="form-group">
      <%= f.label :email %><br />
      <%= f.email_field :email, class: 'form-control' %>
    </div>

    <div class="form-group">
      <%= f.label :password %><br />
      <%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
    </div>

    <% if devise_mapping.rememberable? -%>
      <div class="form-group">
        <%= f.check_box :remember_me %>
        <%= f.label :remember_me %>
      </div>
    <% end -%>

    <div class="actions form-group">
      <%= f.submit "Log in", class: 'btn btn-default' %>
    </div>
  <% end %>

  <div class="form-group">
    <%= render "devise/shared/links", no_omniauth: true %>
  </div>  
</section>