个人动态首页只显示第一个动态的回复框,其它的需点击才显示
This commit is contained in:
parent
a714b10860
commit
a184ab4b69
|
@ -49,7 +49,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyInputContainer" id="reply_input_<%= user_activity_id %>" style="display: <%= (page==0 && first_user_activity == user_activity_id) ? '' : 'none'%>">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyInputContainer" id="reply_input_<%= user_activity_id %>" style="display: <%= (page==0 && first_user_activity == user_activity_id) ? '' : 'none'%>">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 2 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
|
@ -78,7 +78,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyInputContainer" id="reply_input_<%= user_activity_id %>" style="display: <%= (page==0 && first_user_activity == user_activity_id) ? '' : 'none'%>">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = 0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyInputContainer" id="reply_input_<%= user_activity_id %>" style="display: <%= (page==0 && first_user_activity == user_activity_id) ? '' : 'none'%>">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
div.ke-toolbar .ke-outline{border:none;}
|
||||
.ke-inline-block{display: none;}
|
||||
</style>
|
||||
<% first_user_activity = user_activities.first.id %>
|
||||
<% user_activities.each do |user_activity|
|
||||
if user_activities %>
|
||||
<script>
|
||||
|
@ -29,6 +30,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
init_KindEditor_data(<%= user_activity.id%>);
|
||||
});
|
||||
|
@ -39,22 +44,22 @@
|
|||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue