TPI评论

This commit is contained in:
caishi 2017-10-09 17:23:17 +08:00
parent 73adf1844f
commit ce33efba30
8 changed files with 53 additions and 50 deletions

View File

@ -79,10 +79,10 @@
</div>
</div>
<div class="-layout-h -padding-h-16 -horizontal -footer-left" id="bottom_points" style = "position:relative;">
<ul class="-task-ml80 -layout" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
<ul class="-task-ml80 -layout df" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
<%= render :partial => "games/shixun_comment_block" %>
<!-- <li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>-->
<li class="fl ml20 mt15" style="width:85px;margin-bottom:10px;">
<li class="fl ml20 mt15 mb10 mr10" style="width:85px;">
<span data-tip-top="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
<i class="fa fa-thumbs-up font-20 mr3 <%= @praise.nil? ? "" : "color-light-green" %>" alt="赞" ></i><span class="font-12 font-bd" id="game_praise_count"><%= @praise_count %></span>
</span>

View File

@ -1,7 +1,7 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<li class="comment-input fl" id="shixun_comment_block" style="width: 80%;;">
<li class="comment-input fl" id="shixun_comment_block" style="flex: 1">
<!-- <%#= form_for('', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
<textarea id="comment_news" name="content" placeholder="我想说点什么~" MultiLine = True ScrollBars = 2 type="text"></textarea>
<input type="hidden" id="dis_reply_id" name="reply_id" value="">

View File

@ -14,11 +14,11 @@
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="comment_item_cont clearfix" style="padding:10px 10px">
<div class="comment_item_cont df clearfix" style="padding:10px 10px">
<div class="J_Comment_Face fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
</div>
<div class="t_content fl" style="width: 87%;">
<div class="t_content fl">
<div class="J_Comment_Reply">
<div class="comment_orig_content" style="margin:0px">
<% if !comment.parent.nil? %>
@ -54,6 +54,30 @@
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
<div class="comment_content clearfix" >
<div class="color-grey3"><%= comment.content.html_safe %></div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=@game_challenge.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
<div class="">
<div class="cl"></div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
@ -63,28 +87,7 @@
</div>
</div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=@game_challenge.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -6,7 +6,7 @@
<i class="fa fa-thumbs-up mr5"></i>赞
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<!-- <span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
<span class="ml5"><%= get_praise_num(activity) %></span>
<span class="ml5"><%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %></span>
</a>
<% else %>
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
@ -14,7 +14,7 @@
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="fr mr5 color-orange03" title="取消点赞" >
<i class="fa fa-thumbs-up mr5"></i>赞
<span class="ml5"><%= get_praise_num(activity) %></span>
<span class="ml5"><%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %></span>
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<!--<span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
</a>

View File

@ -1,4 +1,4 @@
<div class="orig_cont clearfix">
<div class="orig_cont df clearfix">
<% unless comment.parent.nil? %>
<div>
<%= render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %>

View File

@ -8,33 +8,33 @@
});
</script>
<div class="with90 fl" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<div class="orig_right" style="width: 96%">
<div class="orig_right" style="width: 100%">
<div class="orig_content clearfix" id="reply_content_<%= comment.id %>">
<%= comment.content_detail.html_safe %>
</div>
<%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="fr pr mr10 orig_reply h24" style="width: 110px">
<div class="reply clearfix">
<div class="reply-right none" style="position: absolute; right: -35px;">
<%= link_to('<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users',
:action => 'reply_to_comment',
:reply_id => comment.id,
:type => type,
:user_activity_id => user_activity_id,
:parent_id => parent_id},
:remote => true,
:method => 'get',:class=>"color-grey",
:title => l(:button_reply)) %><span class="ml5 mr5">|</span>
<div class="with100 df">
<%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="fr pr mr10 font-12" style="flex: 1">
<div class="reply-right mt3 none" style="position: absolute; right: 0px;">
<%= link_to('<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users',
:action => 'reply_to_comment',
:reply_id => comment.id,
:type => type,
:user_activity_id => user_activity_id,
:parent_id => parent_id},
:remote => true,
:method => 'get',:class=>"color-grey",
:title => l(:button_reply)) %><span class="ml5 mr5">|</span>
<span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
</div>
</div>
</div>
</div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message clearfix"></div>

View File

@ -1,4 +1,4 @@
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone mt10" id="reply_to_message_<%= reply.id%>">
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone mt10 df" id="reply_to_message_<%= reply.id%>">
<% if User.current.logged? %>
<div class="homepagePostReplyPortrait mr15 imageFuzzy fl" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="orig_textarea mb10 fl">

View File

@ -198,7 +198,7 @@ a.course-bth-blue{cursor: pointer;background-color:#199ed8 ;color: #ffffff !impo
.break_word_firefox{white-space: pre-wrap !important;word-break: break-all;}
.pre_word{white-space: pre-wrap;word-wrap: break-word;word-break: normal;}
.pr {position:relative;}
.df {display:flex;}
.df {display:flex;display: -webkit-flex;display: -ms-flex;}
.w100{width: 100px;}
.w150{width: 150px;}
.w200{width: 200px;}