diff options
| author | jpl | 2016-07-29 11:16:56 +0200 |
|---|---|---|
| committer | jpl | 2016-07-29 11:16:56 +0200 |
| commit | 958b0c7c44db15b7836714caf841588783f9e0d2 (patch) | |
| tree | f38cfee1147c9ff4a836ac49b325985241f8af46 /app | |
| parent | 9944f19bf67e366750acb09c1aa65dae660daa84 (diff) | |
| download | chouette-core-958b0c7c44db15b7836714caf841588783f9e0d2.tar.bz2 | |
Refs #1295: convert erb to slim (devise)
Diffstat (limited to 'app')
38 files changed, 249 insertions, 315 deletions
diff --git a/app/views/devise/_links.erb b/app/views/devise/_links.erb deleted file mode 100644 index e2a1bf3ef..000000000 --- a/app/views/devise/_links.erb +++ /dev/null @@ -1,41 +0,0 @@ -<% content_for :sidebar do %> -<ul class="actions"> - <li> - <%- if controller_name != 'sessions' %> - <%= link_to t(".sign_in"), new_session_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.registerable? && controller_name != 'registrations' && Rails.application.config.accept_user_creation %> - <%= link_to t(".sign_up"), new_registration_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <%= link_to t(".new_password"), new_password_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to t(".new_confirmation"), new_confirmation_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> - <% end -%> - <% end -%> - </li> -</ul> -<% end %> diff --git a/app/views/devise/_links.html.slim b/app/views/devise/_links.html.slim new file mode 100644 index 000000000..03e2a79e2 --- /dev/null +++ b/app/views/devise/_links.html.slim @@ -0,0 +1,32 @@ +- content_for :sidebar do + ul.actions + li + - if controller_name != 'sessions' + = link_to t(".sign_in"), new_session_path(resource_name) + br + + li + - if devise_mapping.registerable? && controller_name != 'registrations' && Rails.application.config.accept_user_creation + = link_to t(".sign_up"), new_registration_path(resource_name) + br + + li + - if devise_mapping.recoverable? && controller_name != 'passwords' + = link_to t(".new_password"), new_password_path(resource_name) + br + + li + - if devise_mapping.confirmable? && controller_name != 'confirmations' + = link_to t(".new_confirmation"), new_confirmation_path(resource_name) + br + + li + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) + br + + li + - if devise_mapping.omniauthable? + - resource_class.omniauth_providers.each do |provider| + = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) + br
\ No newline at end of file diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index dae3f3023..000000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<div id="sessions_new" class="row"> - <%= render 'devise/shared/intro' %> - <div class="col-md-4 login"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <div class="row"> - <div class="col-md-12"> - <%= form.button :submit, t('.title'), :class => "btn-primary" %> - </div> - </div> - <div class="row options"> - <div class="col-md-12 new_password"> - <%= link_to t('devise.links.sign_in'), new_session_path(resource_name) %> - </div> - </div> - <% end %> - </div> - </div> - </div> -</div> diff --git a/app/views/devise/confirmations/new.html.slim b/app/views/devise/confirmations/new.html.slim new file mode 100644 index 000000000..caaf7ae10 --- /dev/null +++ b/app/views/devise/confirmations/new.html.slim @@ -0,0 +1,17 @@ +#sessions_new.row + = render 'devise/shared/intro' + + .col-md-4.login + .panel.panel-default + .panel-heading = t('.title') + + .panel-body + = simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| + = form.input :email, :label => false, input_html: { :class => "form-control" } + .row + .col-md-12 + = form.button :submit, t('.title'), class: 'btn-primary' + + .row.options + .col-md-12.new_password + = link_to t('devise.links.sign_in'), new_session_path(resource_name)
\ No newline at end of file diff --git a/app/views/devise/invitations/edit.html.erb b/app/views/devise/invitations/edit.html.erb deleted file mode 100644 index b8683327d..000000000 --- a/app/views/devise/invitations/edit.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t "devise.invitations.edit.header" %></div> - <div class="panel-body"> - - <%= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put, class: "form-horizontal" } do |form| %> - <%= form.hidden_field :invitation_token %> - - <%= form.input :name %> - <%= form.input :password, :as => :password %> - <%= form.input :password_confirmation, :as => :password %> - - <div class="submit"> - <%= form.button :submit, :value => t("devise.invitations.edit.submit_button"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> diff --git a/app/views/devise/invitations/edit.html.slim b/app/views/devise/invitations/edit.html.slim new file mode 100644 index 000000000..6c9a6f436 --- /dev/null +++ b/app/views/devise/invitations/edit.html.slim @@ -0,0 +1,14 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('devise.invitations.edit.header') + + .panel-body + = simple_form_for resource, as: resource_name, :url => invitation_path(resource_name), :html => { :method => :put, class: "form-horizontal" } do |form| + = form.hidden_field :invitation_token + + = form.input :name + = form.input :password, as: :password + = form.input :password_confirmation, as: :password + + .submit + = form.button :submit, value: t('devise.invitations.edit.submit_button'), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/invitations/new.html.erb b/app/views/devise/invitations/new.html.erb deleted file mode 100644 index 25c452d42..000000000 --- a/app/views/devise/invitations/new.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<h2><%= t "devise.invitations.new.header" %></h2> - -<%= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post, class: "form-horizontal"} do |form| %> - <%= form.input :organisation_id, :as => :hidden, input_html: { :value => current_organisation.id } %> - - <% resource.class.invite_key_fields.each do |field| -%> - <%= form.input field %> - <% end -%> - - <div class="form-actions"> - <%= form.button :submit, :value => t("devise.invitations.new.submit_button"), :class => "btn-info" %> - </div> -<% end %> diff --git a/app/views/devise/invitations/new.html.slim b/app/views/devise/invitations/new.html.slim new file mode 100644 index 000000000..87bfbf750 --- /dev/null +++ b/app/views/devise/invitations/new.html.slim @@ -0,0 +1,10 @@ +h2 = t('devise.invitations.new.header') + += simple_form_for resource, as: resource_name, :url => invitation_path(resource_name), :html => {:method => :post, class: "form-horizontal"} do |form| + = form.input :organisation_id, :as => :hidden, input_html: { :value => current_organisation.id } + + - resource.class.invite_key_fields.each do |field| + = form.input field + + .form-actions + = form.button :submit, value: t('devise.invitations.new.submit_button'), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.fr.html.erb b/app/views/devise/mailer/confirmation_instructions.fr.html.erb deleted file mode 100644 index a719299ff..000000000 --- a/app/views/devise/mailer/confirmation_instructions.fr.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<p>Bonjour <%= @resource.email %>!</p> - -<p>Vous pouvez confirmer votre compte email en cliquant sur le lien suivant:</p> - -<p><%= link_to 'Confirmer mon compte', confirmation_url(@resource, :confirmation_token => @token) %></p> - diff --git a/app/views/devise/mailer/confirmation_instructions.fr.html.slim b/app/views/devise/mailer/confirmation_instructions.fr.html.slim new file mode 100644 index 000000000..6bdbb5f72 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.fr.html.slim @@ -0,0 +1,5 @@ +p = "Bonjour #{@resource.email} !" + +p = "Vous pouvez confirmer votre compte email en cliquant sur le lien suivant:" + +p = link_to 'Confirmer mon compte', confirmation_url(@resource, :confirmation_token => @token)
\ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index 99fd7b743..000000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<p>Welcome <%= @resource.email %>!</p> - -<p>You can confirm your account email through the link below:</p> - -<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p> diff --git a/app/views/devise/mailer/confirmation_instructions.html.slim b/app/views/devise/mailer/confirmation_instructions.html.slim new file mode 100644 index 000000000..0bf19ba19 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.slim @@ -0,0 +1,5 @@ +p = "Welcome #{@resource.email}!" + +p = "You can confirm your account email through the link below:" + +p = link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token)
\ No newline at end of file diff --git a/app/views/devise/mailer/invitation_instructions.fr.html.erb b/app/views/devise/mailer/invitation_instructions.fr.html.erb deleted file mode 100644 index a35a3ec1b..000000000 --- a/app/views/devise/mailer/invitation_instructions.fr.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<p><%= t("devise.mailer.invitation_instructions.hello", email: @resource.email) %></p> - -<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", url: unauthenticated_root_url) %></p> - -<p><%= link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) %></p> - -<p><%= t("devise.mailer.invitation_instructions.ignore").html_safe %></p> diff --git a/app/views/devise/mailer/invitation_instructions.fr.html.slim b/app/views/devise/mailer/invitation_instructions.fr.html.slim new file mode 100644 index 000000000..484e0d68d --- /dev/null +++ b/app/views/devise/mailer/invitation_instructions.fr.html.slim @@ -0,0 +1,7 @@ +p = t("devise.mailer.invitation_instructions.hello", email: @resource.email) + +p = t("devise.mailer.invitation_instructions.someone_invited_you", url: unauthenticated_root_url) + +p = link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) + +p = t("devise.mailer.invitation_instructions.ignore").html_safe
\ No newline at end of file diff --git a/app/views/devise/mailer/reset_password_instructions.fr.html.erb b/app/views/devise/mailer/reset_password_instructions.fr.html.erb deleted file mode 100644 index 7074a4c70..000000000 --- a/app/views/devise/mailer/reset_password_instructions.fr.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<p>Bonjour <%= @resource.email %>!</p> - -<p>Une demande de changement de mot de passe a été reçue, vous pouvez modifier votre mot de passe en suivant le lien ci-dessous.</p> - -<p><%= link_to 'Modifier mon mot de passe', edit_password_url(@resource, :reset_password_token => @token) %></p> - -<p>Si vous ne souhaitez pas modifier votre mot de passe, ignorez ce message.</p> -<p>Votre mot de passe est conservé jusqu'à ce que vous suiviez le lien ci-dessus et que vous définissiez un nouveau mot de passe.</p> - diff --git a/app/views/devise/mailer/reset_password_instructions.fr.html.slim b/app/views/devise/mailer/reset_password_instructions.fr.html.slim new file mode 100644 index 000000000..621d06978 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.fr.html.slim @@ -0,0 +1,8 @@ +p = "Bonjour #{@resource.email} !" + +p = "Une demande de changement de mot de passe a été reçue, vous pouvez modifier votre mot de passe en suivant le lien ci-dessous." + +p = link_to 'Modifier mon mot de passe', edit_password_url(@resource, :reset_password_token => @token) + +p = "Si vous ne souhaitez pas modifier votre mot de passe, ignorez ce message." +p = "Votre mot de passe est conservé jusqu'à ce que vous suiviez le lien ci-dessus et que vous définissiez un nouveau mot de passe."
\ No newline at end of file diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index 8489e53d8..000000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Someone has requested a link to change your password, and you can do this through the link below.</p> - -<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p> - -<p>If you didn't request this, please ignore this email.</p> -<p>Your password won't change until you access the link above and create a new one.</p> diff --git a/app/views/devise/mailer/reset_password_instructions.html.slim b/app/views/devise/mailer/reset_password_instructions.html.slim new file mode 100644 index 000000000..b577fb1e3 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.slim @@ -0,0 +1,8 @@ +p = "Hello #{@resource.email}!" + +p = "Someone has requested a link to change your password, and you can do this through the link below." + +p = link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) + +p = "If you didn't request this, please ignore this email." +p = "Your password won't change until you access the link above and create a new one."
\ No newline at end of file diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index 06ecbe409..000000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p> - -<p>Click the link below to unlock your account:</p> - -<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %></p> diff --git a/app/views/devise/mailer/unlock_instructions.html.slim b/app/views/devise/mailer/unlock_instructions.html.slim new file mode 100644 index 000000000..962245c88 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.slim @@ -0,0 +1,7 @@ +p = "Hello #{@resource.email}!" + +p = "Your account has been locked due to an excessive amount of unsuccessful sign in attempts." + +p = "Click the link below to unlock your account:" + +p = link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token)
\ No newline at end of file diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 0d3d1d99d..000000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: "form-horizontal" }) do |f| %> - - <%= f.input :reset_password_token, :as => :hidden %> - <%= f.input :password, :as => :password %> - <%= f.input :password_confirmation, :as => :password %> - - <div class="form-actions"> - <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> - <%= f.button :submit, :value => t("devise.passwords.edit.commit"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim new file mode 100644 index 000000000..c965704fd --- /dev/null +++ b/app/views/devise/passwords/edit.html.slim @@ -0,0 +1,13 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('.title') + .panel-body + = simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: "form-horizontal" }) do |f| + + = f.input :reset_password_token, as: :hidden + = f.input :password, as: :password + = f.input :password_confirmation, as: :password + + .form-actions + = link_to t("cancel"), unauthenticated_root_path, class: 'btn btn-default' + = f.button :submit, :value => t("devise.passwords.edit.commit"), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 9ca4842e6..000000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal' } ) do |form| %> - <%= form.input :email, :as => :email, placeholder: 'user@domain.com' %> - - <div class="form-actions"> - <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> - <%= form.button :submit, :value => t("devise.passwords.new.commit"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> - - diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim new file mode 100644 index 000000000..8a739ecc1 --- /dev/null +++ b/app/views/devise/passwords/new.html.slim @@ -0,0 +1,11 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('.title') + + .panel-body + = simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal' } ) do |form| + = form.input :email, :as => :email, placeholder: 'user@domain.com' + + .form-actions + = link_to t("cancel"), unauthenticated_root_path, class: 'btn btn-default' + = form.button :submit, :value => t("devise.passwords.new.commit"), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index dd3051098..000000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= title_tag t('.title') %> - -<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "form-horizontal", method: :put }) do |f| %> - <%= f.error_notification %> - - <div class="form-inputs"> - <%= f.input :email, required: true, autofocus: true %> - <%= f.input :name, required: true %> - - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> - <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p> - <% end %> - - <%= f.input :password, autocomplete: "off", required: false %> - <%= f.input :password_confirmation, required: false %> - <%= f.input :current_password, required: true %> - </div> - - <div class="form-actions"> - <%= f.button :submit %> - <%= link_to t("cancel"), :back %> - </div> -<% end %> diff --git a/app/views/devise/registrations/edit.html.slim b/app/views/devise/registrations/edit.html.slim new file mode 100644 index 000000000..42c84cb64 --- /dev/null +++ b/app/views/devise/registrations/edit.html.slim @@ -0,0 +1,19 @@ += title_tag t('.title') + += simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "form-horizontal", method: :put }) do |f| + = f.error_notification + + .form-inputs + = f.input :email, required: true, autofocus: true + = f.input :name, required: true + + - if devise_mapping.confirmable? && resource.pending_reconfirmation? + p = "Currently waiting confirmation for: #{resource.unconfirmed_email}." + + = f.input :password, autocomplete: "off", required: false + = f.input :password_confirmation, required: false + = f.input :current_password, required: true + + .form-actions + = f.button :submit + = link_to t('cancel'), :back
\ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 045357c22..000000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<div id="registrations_new" class="col-lg-offset-4 col-lg-4"> -<%= render partial: 'devise/shared/form_registration', locals: { - organisation: (resource.organisation || Organisation.new) -} %> -</div> diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim new file mode 100644 index 000000000..4dbe5b0bc --- /dev/null +++ b/app/views/devise/registrations/new.html.slim @@ -0,0 +1,4 @@ +#registrations_new.col-lg-offset-4.col-lg-4 + = render partial: 'devise/shared/form_registration', locals: { + organisation: (resource.organisation || Organisation.new) + }
\ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index 4df538161..000000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<div id="sessions_new" class="row"> - <%= render 'devise/shared/intro' %> - <div class="col-md-4 login"> - <div class="panel panel-default"> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal session_new' } ) do |form| %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <div class="row"> - <div class="col-md-6"> - <%= form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } %> - </div> - <div class="col-md-6"> - <%= form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary" %> - </div> - </div> - <div class="row options"> - <div class="col-md-6"> - <% if devise_mapping.rememberable? %> - <%= form.input :remember_me, :as => :boolean if devise_mapping.rememberable? %> - <% end %> - </div> - <div class="col-md-6 new_password"> - <%= link_to t("devise.links.new_password"), new_password_path(resource_name) %> - <!-- FIXME ref #819 --> - <%- if false %> - <% if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <br> - <%= link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) %> - <% end %> - <% end %> - </div> - </div> - <% end %> - </div> - </div> - <!-- FIXME ref #819 --> - <%- if false %> - <%= render partial: 'devise/shared/form_registration', locals: { - organisation: (resource.organisation || Organisation.new) } %> - <% end %> - - </div> -</div> - diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim new file mode 100644 index 000000000..c69f9dc3b --- /dev/null +++ b/app/views/devise/sessions/new.html.slim @@ -0,0 +1,34 @@ +#sessions_new.row + = render 'devise/shared/intro' + + .col-md-4.login + .panel.panel-default + .panel-body + = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal session_new' } ) do |form| + + = form.input :email, :label => false, input_html: { :class => "form-control" } + + .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 + = link_to t("devise.links.new_password"), new_password_path(resource_name) + + / FIXME ref #819 + - if false + - if devise_mapping.confirmable? && controller_name != 'confirmations' + br + = link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) + + / FIXME ref #819 + - if false + = render partial: 'devise/shared/form_registration', locals: { organisation: (resource.organisation || Organisation.new) }
\ No newline at end of file diff --git a/app/views/devise/shared/_form_registration.html.erb b/app/views/devise/shared/_form_registration.html.erb deleted file mode 100644 index 4b66121d6..000000000 --- a/app/views/devise/shared/_form_registration.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% if Rails.application.config.accept_user_creation %> - <div class="panel panel-default"> - <div class="panel-heading"><%= t("devise.registrations.new.title") %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label", html: { class: "form-horizontal registration_new" } ) do |form| %> - <%= form.simple_fields_for :organisation, organisation do |organisation| %> - <%= organisation.input :name, :label => false, input_html: { :class => "form-control" } %> - <% end %> - <%= form.input :name, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :password_confirmation, :as => :password, :label => false, input_html: { :class => "form-control" } %> - <%= form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info" %> - <% end %> - </div> - </div> -<% end %> diff --git a/app/views/devise/shared/_form_registration.html.slim b/app/views/devise/shared/_form_registration.html.slim new file mode 100644 index 000000000..5421ddc29 --- /dev/null +++ b/app/views/devise/shared/_form_registration.html.slim @@ -0,0 +1,13 @@ +- if Rails.application.config.accept_user_creation + .panel.panel-default + .panel-heading = t('devise.registrations.new.title') + .panel-body + = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label", html: { class: "form-horizontal registration_new" } ) do |form| + = form.simple_fields_for :organisation, organisation do |organisation| + = organisation.input :name, :label => false, input_html: { :class => "form-control" } + + = form.input :name, :label => false, input_html: { :class => "form-control" } + = form.input :email, :label => false, input_html: { :class => "form-control" } + = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } + = form.input :password_confirmation, :as => :password, :label => false, input_html: { :class => "form-control" } + = form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info"
\ No newline at end of file diff --git a/app/views/devise/shared/_intro.html.erb b/app/views/devise/shared/_intro.html.erb deleted file mode 100644 index b56559352..000000000 --- a/app/views/devise/shared/_intro.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="col-md-8 product_summary"> - <h2><%= t("devise.sessions.new.welcome") %></h2> - <p><%= t("devise.sessions.new.introduction1") %></p> - <p><%= t("devise.sessions.new.introduction2") %></p> - <ul> - <li>- <%= t("devise.sessions.new.introduction_item1") %></li> - <li>- <%= t("devise.sessions.new.introduction_item2") %></li> - </ul> -</div> diff --git a/app/views/devise/shared/_intro.html.slim b/app/views/devise/shared/_intro.html.slim new file mode 100644 index 000000000..5aafc3c6f --- /dev/null +++ b/app/views/devise/shared/_intro.html.slim @@ -0,0 +1,7 @@ +.col-md-8.product_summary + h2 = t("devise.sessions.new.welcome") + p = t("devise.sessions.new.introduction1") + p = t("devise.sessions.new.introduction2") + ul + li = "- #{t('devise.sessions.new.introduction_item1')}" + li = "- #{t('devise.sessions.new.introduction_item2')}"
\ No newline at end of file diff --git a/app/views/devise/shared/links.erb b/app/views/devise/shared/links.erb deleted file mode 100644 index a3a2f0b9b..000000000 --- a/app/views/devise/shared/links.erb +++ /dev/null @@ -1,32 +0,0 @@ -<% content_for :sidebar do %> -<ul class="actions"> - - <%- if controller_name != 'sessions' %> - <li> - <%= link_to t('devise.sessions.new.title'), new_session_path(resource_name) %> - </li> - <% end -%> - - <li> - <%= link_to t('subscriptions.actions.new'), new_subscription_path %> - </li> - - <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <li> - <%= link_to t('devise.passwords.new'), new_password_path(resource_name) %> - </li> - <% end -%> - - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <li> - <%= link_to t('devise.confirmations.new'), new_confirmation_path(resource_name) %> - </li> - <% end -%> - - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <li> - <%= link_to t('devise.unlock.new.title'), new_unlock_path(resource_name) %> - </li> - <% end -%> -</ul> -<% end %> diff --git a/app/views/devise/shared/links.html.slim b/app/views/devise/shared/links.html.slim new file mode 100644 index 000000000..4d203744f --- /dev/null +++ b/app/views/devise/shared/links.html.slim @@ -0,0 +1,21 @@ +- content_for :sidebar do + ul.actions + + - if controller_name != 'sessions' + li + = link_to t('devise.sessions.new.title'), new_session_path(resource_name) + + li + = link_to t('subscriptions.actions.new'), new_subscription_path + + - if devise_mapping.recoverable? && controller_name != 'passwords' + li + = link_to t('devise.passwords.new'), new_password_path(resource_name) + + - if devise_mapping.confirmable? && controller_name != 'confirmations' + li + = link_to t('devise.confirmations.new'), new_confirmation_path(resource_name) + + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + li + = link_to t('devise.unlock.new.title'), new_unlock_path(resource_name)
\ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index e59aa0003..000000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<h2><%= t('devise.unlock.new.title') %></h2> - -<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - - <p><%= f.label :email %><br /> - <%= f.text_field :email %></p> - - <p><%= f.submit t('devise.unlock.new.title') %></p> -<% end %> - -<%= render "links" %>
\ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.slim b/app/views/devise/unlocks/new.html.slim new file mode 100644 index 000000000..93276522e --- /dev/null +++ b/app/views/devise/unlocks/new.html.slim @@ -0,0 +1,14 @@ +h2 = t('devise.unlock.new.title') + += form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| + = devise_error_messages! + + p + = f.label :email + br + = f.text_field :email + + p = f.submit t('devise.unlock.new.title') + + += render "links"
\ No newline at end of file |
