From a65d035f05bf00f9969f4c594050a522db119af4 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia <saurabh.a.bhatia@gmail.com> Date: Wed, 18 Jun 2014 18:14:48 +0800 Subject: [PATCH] fixed links in member summary and thumbnail --- app/views/admin/members/_member_for_summary.html.erb | 4 ++-- app/views/admin/members/_member_for_thumbnail.html.erb | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/admin/members/_member_for_summary.html.erb b/app/views/admin/members/_member_for_summary.html.erb index 6b779ed..6fa3c71 100644 --- a/app/views/admin/members/_member_for_summary.html.erb +++ b/app/views/admin/members/_member_for_summary.html.erb @@ -12,8 +12,8 @@ <p class="<%= @user_sex%>"></p> <div class="action"> <%= link_to(content_tag(:i, nil, :class => 'icon-edit'),edit_admin_member_path(member_for_summary),:class=>"edit" ) if current_user.is_admin?%> - <%= link_to(content_tag(:i, nil, :class => 'icon-key'),admin_member_edit_privilege_path(member_for_summary),:class=>"key" ) if current_user.is_admin? and current_user.id != member_for_summary.id %> - <%= link_to(content_tag(:i, nil, :class => 'icon-trash'), admin_members_path(member_for_summary, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"trash", :remote => true) if current_user.is_admin? %> + <%= link_to(content_tag(:i, nil, :class => 'icon-key'),admin_member_edit_privilege_path(member_for_summary),:class=>"key" ) if current_user.is_admin? and (current_user.id != member_for_summary.user.id if member_for_summary.user.present?) %> + <%= link_to(content_tag(:i, nil, :class => 'icon-trash'),admin_member_path(member_for_summary, at: params[:at]), data: { confirm: t('sure?') }, method: :delete, class: "trash", remote: true) if current_user.is_admin? %> </div> <%= image_tag(member_for_summary.avatar) %> </div> diff --git a/app/views/admin/members/_member_for_thumbnail.html.erb b/app/views/admin/members/_member_for_thumbnail.html.erb index 52f85f2..da1dddb 100644 --- a/app/views/admin/members/_member_for_thumbnail.html.erb +++ b/app/views/admin/members/_member_for_thumbnail.html.erb @@ -12,9 +12,8 @@ <div class="action"> <%= link_to(content_tag(:i, nil, :class => 'icon-edit'),edit_admin_member_path(member_for_thumbnail),:class=>"edit" ) if current_user.is_admin?%> - <%= link_to(content_tag(:i, nil, :class => 'icon-key'),:class=>"key" ) if current_user.is_admin? and current_user.id != member_for_thumbnail.id %> - <%= link_to(content_tag(:i, nil, :class => 'icon-trash'), admin_members_path(member_for_thumbnail, :at=>params[:at]), :confirm => t(:sure?), :method => :delete, :class=>"trash", :remote => true) if current_user.is_admin? %> - + <%= link_to(content_tag(:i, nil, :class => 'icon-key'),admin_member_edit_privilege_path(member_for_thumbnail),:class=>"key" ) if current_user.is_admin? and (current_user.id != member_for_thumbnail.user.id if member_for_thumbnail.user.present?) %> + <%= link_to(content_tag(:i, nil, :class => 'icon-trash'),admin_member_path(member_for_thumbnail, at: params[:at]), data: { confirm: t('sure?') }, method: :delete, class: "trash", remote: true) if current_user.is_admin? %> </div> <%= image_tag(member_for_thumbnail.avatar) %> </div>