Commit 2915c278278064ccf6fbb4d5dfd9be8ee400619c
1 parent
377d910b
Exists in
master
and in
29 other branches
Add confirm message for ban, activate/deactivate
(ActionItem3021) Signed-off-by: Alex Campelo <campelo.al1@gmail.com> Signed-off-by: Gustavo Jaruga <darksshades@hotmail.com> Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com>
Showing
3 changed files
with
16 additions
and
6 deletions
Show diff stats
app/controllers/admin/users_controller.rb
@@ -42,11 +42,14 @@ class UsersController < AdminController | @@ -42,11 +42,14 @@ class UsersController < AdminController | ||
42 | def deactivate | 42 | def deactivate |
43 | person = environment.people.find(params[:id]) | 43 | person = environment.people.find(params[:id]) |
44 | person.user.deactivate | 44 | person.user.deactivate |
45 | + puts "++"*80, person | ||
46 | + puts "++"*80, person.user | ||
47 | + puts "++"*80, person.user.activated? | ||
45 | redirect_to :action => :index, :q => params[:q], :filter => params[:filter] | 48 | redirect_to :action => :index, :q => params[:q], :filter => params[:filter] |
46 | end | 49 | end |
47 | 50 | ||
48 | 51 | ||
49 | - def destroy_user() | 52 | + def destroy_user |
50 | person = environment.people.find(params[:id]) | 53 | person = environment.people.find(params[:id]) |
51 | person.destroy | 54 | person.destroy |
52 | session[:notice] = _('The profile was deleted.') | 55 | session[:notice] = _('The profile was deleted.') |
app/views/users/_users_list.rhtml
@@ -19,16 +19,18 @@ | @@ -19,16 +19,18 @@ | ||
19 | <td class='actions'> | 19 | <td class='actions'> |
20 | <div class="members-buttons-cell"> | 20 | <div class="members-buttons-cell"> |
21 | <% if p.is_admin? %> | 21 | <% if p.is_admin? %> |
22 | - <%= button_without_text :'reset-admin-role', _('Reset admin role'), :action => 'reset_admin_role', :id => p, :q => @q, :filter => @filter %> | 22 | + <%= button_without_text :'reset-admin-role', _('Reset admin role'), {:action => 'reset_admin_role', :id => p, :q => @q}, :filter => @filter, :confirm => "delete_article_message(@article)" %> |
23 | <% else %> | 23 | <% else %> |
24 | - <%= button_without_text :'set-admin-role', _('Set admin role'), :action => 'set_admin_role', :id => p, :q => @q, :filter => @filter %> | 24 | + <%= button_without_text :'set-admin-role', _('Set admin role'), {:action => 'set_admin_role', :id => p, :q => @q}, :filter => @filter, :confirm => "delete_article_message(@article)" %> |
25 | <% end %> | 25 | <% end %> |
26 | <% if !p.user.activated? %> | 26 | <% if !p.user.activated? %> |
27 | - <%= button_without_text :'activate-user', _('Activate user'), :action => 'activate', :id => p, :q => @q, :filter => @filter %> | 27 | + <%= button_without_text :'activate-user', _('Activate user'), {:action => 'activate', :id => p, :q => @q}, :filter => @filter, :confirm => "delete_article_message(@article)" %> |
28 | <% else %> | 28 | <% else %> |
29 | - <%= button_without_text :'deactivate-user', _('Deactivate user'), :action => 'deactivate', :id => p, :q => @q, :filter => @filter %> | 29 | + <%= button_without_text :'deactivate-user', _('Deactivate user'), {:action => 'deactivate', :id => p, :q => @q}, :filter => @filter, :confirm => "delete_article_message(@article)" %> |
30 | <% end %> | 30 | <% end %> |
31 | - <%= button_without_text :'ban-user', _('Ban User'), :action => 'destroy_user', :id => p, :q => @q, :filter => @filter %> | 31 | + |
32 | + <%= button_without_text :'delete', _('Ban'), {:action => :destroy_user, :id => p, :q => @q}, :filter => @filter, :confirm => "delete_article_message(@article)" %> | ||
33 | + | ||
32 | </div> | 34 | </div> |
33 | </td> | 35 | </td> |
34 | </tr> | 36 | </tr> |
public/stylesheets/application.css
@@ -4196,6 +4196,11 @@ h1#agenda-title { | @@ -4196,6 +4196,11 @@ h1#agenda-title { | ||
4196 | display: block; | 4196 | display: block; |
4197 | float: left; | 4197 | float: left; |
4198 | } | 4198 | } |
4199 | + | ||
4200 | +.actions .members-buttons-cell { | ||
4201 | +width : 100px | ||
4202 | +} | ||
4203 | + | ||
4199 | .controller-profile_members .msie6 .button-bar a { | 4204 | .controller-profile_members .msie6 .button-bar a { |
4200 | position: relative; | 4205 | position: relative; |
4201 | } | 4206 | } |