|
|
@ -10,9 +10,7 @@
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
</h2>
|
|
|
|
</h2>
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
|
|
|
|
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 发布新帖部分 -->
|
|
|
|
<!-- 发布新帖部分 -->
|
|
|
@ -42,7 +40,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<p class="talkmain_tit fl fb break_word"> <%= h(topic.subject) %></p>
|
|
|
|
<p class="talkmain_tit fl fb break_word"> <%= h(topic.subject) %></p>
|
|
|
|
<% if topic.course_editable_by?(User.current) %>
|
|
|
|
<% if topic.course_editable_by?(User.current) %>
|
|
|
|
<a href="javascript:" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
|
|
|
|
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
|
|
|
|
margin-right: 10px;"><%= l(:button_edit) %></a>
|
|
|
|
margin-right: 10px;"><%= l(:button_edit) %></a>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
@ -83,9 +81,7 @@
|
|
|
|
<%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
|
|
|
|
<%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
|
|
|
|
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => "about_newtalk#{topic.id}",:class => ' c_dblue fr' %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
|
@ -104,7 +100,7 @@
|
|
|
|
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>" name="container_board">
|
|
|
|
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>" name="container_board">
|
|
|
|
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
|
|
|
|
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
|
|
|
|
|
|
|
|
|
|
|
|
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
|
|
|
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
|
|
|
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
|
|
|
|
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
|
|
|
|
<a href="javascript:void(0)" name="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
|
|
|
|
<a href="javascript:void(0)" name="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
@ -143,15 +139,6 @@
|
|
|
|
:title => l(:button_delete),
|
|
|
|
:title => l(:button_delete),
|
|
|
|
:class => ' c_dblue fr'
|
|
|
|
:class => ' c_dblue fr'
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
<%= link_to(
|
|
|
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
|
|
|
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
|
|
|
|
|
|
|
|
:remote => true,
|
|
|
|
|
|
|
|
:method => 'get',
|
|
|
|
|
|
|
|
:focus => "about_newtalk#{topic.id}",
|
|
|
|
|
|
|
|
:class => ' c_dblue fr',
|
|
|
|
|
|
|
|
:style => 'margin-right: 10px;',
|
|
|
|
|
|
|
|
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
|
@ -181,15 +168,6 @@
|
|
|
|
:title => l(:button_delete),
|
|
|
|
:title => l(:button_delete),
|
|
|
|
:class => ' c_dblue fr'
|
|
|
|
:class => ' c_dblue fr'
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
<%= link_to(
|
|
|
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
|
|
|
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
|
|
|
|
|
|
|
|
:remote => true,
|
|
|
|
|
|
|
|
:method => 'get',
|
|
|
|
|
|
|
|
:focus => "about_newtalk#{topic.id}",
|
|
|
|
|
|
|
|
:class => ' c_dblue fr',
|
|
|
|
|
|
|
|
:style => 'margin-right: 10px;',
|
|
|
|
|
|
|
|
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
|
@ -198,7 +176,7 @@
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<%if replies_all.first %>
|
|
|
|
<%if replies_all.first %>
|
|
|
|
<div class="talkWrapMsg"><a class=" ml258" href="javascript:" id="showgithelp<%= topic.id%>" style="color: #0781b4;" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div>
|
|
|
|
<div class="talkWrapMsg"><a class=" ml258" href="javascript:void(0)" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23" style="color: #0781b4;" >展开回复(<%= topic.replies_count.to_s%>)</a></div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -224,48 +202,51 @@
|
|
|
|
KindEditor.ready(function(K){
|
|
|
|
KindEditor.ready(function(K){
|
|
|
|
$("div[name='container_board']").each(function(){
|
|
|
|
$("div[name='container_board']").each(function(){
|
|
|
|
var container=$(this);
|
|
|
|
var container=$(this);
|
|
|
|
|
|
|
|
var messege = $("p[aa='message_show']",container);
|
|
|
|
|
|
|
|
var subject = $("input[aa='subject']",container);
|
|
|
|
var textarea= $("textarea[aa='content']",container);
|
|
|
|
var textarea= $("textarea[aa='content']",container);
|
|
|
|
var message = $("p[aa='message_show']", container);
|
|
|
|
var form = $("form",container);
|
|
|
|
var editor = K.create(textarea, {
|
|
|
|
var editor = K.create(textarea, {
|
|
|
|
resizeType : 1,
|
|
|
|
resizeType : 1,
|
|
|
|
allowPreviewEmoticons : false,
|
|
|
|
allowPreviewEmoticons : false,
|
|
|
|
allowImageUpload : false,
|
|
|
|
allowImageUpload : false,
|
|
|
|
width:"89%",
|
|
|
|
width:"89%",
|
|
|
|
items : ['emoticons']
|
|
|
|
items : []
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// form.submit(function(){
|
|
|
|
|
|
|
|
// alert(textarea.html());
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// $("a[name='submitbtn']",container).click(function(){
|
|
|
|
|
|
|
|
// form.submit();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
$("a[name='submitbtn']",container).click(function(){
|
|
|
|
$("a[name='submitbtn']",container).click(function(){
|
|
|
|
textarea[0].value = editor.html() ;
|
|
|
|
textarea[0].value = editor.html() ;
|
|
|
|
var id = textarea[0].id.toString().substr(15);
|
|
|
|
var id = textarea[0].id.toString().substr(15);
|
|
|
|
var subject = document.getElementById("message_subject");
|
|
|
|
|
|
|
|
if(subject.value == "RE: ") {
|
|
|
|
|
|
|
|
if (textarea[0].value.length == 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message[0].text("描述不能为空");
|
|
|
|
if(subject.val() == "RE: ") {
|
|
|
|
message[0].css('color', '#ff0000');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (editor.html() == "") {
|
|
|
|
|
|
|
|
messege.html("回复内容不能为空") ;
|
|
|
|
|
|
|
|
messege.css('color', '#ff0000');
|
|
|
|
|
|
|
|
messege.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
messege.html("填写正确");
|
|
|
|
message[0].text("填写正确");
|
|
|
|
messege.css('color', '#008000');
|
|
|
|
message[0].css('color', '#008000');
|
|
|
|
messege.show();
|
|
|
|
this.parentNode.submit();
|
|
|
|
this.parentNode.submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if(regexContent(id) && regexSubject(id)) {
|
|
|
|
if(regexContent(id) && regexSubject(id)) {
|
|
|
|
if (this.parentNode.name.toString() == 'message-form') {
|
|
|
|
if (this.parentNode.name == 'message-form') {
|
|
|
|
this.parentNode.submit();
|
|
|
|
this.parentNode.submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
this.parentNode.parentNode.submit();
|
|
|
|
this.parentNode.parentNode.submit();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|