2015-12-06 15:03:36 +08:00
|
|
|
|
<%= content_for(:header_tags) do %>
|
|
|
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
2015-10-13 11:03:22 +08:00
|
|
|
|
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
function expand_reply(container,btnid){
|
|
|
|
|
var target = $(container).children();
|
|
|
|
|
var btn = $(btnid);
|
|
|
|
|
if(btn.data('init')=='0'){
|
|
|
|
|
btn.data('init',1);
|
2015-10-14 14:19:59 +08:00
|
|
|
|
btn.html('收起回复');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
target.show();
|
|
|
|
|
}else{
|
|
|
|
|
btn.data('init',0);
|
2015-10-14 14:19:59 +08:00
|
|
|
|
btn.html('展开更多');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
target.hide();
|
|
|
|
|
target.eq(0).show();
|
|
|
|
|
target.eq(1).show();
|
2015-10-14 14:19:59 +08:00
|
|
|
|
target.eq(2).show();
|
2015-10-09 14:39:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$(function() {
|
2015-12-14 17:13:57 +08:00
|
|
|
|
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
|
2015-10-16 10:18:51 +08:00
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
2015-10-09 14:39:40 +08:00
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
|
<div class="postDetailPortrait">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="postThemeWrap">
|
2015-12-31 14:00:33 +08:00
|
|
|
|
<% if User.current.logged? %>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
2015-12-31 14:00:33 +08:00
|
|
|
|
<% if @topic.author.id == User.current.id %>
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.course_editable_by?(User.current) %>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.course_destroyable_by?(User.current) %>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<li> <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<%end%>
|
|
|
|
|
<div class="postDetailTitle fl">
|
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
<div class="postDetailCreater">
|
2015-10-12 17:19:55 +08:00
|
|
|
|
<% if @topic.try(:author).try(:realname) == ' ' %>
|
|
|
|
|
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
2015-10-15 17:06:48 +08:00
|
|
|
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-10-16 09:26:13 +08:00
|
|
|
|
<div class="memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<%= @topic.content.html_safe%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class=" fl" style="width: 600px">
|
|
|
|
|
<%= link_to_attachments_course @topic, :author => false %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-03-26 15:55:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
|
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
|
|
|
|
<div class="homepagePostReplyBannerTime"></div>
|
2015-10-13 11:03:22 +08:00
|
|
|
|
<!-- <div class="homepagePostReplyBannerMore">
|
|
|
|
|
<%# if @reply_count > 2%>
|
|
|
|
|
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
|
|
|
|
<%# end %>
|
|
|
|
|
</div>-->
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<% @replies.each_with_index do |reply,i| %>
|
2015-10-16 10:18:51 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
2015-03-26 15:55:07 +08:00
|
|
|
|
</div>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<div class="homepagePostReplyDes">
|
2015-10-12 17:19:55 +08:00
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
|
|
|
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
2015-10-26 15:26:05 +08:00
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
2015-10-16 09:26:13 +08:00
|
|
|
|
<%= reply.content.html_safe%>
|
|
|
|
|
</div>
|
2015-10-12 17:19:55 +08:00
|
|
|
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
2015-10-15 17:06:48 +08:00
|
|
|
|
<%= format_time(reply.created_on) %>
|
2015-10-15 16:17:48 +08:00
|
|
|
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:class => 'fr newsBlue',
|
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:class => 'fr newsGrey mr10',
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete)
|
|
|
|
|
) if reply.course_destroyable_by?(User.current) %>
|
|
|
|
|
</div>
|
2015-10-12 17:19:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
<p id="reply_message_<%= reply.id%>"></p>
|
2015-03-26 15:55:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
2015-10-09 14:39:40 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
2015-10-16 16:31:31 +08:00
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
|
<em class="talkWrapArrow"></em>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
|
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
|
|
|
|
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
|
|
|
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
|
|
|
|
|
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-10-09 14:39:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|