diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-11-07 15:50:17 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-12-18 14:03:49 +0000 |
commit | 958895684ea51aee06bcc0abc795eb76017af7f0 (patch) | |
tree | 99faae05770c147e8719027e3c27c6a80018bc55 | |
parent | 17f7352a42554fb13baf43e63f116ca828553047 (diff) |
Use RESTful route for banned user list
-rw-r--r-- | app/controllers/admin_user_controller.rb | 2 | ||||
-rw-r--r-- | app/views/admin_user/_form.html.erb | 2 | ||||
-rw-r--r-- | app/views/admin_user/banned.html.erb (renamed from app/views/admin_user/list_banned.html.erb) | 0 | ||||
-rw-r--r-- | app/views/admin_user/index.html.erb | 2 | ||||
-rw-r--r-- | config/routes.rb | 5 |
5 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index 3379b9629..6031c816b 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -46,7 +46,7 @@ class AdminUserController < AdminController end end - def list_banned + def banned @banned_users = User.paginate :order => "name", :page => params[:page], :per_page => 100, :conditions => ["ban_text <> ''"] end diff --git a/app/views/admin_user/_form.html.erb b/app/views/admin_user/_form.html.erb index f1edc0927..01273a657 100644 --- a/app/views/admin_user/_form.html.erb +++ b/app/views/admin_user/_form.html.erb @@ -41,7 +41,7 @@ user from filing new requests, making annotations or messaging other users; the text is shown in public on the user's page and when they try to do a forbidden action; write in the second person (you); see - <%= link_to 'banned users', admin_user_list_banned_path %> for examples</small> + <%= link_to 'banned users', banned_admin_users_path %> for examples</small> </div> </div> </div> diff --git a/app/views/admin_user/list_banned.html.erb b/app/views/admin_user/banned.html.erb index ee17d9899..ee17d9899 100644 --- a/app/views/admin_user/list_banned.html.erb +++ b/app/views/admin_user/banned.html.erb diff --git a/app/views/admin_user/index.html.erb b/app/views/admin_user/index.html.erb index b1238f87a..cfb34fd7b 100644 --- a/app/views/admin_user/index.html.erb +++ b/app/views/admin_user/index.html.erb @@ -5,7 +5,7 @@ <%= form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %> <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails) - <%= link_to 'Banned users', admin_user_list_banned_path, :class => "btn btn-info" %> + <%= link_to 'Banned users', banned_admin_users_path, :class => "btn btn-info" %> <% end %> <%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %> diff --git a/config/routes.rb b/config/routes.rb index 7fc996e99..5fe36e617 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -273,9 +273,10 @@ Alaveteli::Application.routes.draw do scope '/admin', :as => 'admin' do resources :users, :controller => 'admin_user', - :except => [:new, :create, :destroy] + :except => [:new, :create, :destroy] do + get 'banned', :on => :collection + end end - match '/admin/user/banned' => 'admin_user#list_banned', :as => :admin_user_list_banned match '/admin/user/show_bounce_message/:id' => 'admin_user#show_bounce_message', :as => :admin_user_show_bounce match '/admin/user/clear_bounce/:id' => 'admin_user#clear_bounce', :as => :admin_user_clear_bounce match '/admin/user/destroy_track' => 'admin_user#destroy_track', :as => :admin_user_destroy_track |