diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 796ac9f..77b9b86 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -93,10 +93,4 @@ class UsersController < ApplicationController redirect_to root_path end end - - def check_for_cancel - if params[:commit] == 'cancel' - redirect_to :back - end - end end diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index fd5181b..e28f615 100755 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,24 +1,30 @@ -

Edit <%= resource_name.to_s.humanize %>

+
+
+

User Control Panel

+
+
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> - <%= devise_error_messages! %> + <%= 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 :email %> + <%= f.email_field :email %>

-

<%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password %>

+

<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password %>

-

<%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation %>

+

<%= 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.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>

-

- <%= f.submit "Update", :class=> 'btn btn-primary'%> <%= button_tag "Cancel", :confirm => 'Are you sure? Any changes will be lost.', :class => 'btn', :type => 'submit', :name => 'commit', :value => 'cancel' %> -

-<% end %> +

+ <%= f.submit "Update", :class=> 'btn btn-primary'%> <%= button_tag "Cancel", :confirm => 'Are you sure? Any changes will be lost.', :class => 'btn', :type => 'submit', :name => 'commit', :value => 'cancel' %> +

+ <% end %> -

Unhappy?

-<%= button_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete, :class =>'btn btn-danger' %> +

Unhappy?

+ <%= button_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete, :class =>'btn btn-danger' %> +
+
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 80d2317..e7f22dc 100755 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -11,24 +11,26 @@ <% end %> -

<%= f.label :username %>
- <%= f.text_field :username %>

- -

<%= f.label :is_admin %> - <%= f.check_box :is_admin, {checked: @user.admin?} %>

+ <%= f.label :username %> + <%= f.text_field :username %> + +

+ Administrator   <%= f.check_box :is_admin, {checked: @user.admin?} %> +

-

<%= f.label :email %>
- <%= f.email_field :email %>

+ <%= f.label :email %> + <%= f.email_field :email %> +
<% if action_name == "new" %> -

<%= f.label :password, "New password" %>
- <%= f.password_field :password %>

+ <%= f.label :password, "New password" %> + <%= f.password_field :password %> -

<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>

+ <%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation %> <% end %>
- <%= f.submit %> + <%= f.submit :class => 'btn btn-primary' %>
<% end %> diff --git a/app/views/users/_passwords.html.erb b/app/views/users/_passwords.html.erb index 069af25..d80edf8 100755 --- a/app/views/users/_passwords.html.erb +++ b/app/views/users/_passwords.html.erb @@ -11,13 +11,13 @@ <% end %> -

<%= f.label :password, "New password" %>
- <%= f.password_field :password %>

+ <%= f.label :password, "New password" %> + <%= f.password_field :password %> -

<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>

+ <%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation %>
- <%= f.submit "Change password" %> + <%= f.submit "Change password", :class => 'btn btn-primary' %>
<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 475faa7..b891bcc 100755 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,7 +1,13 @@ -

Edit user

+
+
+

Edit User

+
-<%= render 'form' %> -

-<%= render 'passwords' %> + <%= render 'form' %> +

+ <%= render 'passwords' %> -<%= link_to 'All users', users_path %> + <%= button_to 'All users', users_path, :class => 'btn', :method=> 'get' %> + +
+
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 90aeca7..cbae113 100755 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,18 +1,18 @@
-

All Users

+

Users Administration

- - - - - - - + + + + + + @@ -27,14 +27,14 @@ - - + + <% end %>
UsernameEmailLogin CountLast Sign InAdminCreated AtLast EditedUsernameEmail + Login CountLast Sign InAdminCreated AtLast Edited
<%= user.admin? %> <%= user.created_at.to_s(:datetime).downcase %> <%= user.updated_at.to_s(:datetime).downcase %><%= link_to "Edit", edit_user_path(user) %><%= link_to "Delete", user, :method => :delete, :confirm => "Are you sure?" %><%= button_to "Edit", edit_user_path(user), :class => 'btn', :method => "get" %><%= button_to "Delete", user, :method => :delete, :confirm => "Are you sure?", :class => 'btn btn-danger', :method => "get" %>
<%= paginate(@users)%>
-

<%= link_to "New User", new_user_path %>

+

<%= button_to "New User", new_user_path, :class => 'btn btn-primary', :method => "get" %>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 96a0e5d..285e3c3 100755 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,5 +1,12 @@ -

Sign up

+
+
+

New User

+
+ +
+ <%= render 'form' %> -<%= render 'form' %> + <%= link_to 'All users', users_path %> -<%= link_to 'All users', users_path %> +
+
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index bd723b3..95fe5fc 100755 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,2 +1,7 @@ -

<%= @user.username %>

+
+
+ +

Users Administration

+
+

<%= @user.username %>

<%= @user.email %>

diff --git a/config/routes.rb b/config/routes.rb index 0952caf..0fcbe8c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,8 @@ Community::Application.routes.draw do root :to => 'categories#index', :via => :get end - devise_for :users + devise_for :users, :controllers => {:registrations => "registrations"} + scope "/admin" do resources :users end