Newer
Older
dmpopidor / app / views / shared / _login_form.html.erb
@briley briley on 9 Jun 2017 2 KB resolved cherry-pick conflicts
<% javascript "shared/login_form.js" %>

<% if Rails.application.config.shibboleth_enabled %>
  <h2 class="centered small-header"><%= _('Sign in with') %></h2>

  <span class="omniauth-options centered">
    <% if request.fullpath != "/users/sign_up?nosplash=true" && session[:shibboleth_data].nil? then%>
      <button id="shibboleth-login" href="<%= user_shibboleth_omniauth_authorize_path %>" class="omniauth-login">
        <%= _('Your Organisation') %>
      </button>
    <%else%>
      <%= f.hidden_field :shibboleth_id, :value => session[:shibboleth_data][:uid] %>
    <%end%> 
  </span>

  <h2 class="centered small-header">- <%= _('or') %> -</h2>
<% end %>  

<%= form_for resource, as: 'user', url: user_session_path, html: {class: "login-form roadmap-form"} do |f| %>
  <%= devise_error_messages! %>
  <fieldset id="sign-in-form" class="standard padded">
    <%= render partial: 'shared/accessible_input',
                locals: {type: 'email', id: 'user_email', name: 'user[email]', label: _("Email"),
                         classes: 'required'} %>
    
    <div class="form-input checkbox-right">
      <%= f.label :remember_me, _('Remember email'), class: "remember_div checkbox-label" %>
      <%= f.check_box :remember_me %>
    </div>
    
    <%= render partial: 'shared/accessible_input',
                locals: {type: 'password', id: 'user_password', name: 'user[password]', label: _("Password"),
                         classes: 'required'} %>
    
    <br />
    <%= render partial: 'shared/accessible_submit_button',
               locals: {id: 'sign-in-button', 
                        val: 'Sign In', 
                        disabled_initially: true,
                        classes: 'small-input-button',
                        tooltip: _('Enter your email and password.')} %>

    <div id="forgot-password-link" class="left-indent inline">
      <%= link_to _('Forgot password?'), new_password_path('user'), :class => "primary-color" %>
    </div>
  </fieldset>

<% end %>