修改成非本人不能删除其他人留言

This commit is contained in:
huangjingquan 2013-08-16 15:19:39 +08:00
parent 715c988656
commit 525cd70b62
1 changed files with 28 additions and 33 deletions

View File

@ -4,41 +4,36 @@
<% for journal in jour%> <% for journal in jour%>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td> <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td><table width="580px" border="0"> <td>
<tr> <table width="580px" border="0">
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <tr>
<% if @user == User.current%> <td colspan="2" valign="top"><strong> <%= link_to journal.user, user_path(journal.user)%></strong> <% if @user == User.current %> <span class="font_lighter"><%= l(:label_leave_me_message) %></span> <% else %> <span class="font_lighter"><%= l(:label_leave_others_message) %></span> <% end %> </td>
<span class="font_lighter"><%= l(:label_leave_me_message) %></span> </tr>
<% else %> <tr>
<span class="font_lighter"><%= l(:label_leave_others_message) %></span> <td colspan="2" width="580px" >
<% end %> <p class="font_description">
</td> <%= textilizable journal.notes%>
</tr> </p></td>
<tr> </tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td> <tr>
</tr> <td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td> <td width="200" align="right" class="a"> <% if @user == User.current %>
<td width="200" align="right" class="a"> <%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
<% if @user == User.current%> :method => 'post', :title => l(:button_quote))%>
<%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true, <%= link_to(image_tag('delete.png'), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user},
:method => 'post', :title => l(:button_quote))%><%= link_to(image_tag('delete.png'), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) if remove_allowed || journal.jour_id == User.current.id %></td>
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) if remove_allowed || journal.jour_id == User.current.id %> <% else %>
<% else %> <%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
<%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%>
:method => 'post', :title => l(:button_quote))%> <% end %>
<% end %> </tr>
</td> </table></td>
</tr> </tr>
</table></td>
</tr>
</table> </table>
<div class="line_under"></div> <div class="line_under"></div>
<% end %> <% end %>
<% end %> <% end %>