修改课程讨论区、留言中姓名权限

szzh
huang 10 years ago
parent fc61edf1fa
commit 4db788c948

@ -40,7 +40,7 @@
<div class="talkmain_txt fl mt5 f14"> <div class="talkmain_txt fl mt5 f14">
<% author = topic.author.to_s %> <% author = topic.author.to_s %>
<div style="max-width:120px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;"> <div style="max-width:120px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">
<%= link_to "#{topic.author.show_name}(#{topic.author.login})", user_path(topic.author), :class =>"talkmain_name fl f14",:title=>author, <%= link_to User.current.member_of_course?(@board.course) ? "#{topic.author.show_name}(#{topic.author.login})" : "#{topic.author}" , user_path(topic.author), :class =>"talkmain_name fl f14",:title=>author,
:style=>'max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %> :style=>'max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %>
</div> </div>
<p style="float:left;color:#ff5722;">&nbsp;&nbsp;:</p> <p style="float:left;color:#ff5722;">&nbsp;&nbsp;:</p>
@ -162,7 +162,7 @@
<li nhname="reply_rec" style="display:<%= replies_all_i>2?'none':'' %>" id="topic<%=message.id%>"> <li nhname="reply_rec" style="display:<%= replies_all_i>2?'none':'' %>" id="topic<%=message.id%>">
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class => 'Msg_pic' %> <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class => 'Msg_pic' %>
<div class="Msg_txt"> <div class="Msg_txt">
<%= link_to_user_header message.author.show_name,false,:class => 'fl c_orange f14 ' %> <%= link_to_user_header User.current.member_of_course?(@board.course) ? (message.author.show_name + "(" +topic.author.login + ")") : message.author, false,:class => 'fl c_orange f14 ' %>
<br/> <br/>
<div class="fl break_word f14"> <div class="fl break_word f14">
<%= textAreailizable message,:content,:attachments => message.attachments %> <%= textAreailizable message,:content,:attachments => message.attachments %>

@ -9,7 +9,7 @@
<div class="ping_distop f14"> <div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span> <span>
<%= link_to "#{journal.user.show_name}(#{journal.user.login})", user_path(journal.user),:class => 'c_blue fb fl mb10 f14', :target => "_blank"%> <%= link_to User.current.member_of_course?(@course) ? "#{journal.user.show_name}(#{journal.user.login})" : "#{journal.user.login}", user_path(journal.user),:class => 'c_blue fb fl mb10 f14', :target => "_blank"%>
</span> </span>
<span class="c_grey fr f14"> <span class="c_grey fr f14">
<%= format_time(journal.created_on) %> <%= format_time(journal.created_on) %>
@ -24,8 +24,7 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %> <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
@ -43,9 +42,7 @@
</div> </div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true , :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %> <%= 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> <div class="cl"></div>
</div> </div>

@ -13,14 +13,20 @@
</div> </div>
<div class="recall_con"> <div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %> <% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to "#{reply.user.show_name}(#{reply.user.login})", user_path(reply.user) %> <% if User.current.member_of_course?(@course) %>
<%= link_to User.current.member_of_course?(@course)? "#{reply.user.show_name}(#{reply.user.login})" : "#{reply.user.login}" , user_path(reply.user) %>
<%= l(:label_reply_to)%> <%= l(:label_reply_to)%>
<% if show_name %> <% if show_name %>
<%= link_to "#{parent_jour.user.show_name}(#{parent_jour.user.login})", user_path(parent_jour.user) %> <%= link_to "#{parent_jour.user.show_name}(#{parent_jour.user.login})", user_path(parent_jour.user) %>
<% else %> <% else %>
<%= l(:label_anonymous) %> <%#= 之所以改成这样是因为觉得没有真实姓名的用“匿名用户”替换不合理 %>
<%= link_to "#{parent_jour.user}", user_path(parent_jour.user) %>
<% end %>
<% else %>
<%= link_to "#{reply.user}", user_path(reply.user) %>
<%= l(:label_reply_to)%>
<%= link_to "#{parent_jour.user}", user_path(parent_jour.user) %>
<% end %> <% end %>
<p> <p>
<%= reply.notes.html_safe %> <%= reply.notes.html_safe %>
</p> </p>

Loading…
Cancel
Save