论坛消息回复改版

This commit is contained in:
lizanle 2015-09-24 12:17:14 +08:00
parent d512c25c03
commit 38a24e8fe4
2 changed files with 53 additions and 62 deletions

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor","forum" %>
<%= 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;}
@ -8,10 +8,28 @@
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-container{height: 80px !important;}*/
.ke-inline-block{display: none;}
div.ke-container{float:left;}
</style>
<script>
init_KindEditor_data('',30);
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(<%= @memo.id%>,null,"87%");
});
</script>
<div class="postRightContainer">
<div class="postThemeContainer">
@ -53,75 +71,47 @@
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<div nhname='new_message' style="display:none;">
<%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f|%>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea' name="memo[content]"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">留言</a>
<% end %>
</div>
<div class="cl"></div>
<% @replies.each do |reply| %>
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait" style="width: 45px !important;">
<!--<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a>-->
<%= link_to image_tag(url_to_avatar(reply.author), :width => 45,:height => 45), user_path(reply.author) %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %></div>
<div class="homepagePostReplyBannerTime"></div>
<div class="homepagePostReplyBannerMore">
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%= @memo.id%>" onclick="expand_reply('#reply_div_<%= @memo.id %>','#reply_btn_<%= @memo.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>
</div>
<div class="homepagePostReplyDes" style="width: 620px !important;">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a>
<% if reply.parent && reply.parent.id != @memo.id%>
<span class="f14">回复</span><a href="<%= user_path(reply.parent.author)%>" class="newsBlue mr10 ml15 f14"><%= reply.parent.author.name%></a>
<% end %>
<%= format_date(reply.created_at)%>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10" >删除</a>-->
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),:class=>'replyGrey fr ml10'
) if reply.destroyable_by?(User.current) %>
<a href="javascript:void(0);" class="newsBlue fr" nhname="reply_btn">回复</a></div>
</div>
<div class="" id="reply_div_<%= @memo.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_at) %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
<div nhname='div_form' class="mt10 ml80" style="display:none;">
<%= form_for(@memo_new, url: forum_memos_path, :method=>'post') do |f| %>
</div>
<div class="cl"></div>
</div>
<% end %>
</div>
<div class="cl"></div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @memo.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_<%= @memo.id%>' style="display:none;">
<%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<textarea name='memo[content]' style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
<% end %>
<div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea>
<div nhname='toolbar_container_<%= @memo.id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<!--<div class="homepagePostReplyContainer borderBottomNone">-->
<!--<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>-->
<!--<div class="homepagePostReplyDes">-->
<!--<div class="homepagePostReplyPublisher">-->
<!--<a href="javascript:void(0);" class="newsBlue mr15 f14">linchun</a>-->
<!--<span class="f14">回复</span><a href="javascript:void(0);" class="newsBlue mr10 ml15 f14">Tangxiang</a>刚刚-->
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>-->
<!--<div class="homepagePostReplyContent">点击设置就可以了。</div>-->
<!--</div>-->
<!--<div class="cl"></div>-->
<!--</div>-->
</div>
<ul class="wlist" style="margin-top: 10px;">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false,:flag=>true %>
</ul>
</div>

View File

@ -776,6 +776,7 @@ a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repe
.postEdit {background:url(images/post_image_list.png) 0px -94px no-repeat; width:18px; height:18px; display:block; float:left;}
.postDelete {background:url(images/post_image_list.png) -42px -93px no-repeat; width:18px; height:18px; display:block; float:right;}
.pageBanner {width:968px; margin:0px auto; border:1px solid #dddddd; background-color: #FFF; padding: 10px 15px; float:left;}
.homepagePostReplyInput {width:543px; height:33px; max-width:543px; max-height:33px; border:1px solid #d9d9d9; outline:none;}
/*底部*/
#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/
.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;}