|
|
|
@ -1,117 +1,146 @@
|
|
|
|
|
<div class="project_r_h">
|
|
|
|
|
<h2 class="project_h2">
|
|
|
|
|
<%= l(:label_board) %>
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor","forum" %>
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
/*回复框*/
|
|
|
|
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
|
|
|
|
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
|
|
|
|
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
|
|
|
|
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
|
|
|
|
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
|
|
|
|
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
|
|
|
|
div.ke-toolbar .ke-outline{border:none;}
|
|
|
|
|
.ke-inline-block{display: none;}
|
|
|
|
|
div.ke-container{float:left;}
|
|
|
|
|
</style>
|
|
|
|
|
<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);
|
|
|
|
|
btn.html('收起回复('+btn.data('count')+')');
|
|
|
|
|
target.show();
|
|
|
|
|
}else{
|
|
|
|
|
btn.data('init',0);
|
|
|
|
|
btn.html('展开更多('+btn.data('count')+')');
|
|
|
|
|
target.hide();
|
|
|
|
|
target.eq(0).show();
|
|
|
|
|
target.eq(1).show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$(function() {
|
|
|
|
|
init_activity_KindEditor_data(<%= @topic.id%>,null,"87%");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
<div class="topbar_info02 fl">
|
|
|
|
|
<p class="hiddent">
|
|
|
|
|
<%= l(:label_user_location) %> :
|
|
|
|
|
<%= link_to l(:label_borad_course), course_boards_path(@course) %>
|
|
|
|
|
>
|
|
|
|
|
<%= link_to @topic.subject, course_board_path(@course, @board) %>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
function del_confirm(){
|
|
|
|
|
if(confirm('确认删除么?')){
|
|
|
|
|
$("#del_memo_link").click();
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
<div class="problem_main">
|
|
|
|
|
<div class="ping_dispic">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author),:width => '46',:height => '46'), user_path(@topic.author) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="talk_txt fl">
|
|
|
|
|
<p class="problem_tit fl fb c_dblue break_word" >
|
|
|
|
|
<%= @topic.subject %>
|
|
|
|
|
</p>
|
|
|
|
|
<br/>
|
|
|
|
|
<p>
|
|
|
|
|
由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %>
|
|
|
|
|
添加于<%= format_time(@topic.created_on) %>
|
|
|
|
|
</p>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<div class="postRightContainer ml10">
|
|
|
|
|
<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">
|
|
|
|
|
<% if @topic.author.id == User.current.id%>
|
|
|
|
|
<div class="homepagePostSetting">
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
|
<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 => 'talk_edit fr'
|
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
|
) if @message.course_destroyable_by?(User.current) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
|
:class => 'talk_edit fr'
|
|
|
|
|
) if @message.course_editable_by?(User.current) %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="talk_info mb10 upload_img break_word"><%= @topic.content.html_safe %></div>
|
|
|
|
|
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
|
|
|
|
|
<!-- <a href="#" class=" link_file ml60">附件:爱覅俄方if.zip(27.5kB)</a>-->
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
<%= toggle_link l(:button_reply), "reply", :focus => 'message_subject',:class => 'talk_edit fr' %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<%end%>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_quote),
|
|
|
|
|
{:action => 'quote', :id => @topic},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:class => 'talk_edit fr',
|
|
|
|
|
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<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><!--讨论主类容 end-->
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<% reply_count = 0 %>
|
|
|
|
|
<% @replies.each do |message| %>
|
|
|
|
|
<div class="ping_C mb10 ml50" id="<%= "message-#{message.id}" %>">
|
|
|
|
|
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
|
|
|
|
|
<div class="ping_discon">
|
|
|
|
|
<div class="ping_distop upload_img break_word">
|
|
|
|
|
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
|
|
|
|
|
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
|
|
|
|
|
|
|
|
|
|
<div class="postDetailCreater">
|
|
|
|
|
<%= link_to @topic.author.name, user_path(@topic.author), :class => "linkBlue2", :target=> "_blank"%></div>
|
|
|
|
|
<div class="postDetailDate mb5"><%= format_date( @topic.created_on)%></div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<p><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
|
|
|
|
<%= link_to_attachments_course message, :author => false %>
|
|
|
|
|
<div class="memo-content upload_img break_word" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
|
|
|
|
<%= @topic.content.html_safe%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class=" fl" style="width: 600px">
|
|
|
|
|
<%= link_to_attachments_course @topic, :author => false %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ping_disfoot">
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_quote),
|
|
|
|
|
{:action => 'quote', :id => message},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
#image_tag('edit.png'),
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => message},
|
|
|
|
|
:title => l(:button_edit)
|
|
|
|
|
) if message.course_editable_by?(User.current) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
#image_tag('delete.png'),
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => message},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete)
|
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div><!---留言内容-->
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
|
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
|
|
|
|
<div class="homepagePostReplyBannerTime"></div>
|
|
|
|
|
<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 %>
|
|
|
|
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
|
|
|
|
<div id="reply" style="display:none;">
|
|
|
|
|
<%= 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_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
|
|
|
|
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fl c_white" %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<% @replies.each_with_index do |reply,i| %>
|
|
|
|
|
<div class="homepagePostReplyContainer" style="display: <%= i >= 2 ? 'none':''%>">
|
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
|
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_on) %></div>
|
|
|
|
|
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<ul class="wlist">
|
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
|
|
|
</ul>
|
|
|
|
|
<% html_title @topic.subject %>
|
|
|
|
|
|
|
|
|
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
|
|
|
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @topic.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
|
|
|
|
<div class="homepagePostReplyInputContainer mb10">
|
|
|
|
|
<div nhname='new_message_<%= @topic.id%>' style="display:none;">
|
|
|
|
|
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => @topic.id, :is_board => 'false'},:method => "post", :remote => true) do |f|%>
|
|
|
|
|
<input type="hidden" name="quote[quote]" value="">
|
|
|
|
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="reply[content]"></textarea>
|
|
|
|
|
<div nhname='toolbar_container_<%= @topic.id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
|
|
|
|
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<p nhname='contentmsg_<%= @topic.id%>'></p>
|
|
|
|
|
<% end%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|