af83/chouette-core

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

Summary

Maintainability
Test Coverage
- content_for :page_header_title, t('.title')

- if Subscription.enabled?
  - content_for :page_header_actions do
    = 'devise.sessions.new.no_account'.t
    = link_to 'devise.sessions.new.sign_up'.t, new_user_registration_path, class: 'btn btn-default'

.page_content#devise
  .container-fluid
    #sessions_new.row
      = render 'devise/shared/intro'

      .col-md-4.login
        .panel.panel-default
          .panel-heading
            .panel-title= t('.sign_in')
          .panel-body
            - user = resource.is_a?(User) ? resource : User.new
            = simple_form_for(user, :as => :user, :url => session_path(:user), html: { :class => 'form-horizontal session_new' } ) do |form|

              = form.input :email, :label => false, input_html: { :class => "form-control" }

              - if user.email.present? && user.errors.empty?
                .row
                  .col-md-6
                    = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" }

                  .col-md-6
                    = form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary"

                .row.options
                  .col-md-6
                    - if devise_mapping.rememberable?
                      = form.input :remember_me, :as => :boolean if devise_mapping.rememberable?

                  .col-md-6.new_password
                    = mailer_link_to t("devise.links.new_password"), new_password_path(:user)

                    / FIXME ref #819
                    - if false
                      - if devise_mapping.confirmable? && controller_name != 'confirmations'
                        br
                        = mailer_link_to t("devise.links.new_confirmation"), new_confirmation_path(:user)

                - if user.organisation&.authentication
                  .row
                    .col-md-12
                      = link_to(t('.sign_in_with', authentication: user.organisation.authentication.name), user.organisation.authentication.sign_in_url(self), class: 'btn btn-default btn-primary')

              - else
                .row
                  .col-md-12
                    = form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary"

        = render 'devise/shared/support'

        = link_to 'https://enroute.mobi/', target: :blank, class: 'en-route' do
          = image_pack_tag 'static/enRoute-picto.svg'