From bb3d4dc18c68f39a5c807906d59f2d57f52310ab Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 15 Apr 2016 17:16:57 +0300 Subject: [PATCH] convert devise to haml --- app/views/devise/passwords/edit.html.erb | 14 ------- app/views/devise/passwords/edit.html.haml | 11 +++++ app/views/devise/passwords/new.html.erb | 12 ------ app/views/devise/passwords/new.html.haml | 9 ++++ app/views/devise/registrations/edit.html.erb | 41 ------------------- app/views/devise/registrations/edit.html.haml | 32 +++++++++++++++ app/views/devise/registrations/new.html.erb | 23 ----------- app/views/devise/registrations/new.html.haml | 17 ++++++++ app/views/devise/sessions/new.html.erb | 28 ------------- app/views/devise/sessions/new.html.haml | 20 +++++++++ ...about_page_spec.rb => course_page_spec.rb} | 0 11 files changed, 89 insertions(+), 118 deletions(-) delete mode 100644 app/views/devise/passwords/edit.html.erb create mode 100644 app/views/devise/passwords/edit.html.haml delete mode 100644 app/views/devise/passwords/new.html.erb create mode 100644 app/views/devise/passwords/new.html.haml delete mode 100644 app/views/devise/registrations/edit.html.erb create mode 100644 app/views/devise/registrations/edit.html.haml delete mode 100644 app/views/devise/registrations/new.html.erb create mode 100644 app/views/devise/registrations/new.html.haml delete mode 100644 app/views/devise/sessions/new.html.erb create mode 100644 app/views/devise/sessions/new.html.haml rename spec/features/visitors/{about_page_spec.rb => course_page_spec.rb} (100%) diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index c9b94d0..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -
- <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> -

Change your password

- <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> -
- <%= f.label :password, 'New password' %> - <%= f.password_field :password, autofocus: true, autocomplete: 'off', class: 'form-control' %> - <%= f.label :password_confirmation, 'Confirm new password' %> - <%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %> -
- <%= f.submit 'Change my Password', :class => 'button right' %> - <% end %> -
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml new file mode 100644 index 0000000..9e62495 --- /dev/null +++ b/app/views/devise/passwords/edit.html.haml @@ -0,0 +1,11 @@ +.authform + = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| + %h3 Change your password + = devise_error_messages! + = f.hidden_field :reset_password_token + .form-group + = f.label :password, 'New password' + = f.password_field :password, autofocus: true, autocomplete: 'off', class: 'form-control' + = f.label :password_confirmation, 'Confirm new password' + = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' + = f.submit 'Change my Password', :class => 'button right' diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 70affd4..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -
- <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :role => 'form'}) do |f| %> -

Forgot your password?

-

We'll send password reset instructions.

- <%= devise_error_messages! %> -
- <%= f.label :email %> - <%= f.email_field :email, :autofocus => true, class: 'form-control' %> -
- <%= f.submit 'Reset Password', :class => 'button right' %> - <% end %> -
diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml new file mode 100644 index 0000000..2a8a16b --- /dev/null +++ b/app/views/devise/passwords/new.html.haml @@ -0,0 +1,9 @@ +.authform + = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :role => 'form'}) do |f| + %h3 Forgot your password? + %p We'll send password reset instructions. + = devise_error_messages! + .form-group + = f.label :email + = f.email_field :email, :autofocus => true, class: 'form-control' + = f.submit 'Reset Password', :class => 'button right' diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index 9c39b85..0000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -
-

Edit <%= resource_name.to_s.humanize %>

- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :role => 'form'}) do |f| %> - <%= devise_error_messages! %> -
- <%= f.label :name %> - <%= f.text_field :name, :autofocus => true, class: 'form-control' %> -
-
- <%= f.label :email %> - <%= f.email_field :email, class: 'form-control' %> - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
- <% end %> -
-
-

Leave these fields blank if you don't want to change your password.

-
- <%= f.label :password %> - <%= f.password_field :password, :autocomplete => 'off', class: 'form-control' %> -
-
- <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, class: 'form-control' %> -
-
-
-

You must enter your current password to make changes.

-
- <%= f.label :current_password %> - <%= f.password_field :current_password, class: 'form-control' %> -
-
- <%= f.submit 'Update', :class => 'button right' %> - <% end %> -
-
-

Cancel Account

-

Unhappy? We'll be sad to see you go.

-<%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete, :class => 'button right' %> -
diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml new file mode 100644 index 0000000..1c53702 --- /dev/null +++ b/app/views/devise/registrations/edit.html.haml @@ -0,0 +1,32 @@ +.authform + %h3 + Edit #{resource_name.to_s.humanize} + = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :role => 'form'}) do |f| + = devise_error_messages! + .form-group + = f.label :name + = f.text_field :name, :autofocus => true, class: 'form-control' + .form-group + = f.label :email + = f.email_field :email, class: 'form-control' + - if devise_mapping.confirmable? && resource.pending_reconfirmation? + %div + Currently waiting confirmation for: #{resource.unconfirmed_email} + %fieldset + %p Leave these fields blank if you don't want to change your password. + .form-group + = f.label :password + = f.password_field :password, :autocomplete => 'off', class: 'form-control' + .form-group + = f.label :password_confirmation + = f.password_field :password_confirmation, class: 'form-control' + %fieldset + %p You must enter your current password to make changes. + .form-group + = f.label :current_password + = f.password_field :current_password, class: 'form-control' + = f.submit 'Update', :class => 'button right' +.authform + %h3 Cancel Account + %p Unhappy? We'll be sad to see you go. + = button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete, :class => 'button right' diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 9198de4..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -
- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form'}) do |f| %> -

Sign up

- <%= devise_error_messages! %> -
- <%= f.label :name %> - <%= f.text_field :name, :autofocus => true, class: 'form-control' %> -
-
- <%= f.label :email %> - <%= f.email_field :email, class: 'form-control' %> -
-
- <%= f.label :password %> - <%= f.password_field :password, class: 'form-control' %> -
-
- <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, class: 'form-control' %> -
- <%= f.submit 'Sign up', :class => 'button right' %> - <% end %> -
diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml new file mode 100644 index 0000000..a85bc9b --- /dev/null +++ b/app/views/devise/registrations/new.html.haml @@ -0,0 +1,17 @@ +.authform + = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form'}) do |f| + %h3 Sign up + = devise_error_messages! + .form-group + = f.label :name + = f.text_field :name, :autofocus => true, class: 'form-control' + .form-group + = f.label :email + = f.email_field :email, class: 'form-control' + .form-group + = f.label :password + = f.password_field :password, class: 'form-control' + .form-group + = f.label :password_confirmation + = f.password_field :password_confirmation, class: 'form-control' + = f.submit 'Sign up', :class => 'button right' diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index f248bee..0000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :role => 'form'}) do |f| %> -

Sign in

- <%= devise_error_messages! %> -
- <%- if devise_mapping.registerable? %> - <%= link_to 'Sign up', new_registration_path(resource_name), class: 'right' %> - <% end -%> - <%= f.label :email %> - <%= f.email_field :email, :autofocus => true, class: 'form-control' %> -
-
- <%- if devise_mapping.recoverable? %> - <%= link_to "Forgot password?", new_password_path(resource_name), class: 'right' %> - <% end -%> - <%= f.label :password %> - <%= f.password_field :password, class: 'form-control' %> -
- <%= f.submit 'Sign in', :class => 'button right' %> - <% if devise_mapping.rememberable? -%> -
- -
- <% end -%> - <% end %> -
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml new file mode 100644 index 0000000..f65a547 --- /dev/null +++ b/app/views/devise/sessions/new.html.haml @@ -0,0 +1,20 @@ +.authform + = form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :role => 'form'}) do |f| + %h3 Sign in + = devise_error_messages! + .form-group + - if devise_mapping.registerable? + = link_to 'Sign up', new_registration_path(resource_name), class: 'right' + = f.label :email + = f.email_field :email, :autofocus => true, class: 'form-control' + .form-group + - if devise_mapping.recoverable? + = link_to "Forgot password?", new_password_path(resource_name), class: 'right' + = f.label :password + = f.password_field :password, class: 'form-control' + = f.submit 'Sign in', :class => 'button right' + - if devise_mapping.rememberable? + .checkbox{:style => "width:150px"} + %label + = f.check_box :remember_me + Remember me diff --git a/spec/features/visitors/about_page_spec.rb b/spec/features/visitors/course_page_spec.rb similarity index 100% rename from spec/features/visitors/about_page_spec.rb rename to spec/features/visitors/course_page_spec.rb