<%= form_for resource, as: 'user', namespace: 'signin', url: user_session_path, html: {id: "sign_in_form"} do |f| %>
  <div class="form-group">
    <%= f.label(:email, _('Email'), class: 'control-label') %>
    <%= f.email_field(:email, class: 'form-control', "aria-required": true) %>
  </div>
  <div class="form-group">
    <%= f.label(:password, _('Password'), class: 'control-label') %>
    <%= f.password_field(:password, class: 'form-control', "aria-required": true) %>
  </div>
  <div>
    <%= link_to _('Forgot password?'), new_password_path('user') %>
  </div>
  <div class="checkbox">
    <%= label_tag 'remember_email' do %>
      <%= check_box_tag 'remember_email' %>
      <%= _('Remember email') %>
    <% end %>
  </div>
  <%= f.button(_('Sign in'), class: "btn btn-default", type: "submit") %>

  <% if Rails.application.config.shibboleth_enabled %>
    <% if session['devise.shibboleth_data'].nil? %>
      <h4 class="text-center">- <%= _('or') %> -</h4>
      <div class="form-group">
        <span class="center-block btn-group-justified">
          <% target = (Rails.application.config.shibboleth_use_filtered_discovery_service ? shibboleth_ds_path : user_shibboleth_omniauth_authorize_path) %>
          <%= link_to _('Sign in with your institutional credentials'), target, method: :post, class: 'btn btn-default' %>
        </span>
      </div>
    <% else %>
      <%= f.hidden_field :shibboleth_id, :value => session['devise.shibboleth_data']['uid'] %>
    <% end %>
  <% end %>

<% end %>
