匿名用户禁止回复
This commit is contained in:
parent
4b8a4c82c9
commit
eafbb20807
|
@ -28,7 +28,15 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
|
|
||||||
# default_scope { where('m_parent_id IS NULL') }
|
# default_scope { where('m_parent_id IS NULL') }
|
||||||
|
|
||||||
def remove_by_user? user
|
def self.create_by_user? user
|
||||||
|
if user.anonymous?
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.remove_by_user? user
|
||||||
if( self.user == user ||
|
if( self.user == user ||
|
||||||
( self.jour.kind_of?(User) && self.jour== user )
|
( self.jour.kind_of?(User) && self.jour== user )
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
|
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
|
||||||
<p class="font_lighter" style="font-size: 15px; padding-left: 85px; "><%=tip1%></p>
|
<p class="font_lighter" style="font-size: 15px; padding-left: 85px; "><%=tip1%></p>
|
||||||
|
|
||||||
|
@ -29,11 +30,13 @@
|
||||||
<span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span>
|
<span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span>
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
<span>
|
<span>
|
||||||
|
<% if reply_allow %>
|
||||||
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
|
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
|
||||||
:method => 'post', :title => l(:button_quote))%>
|
:method => 'post', :title => l(:button_quote))%>
|
||||||
<%= link_to l(:label_bid_respond_quote),'',
|
<%= link_to l(:label_bid_respond_quote),'',
|
||||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
||||||
%>
|
%>
|
||||||
|
<% end %>
|
||||||
<% if @user==User.current|| User.current.admin? %>
|
<% if @user==User.current|| User.current.admin? %>
|
||||||
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
||||||
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||||
|
@ -43,9 +46,11 @@
|
||||||
</span>
|
</span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
|
<% if reply_allow %>
|
||||||
<div id='<%= ids %>' class="respond-form">
|
<div id='<%= ids %>' class="respond-form">
|
||||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<div>
|
<div>
|
||||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<div style="margin-left: 20px;">
|
<div style="margin-left: 20px;">
|
||||||
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span>
|
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span>
|
||||||
<span class="body">
|
<span class="body">
|
||||||
|
|
|
@ -36,17 +36,27 @@ function checkMaxLength() {
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- fq -->
|
<!-- fq -->
|
||||||
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
|
|
||||||
<h3><%= l(:label_user_response) %></h3>
|
<h3><%= l(:label_user_response) %></h3>
|
||||||
|
<% if !User.current.logged?%>
|
||||||
|
<div style="font-size: 14px;margin:20px;">
|
||||||
|
<%= l(:label_user_login_tips) %>
|
||||||
|
<%= link_to l(:label_user_login_new), signin_path %>
|
||||||
|
<hr/>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
<div style="width: 80%; margin-left:10%;">
|
<div style="width: 80%; margin-left:10%;">
|
||||||
<%= form_for('new_form', :method => :post,
|
<%= form_for('new_form', :method => :post,
|
||||||
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
|
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
|
||||||
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
||||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||||
:style => "resize: none; width: 98%",
|
:style => "resize: none; width: 98%",
|
||||||
:class => 'noline'%>
|
:class => 'noline'%>
|
||||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
|
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<% if @jour.size >0 %>
|
<% if @jour.size >0 %>
|
||||||
<ul class="message-for-user">
|
<ul class="message-for-user">
|
||||||
|
@ -59,18 +69,22 @@ function checkMaxLength() {
|
||||||
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
|
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
|
||||||
<% id = 'project_respond_form_'+journal.id.to_s%>
|
<% id = 'project_respond_form_'+journal.id.to_s%>
|
||||||
<span>
|
<span>
|
||||||
<%= link_to l(:label_projects_feedback_respond),'',
|
<% if reply_allow %>
|
||||||
|
<%= link_to l(:label_projects_feedback_respond),'#',
|
||||||
{:focus => 'project_respond',
|
{:focus => 'project_respond',
|
||||||
:onclick => "toggleAndSettingWordsVal($('##{id}'),
|
:onclick => "toggleAndSettingWordsVal($('##{id}'),
|
||||||
$('##{id} textarea'),
|
$('##{id} textarea'),
|
||||||
'#{l(:label_reply_plural)} #{journal.user.show_name}: ');
|
'#{l(:label_reply_plural)} #{journal.user.show_name}: ');
|
||||||
return false;"} %>
|
return false;"} %>
|
||||||
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
|
<% if reply_allow %>
|
||||||
<div id='<%= id %>' class="respond-form">
|
<div id='<%= id %>' class="respond-form">
|
||||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<div>
|
<div>
|
||||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
|
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
|
||||||
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
|
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
|
||||||
<span class="portrait">
|
<span class="portrait">
|
||||||
|
@ -12,10 +13,12 @@
|
||||||
<p>
|
<p>
|
||||||
<span class="time"><%= format_time reply.created_on %></span>
|
<span class="time"><%= format_time reply.created_on %></span>
|
||||||
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
|
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
|
||||||
|
<% if reply_allow %>
|
||||||
<%= link_to l(:label_projects_feedback_respond),'',
|
<%= link_to l(:label_projects_feedback_respond),'',
|
||||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.show_name}: '); return false;"}
|
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.show_name}: '); return false;"}
|
||||||
%>
|
%>
|
||||||
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
|
<% end %>
|
||||||
|
<% 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},
|
<%= 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)) %>
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -23,7 +26,9 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div id='<%=id%>' class="respond-form">
|
<div id='<%=id%>' class="respond-form">
|
||||||
|
<% if reply_allow %>
|
||||||
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
|
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
</li>
|
</li>
|
|
@ -35,6 +35,7 @@ function checkMaxLength() {
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<% if jour.size >0 %>
|
<% if jour.size >0 %>
|
||||||
<% remove_allowed = (User.current.id == jour.first.user_id) %>
|
<% remove_allowed = (User.current.id == jour.first.user_id) %>
|
||||||
<ul class="message-for-user">
|
<ul class="message-for-user">
|
||||||
|
@ -49,10 +50,11 @@ function checkMaxLength() {
|
||||||
<span class="font_lighter"> <%= l :label_comment_time %>: <%= format_time journal.created_on %></span>
|
<span class="font_lighter"> <%= l :label_comment_time %>: <%= format_time journal.created_on %></span>
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
<span>
|
<span>
|
||||||
<%= link_to l(:label_projects_feedback_respond),'',
|
<% if reply_allow %>
|
||||||
|
<%= link_to l(:label_projects_feedback_respond),'',
|
||||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
||||||
%>
|
%>
|
||||||
|
<% end %>
|
||||||
<% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %>
|
<% 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},
|
<%= 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)) %>
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||||
|
@ -61,7 +63,9 @@ function checkMaxLength() {
|
||||||
</span>
|
</span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<div id='<%= ids %>' class="respond-form">
|
<div id='<%= ids %>' class="respond-form">
|
||||||
|
<% if reply_allow %>
|
||||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue