|
|
@ -1,131 +1,230 @@
|
|
|
|
<div class="project_r_h">
|
|
|
|
|
|
|
|
<h2 class="project_h2"><%= h @board.name %></h2>
|
|
|
|
<script type="text/javascript">
|
|
|
|
</div>
|
|
|
|
// var flag = false;
|
|
|
|
<div class="problem_main">
|
|
|
|
// jQuery(document).ready(function($) {
|
|
|
|
<div class="ping_dispic">
|
|
|
|
// transpotUrl('#content');
|
|
|
|
<%=link_to image_tag(url_to_avatar(@topic.author), :width => "46", :height => "46"), user_path(@topic.author) %>
|
|
|
|
// });
|
|
|
|
</div>
|
|
|
|
function submit_message_replay()
|
|
|
|
<div class="talk_txt fl">
|
|
|
|
{
|
|
|
|
<p class="problem_tit fl fb" style="word-break:break-all;" >
|
|
|
|
if(regexContent() == false)
|
|
|
|
<%= @topic.subject %></p>
|
|
|
|
{
|
|
|
|
<br/>
|
|
|
|
$("#message_form").submit();
|
|
|
|
<p>由<%= link_to_user_header @topic.author,false,:class=> 'problem_name c_orange' %> 添加于<%= format_time(@topic.created_on) %></p>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
<!-- <a class="talk_edit fr">删除</a><a class="talk_edit fr">编辑</a><a class="talk_edit fr">置顶</a> -->
|
|
|
|
function regexContent()
|
|
|
|
<%#= watcher_link(@topic, User.current) %>
|
|
|
|
{
|
|
|
|
|
|
|
|
var content = $.trim($("#message_content").val());
|
|
|
|
|
|
|
|
if(content.length ==0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#ff0000');
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#008000');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%= content_for(:header_tags) do %>
|
|
|
|
|
|
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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('收起回复');
|
|
|
|
|
|
|
|
target.show();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
btn.data('init',0);
|
|
|
|
|
|
|
|
btn.html('展开更多');
|
|
|
|
|
|
|
|
target.hide();
|
|
|
|
|
|
|
|
target.eq(0).show();
|
|
|
|
|
|
|
|
target.eq(1).show();
|
|
|
|
|
|
|
|
target.eq(2).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function project_board_submit_message_replay()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(MessageReplayVevify())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
|
|
|
|
|
|
|
$("#message_form").submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function project_board_canel_message_replay()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#reply").hide(200);
|
|
|
|
|
|
|
|
$("#message_quote").html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function MessageReplayVevify() {
|
|
|
|
|
|
|
|
var content = message_content_editor.html();//$.trim($("#message_content").val());
|
|
|
|
|
|
|
|
if (message_content_editor.isEmpty()) {
|
|
|
|
|
|
|
|
$("#message_content_span").text("回复不能为空");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color', '#ff0000');
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$("#message_content_span").text("填写正确");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color', '#008000');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
|
|
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
|
|
|
|
|
|
|
|
showNormalImage('message_description_<%= @topic.id %>');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
|
|
|
|
|
|
|
<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" id="message_setting_<%= @topic.id%>" style="display: none">
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<%= link_to(
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_edit),
|
|
|
|
l(:button_edit),
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
:class => 'talk_edit fr'
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
) if @message.editable_by?(User.current) %>
|
|
|
|
) if @message.editable_by?(User.current) %>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<%= link_to(
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_delete),
|
|
|
|
l(:button_delete),
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
:method => :post,
|
|
|
|
:method => :post,
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:class => 'talk_edit fr'
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
) if @message.destroyable_by?(User.current) %>
|
|
|
|
) if @message.destroyable_by?(User.current) %>
|
|
|
|
|
|
|
|
<%= link_to "转发",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</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="cl"></div>
|
|
|
|
<div class="talk_info mb10" style="word-break:break-all;"><%= textilizable(@topic, :content) %></div>
|
|
|
|
|
|
|
|
<div class="talk_info mb10"><%= link_to_attachment_project @topic, :author => false %></div>
|
|
|
|
<div class="postDetailCreater">
|
|
|
|
<!-- <a href="#" class=" link_file ml60">附件:爱覅俄方if.zip(27.5kB)</a>-->
|
|
|
|
<% if @topic.try(:author).try(:realname) == ' ' %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
|
|
|
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content',:class => 'talk_edit fr' %>
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %>
|
|
|
|
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<%= link_to(
|
|
|
|
</div>
|
|
|
|
l(:button_quote),
|
|
|
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
|
|
|
{:action => 'quote', :id => @topic},
|
|
|
|
<div class="cl"></div>
|
|
|
|
:remote => true,
|
|
|
|
<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;" >
|
|
|
|
:method => 'get',
|
|
|
|
<%= @topic.content.html_safe%>
|
|
|
|
:class => 'talk_edit fr',
|
|
|
|
</div>
|
|
|
|
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!--讨论主类容 end-->
|
|
|
|
<div class=" fl" style="width: 600px">
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
<%= link_to_attachments_course @topic, :author => false %>
|
|
|
|
<% reply_count = 0 %>
|
|
|
|
</div>
|
|
|
|
<% @replies.each do |message| %>
|
|
|
|
</div>
|
|
|
|
<div class="ping_C mb10" id="<%= "message-#{message.id}" %>">
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
|
|
|
|
</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="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<p class="break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
|
|
|
<div class="homepagePostReply">
|
|
|
|
<%= link_to_attachments_course message, :author => false %>
|
|
|
|
<% 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 %>
|
|
|
|
|
|
|
|
</div>-->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ping_disfoot">
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
|
|
|
<% @replies.each_with_index do |reply,i| %>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
|
|
|
|
<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">
|
|
|
|
|
|
|
|
<% 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>
|
|
|
|
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
|
|
|
|
|
|
|
<%= reply.content.html_safe%>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
|
|
|
|
|
|
|
<%= format_time(reply.created_on) %>
|
|
|
|
|
|
|
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
|
|
|
<%= link_to(
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_quote),
|
|
|
|
l(:button_reply),
|
|
|
|
{:action => 'quote', :id => message},
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
:remote => true,
|
|
|
|
:remote => true,
|
|
|
|
:method => 'get',
|
|
|
|
:method => 'get',
|
|
|
|
:title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
:class => 'fr newsBlue',
|
|
|
|
<%= link_to(
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
#image_tag('edit.png'),
|
|
|
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
|
|
|
{:action => 'edit', :id => message},
|
|
|
|
|
|
|
|
:title => l(:button_edit)
|
|
|
|
|
|
|
|
) if message.course_editable_by?(User.current) %>
|
|
|
|
|
|
|
|
<%= link_to(
|
|
|
|
<%= link_to(
|
|
|
|
#image_tag('delete.png'),
|
|
|
|
|
|
|
|
l(:button_delete),
|
|
|
|
l(:button_delete),
|
|
|
|
{:action => 'destroy', :id => message},
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
:method => :post,
|
|
|
|
:method => :post,
|
|
|
|
|
|
|
|
:class => 'fr newsGrey mr10',
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:title => l(:button_delete)
|
|
|
|
:title => l(:button_delete)
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
) if reply.destroyable_by?(User.current) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p id="reply_message_<%= reply.id%>"></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!---留言内容-->
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
|
|
|
<div id="reply" style="display:none;">
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
<% if !@topic.locked? && authorize_for('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| %>
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
|
|
|
<p class="talk_top"><%= l(:label_message_reply) %></p>
|
|
|
|
|
|
|
|
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
|
|
|
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
|
|
|
<a href="#" onclick="submit_message_replay();"class="blue_btn fl c_white ml5" style="margin-left: 50px;"><%= l(:button_submit)%></a>
|
|
|
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
|
|
|
|
|
|
|
|
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<ul class="wlist">
|
|
|
|
<% end %>
|
|
|
|
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
|
|
</div>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% html_title @topic.subject %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
// var flag = false;
|
|
|
|
|
|
|
|
// jQuery(document).ready(function($) {
|
|
|
|
|
|
|
|
// transpotUrl('#content');
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
function submit_message_replay()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(flag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_form").submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function regexContent()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var content = $.trim($("#message_content").val());
|
|
|
|
|
|
|
|
if(content.length ==0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#ff0000');
|
|
|
|
|
|
|
|
flag = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#008000');
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|