#1650 老师应该可以删除自己课程的留言,或帖子

dev_chuangbin
sw 11 years ago
parent b512bc53e9
commit e6aab5baf2

@ -1,8 +1,10 @@
<div class="dis">
<div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%# 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;">
@ -30,5 +32,7 @@
<div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
</div>

@ -5,18 +5,29 @@
<% if journals.size > 0 %>
<% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><a target="_blank" href="#"><%= image_tag(url_to_avatar(journal.user)) %></a></div>
<div class="ping_dispic">
<a target="_blank" href="#">
<%= image_tag(url_to_avatar(journal.user)) %>
</a>
</div>
<div class="ping_discon" style="width: 85%;">
<div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
<span>
<%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
</span>
<span style="color:#a6a6a6; margin-right:40px; margin-left:30px;">
<%= format_time(journal.created_on) %>
</span>
<div class="cl"></div>
<p><%= textilizable journal.notes%></p>
<p>
<%= textilizable journal.notes%>
</p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span style="float: right">
<% if journal.user == User.current|| User.current.admin? %>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
@ -43,7 +54,7 @@
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
</div>
</div>
<div class="cl"></div>

@ -1,7 +1,8 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<% allow_delete ||= false%>
<div id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :allow_delete => allow_delete} %>
<% end %>
</div>

@ -1,4 +1,5 @@
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
<% allow_delete ||= false %>
<% if parent_jour%>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
@ -30,7 +31,7 @@
<%= format_time reply.created_on %>
</span>
<span class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if User.current.admin? || reply.user.id == User.current.id%>
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
<%= 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)) %>
<% end %>

Loading…
Cancel
Save