delete leave message .
This commit is contained in:
parent
58ff68a9cc
commit
e4ae5e56fc
|
@ -73,9 +73,7 @@ class WordsController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
if User.current.admin? || @user.id == User.current.id || User.current.id == JournalsForMessage.find(params[:object_id]).jour_id
|
||||
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
|
||||
end
|
||||
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
|
||||
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); return false;"}
|
||||
%>
|
||||
|
||||
<% if @user == User.current %>
|
||||
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
|
||||
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) if (User.current.id == reply.user_id) || journal.jour_id == User.current.id %></td>
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</p>
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
||||
%>
|
||||
|
||||
<% if @user == User.current %>
|
||||
<% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %>
|
||||
<%= link_to(l(:label_newfeedback_delete), {: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)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => journal.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id %>
|
||||
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn", :style => "margin-top: 1px;"%>
|
||||
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "margin-top: 1px;"%>
|
||||
|
||||
<% end %>
|
Loading…
Reference in New Issue