This commit is contained in:
yutao 2015-05-23 16:35:57 +08:00
parent 6fcdae517a
commit fe404f8cb1
1 changed files with 27 additions and 10 deletions

View File

@ -31,7 +31,7 @@
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div nhname="container_board"> <div nhname="container_board" ecname="container_board_reply">
<div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;"> <div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
@ -39,7 +39,7 @@
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.editable_by?(User.current) %> <% if topic.editable_by?(User.current) %>
<a href="javascript:void(0)" nhname="showbtn" style="color: #426e9a;float: right;margin-right: 10px;"><%= l(:button_edit) %></a> <a href="javascript:void(0)" nhname="showbtn_reply" style="color: #426e9a;float: right;margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
@ -164,17 +164,34 @@
KindEditor.ready(function(K){ KindEditor.ready(function(K){
$("div[nhname='container_board']").each(function(){ $("div[nhname='container_board']").each(function(){
var container = $(this); var container = $(this);
var about_talk = $("div[nhname='about_talk']",container);
nh_init_board({ nh_init_board({
kindutil:K, kindutil:K,
showbtn:$("a[nhname='showbtn']",container), showbtn:$("a[nhname='showbtn']",container),
about_talk:$("div[nhname='about_talk']",container), about_talk:about_talk,
inputsubject:$("input[nhname='inputsubject']",container), inputsubject:$("input[nhname='inputsubject']",about_talk),
subjectmsg:$("p[nhname='subjectmsg']",container), subjectmsg:$("p[nhname='subjectmsg']",about_talk),
textarea:$("textarea[nhname='textarea']",container), textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",container), contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",container), submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",container), cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",container) form:$("form[nhname='form']",about_talk)
});
});
$("div[ecname='container_board_reply']").each(function(){
var container = $(this);
var about_talk = $("div[nhname='about_talk_reply']",container);
nh_init_board({
kindutil:K,
showbtn:$("a[nhname='showbtn_reply']",container),
about_talk:about_talk,
inputsubject:$("input[nhname='inputsubject']",about_talk),
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk)
}); });
}); });
}); });