From 8a6a2b6cd1f03c8d7e58047fc72bad9bb6fe05bb Mon Sep 17 00:00:00 2001 From: Ilya Konanykhin Date: Sun, 25 Dec 2016 01:08:57 +0600 Subject: [PATCH] Cleanup: removed unused views and controller. --- app/controllers/users_controller.rb | 34 --------- app/views/devise/confirmations/new.html.erb | 12 ---- app/views/devise/registrations/edit.html.erb | 25 ------- app/views/devise/unlocks/new.html.erb | 12 ---- app/views/users/_form.html.haml | 68 ------------------ app/views/users/edit.html.haml | 4 -- app/views/users/index.html.haml | 28 -------- app/views/users/new.html.haml | 4 -- app/views/users/show.html.haml | 73 -------------------- 9 files changed, 260 deletions(-) delete mode 100644 app/controllers/users_controller.rb delete mode 100644 app/views/devise/confirmations/new.html.erb delete mode 100644 app/views/devise/registrations/edit.html.erb delete mode 100644 app/views/devise/unlocks/new.html.erb delete mode 100644 app/views/users/_form.html.haml delete mode 100644 app/views/users/edit.html.haml delete mode 100644 app/views/users/index.html.haml delete mode 100644 app/views/users/new.html.haml delete mode 100644 app/views/users/show.html.haml diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb deleted file mode 100644 index ed62891..0000000 --- a/app/controllers/users_controller.rb +++ /dev/null @@ -1,34 +0,0 @@ -class UsersController < AuthenticatedController - expose(:user) - expose(:users) { User.order('id').paginate(:page => params[:page]) } - - def index - end - - def show - end - - def new - end - - def create - if user.save - redirect_to user - else - render :new - end - end - - def update - if user.save - redirect_to user - else - render :edit - end - end - - def destroy - user.destroy - redirect_to bikes_url - end -end diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index f998e05..0000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Resend confirmation instructions

- -<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.submit "Resend confirmation instructions" %>
-<% end %> - -<%= render "links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index bb66fbf..0000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -

Edit <%= resource_name.to_s.humanize %>

- -<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, :autocomplete => "off" %>
- -
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>
- -
<%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password %>
- -
<%= f.submit "Update" %>
-<% end %> - -

Cancel my account

- -

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.

- -<%= link_to "Back", :back %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 8ab26cc..0000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Resend unlock instructions

- -<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.submit "Resend unlock instructions" %>
-<% end %> - -<%= render "links" %> diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml deleted file mode 100644 index df83a93..0000000 --- a/app/views/users/_form.html.haml +++ /dev/null @@ -1,68 +0,0 @@ -= form_for @user, :html => { :class => 'form-horizontal' } do |f| - .control-group - = f.label :email, :class => 'control-label' - .controls - = f.text_field :email, :class => 'text_field' - .control-group - = f.label :encrypted_password, :class => 'control-label' - .controls - = f.text_field :encrypted_password, :class => 'text_field' - .control-group - = f.label :reset_password_token, :class => 'control-label' - .controls - = f.text_field :reset_password_token, :class => 'text_field' - .control-group - = f.label :reset_password_sent_at, :class => 'control-label' - .controls - = f.datetime_select :reset_password_sent_at, :class => 'datetime_select' - .control-group - = f.label :remember_created_at, :class => 'control-label' - .controls - = f.datetime_select :remember_created_at, :class => 'datetime_select' - .control-group - = f.label :sign_in_count, :class => 'control-label' - .controls - = f.number_field :sign_in_count, :class => 'number_field' - .control-group - = f.label :current_sign_in_at, :class => 'control-label' - .controls - = f.datetime_select :current_sign_in_at, :class => 'datetime_select' - .control-group - = f.label :last_sign_in_at, :class => 'control-label' - .controls - = f.datetime_select :last_sign_in_at, :class => 'datetime_select' - .control-group - = f.label :current_sign_in_ip, :class => 'control-label' - .controls - = f.text_field :current_sign_in_ip, :class => 'text_field' - .control-group - = f.label :last_sign_in_ip, :class => 'control-label' - .controls - = f.text_field :last_sign_in_ip, :class => 'text_field' - .control-group - = f.label :failed_attempts, :class => 'control-label' - .controls - = f.number_field :failed_attempts, :class => 'number_field' - .control-group - = f.label :unlock_token, :class => 'control-label' - .controls - = f.text_field :unlock_token, :class => 'text_field' - .control-group - = f.label :locked_at, :class => 'control-label' - .controls - = f.datetime_select :locked_at, :class => 'datetime_select' - .control-group - = f.label :first_name, :class => 'control-label' - .controls - = f.text_field :first_name, :class => 'text_field' - .control-group - = f.label :last_name, :class => 'control-label' - .controls - = f.text_field :last_name, :class => 'text_field' - .control-group - = f.label :nickname, :class => 'control-label' - .controls - = f.text_field :nickname, :class => 'text_field' - .form-actions - = f.submit nil, :class => 'btn btn-primary' - = link_to t('.cancel', :default => t("helpers.links.cancel")), users_path, :class => 'btn' diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml deleted file mode 100644 index 6bd83b2..0000000 --- a/app/views/users/edit.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -- model_class = user.class -.page-header - %h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}") -= render :partial => "form" diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml deleted file mode 100644 index ae77a3b..0000000 --- a/app/views/users/index.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -- model_class = User.new.class -.page-header - %h1=t '.title', :default => model_class.model_name.human.pluralize -%table.table.table-striped - %thead - %tr - %th= model_class.human_attribute_name(:id) - %th= model_class.human_attribute_name(:email) - %th= model_class.human_attribute_name(:first_name) - %th= model_class.human_attribute_name(:last_name) - %th= model_class.human_attribute_name(:nickname) - %th= model_class.human_attribute_name(:created_at) - %th=t '.actions', :default => t("helpers.actions") - %tbody - - users.each do |user| - %tr - %td= link_to user.id, user_path(user) - %td= link_to user.email, user_path(user) - %td= user.first_name - %td= user.last_name - %td= user.nickname - %td=l user.created_at - %td - = link_to t('.edit', :default => t("helpers.links.edit")), edit_user_path(user), :class => 'btn btn-mini' - = link_to t('.destroy', :default => t("helpers.links.destroy")), user_path(user), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger' - -= will_paginate users -= link_to t('.new', :default => t("helpers.links.new")), new_user_path, :class => 'btn btn-primary' diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml deleted file mode 100644 index 5252fa4..0000000 --- a/app/views/users/new.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -- model_class = user.class -.page-header - %h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}") -= render :partial => "form" diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml deleted file mode 100644 index 4387703..0000000 --- a/app/views/users/show.html.haml +++ /dev/null @@ -1,73 +0,0 @@ -- model_class = user.class -.page-header - %h1=t '.title', :default => model_class.model_name.human - -%p - %strong= model_class.human_attribute_name(:email) + ':' - %br - = user.email -%p - %strong= model_class.human_attribute_name(:encrypted_password) + ':' - %br - = user.encrypted_password -%p - %strong= model_class.human_attribute_name(:reset_password_token) + ':' - %br - = user.reset_password_token -%p - %strong= model_class.human_attribute_name(:reset_password_sent_at) + ':' - %br - = user.reset_password_sent_at -%p - %strong= model_class.human_attribute_name(:remember_created_at) + ':' - %br - = user.remember_created_at -%p - %strong= model_class.human_attribute_name(:sign_in_count) + ':' - %br - = user.sign_in_count -%p - %strong= model_class.human_attribute_name(:current_sign_in_at) + ':' - %br - = user.current_sign_in_at -%p - %strong= model_class.human_attribute_name(:last_sign_in_at) + ':' - %br - = user.last_sign_in_at -%p - %strong= model_class.human_attribute_name(:current_sign_in_ip) + ':' - %br - = user.current_sign_in_ip -%p - %strong= model_class.human_attribute_name(:last_sign_in_ip) + ':' - %br - = user.last_sign_in_ip -%p - %strong= model_class.human_attribute_name(:failed_attempts) + ':' - %br - = user.failed_attempts -%p - %strong= model_class.human_attribute_name(:unlock_token) + ':' - %br - = user.unlock_token -%p - %strong= model_class.human_attribute_name(:locked_at) + ':' - %br - = user.locked_at -%p - %strong= model_class.human_attribute_name(:first_name) + ':' - %br - = user.first_name -%p - %strong= model_class.human_attribute_name(:last_name) + ':' - %br - = user.last_name -%p - %strong= model_class.human_attribute_name(:nickname) + ':' - %br - = user.nickname - -.form-actions - = link_to t('.back', :default => t("helpers.links.back")), users_path, :class => 'btn' - = link_to t('.edit', :default => t("helpers.links.edit")), edit_user_path(user), :class => 'btn' - = link_to t('.destroy', :default => t("helpers.links.destroy")), user_path(user), :method => "delete", :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-danger'