个人主页报500、动态显示错位的bug修复

Branch_szzh
cxt 10 years ago
parent 69178f1522
commit c650c83f82

@ -649,7 +649,7 @@ class UsersController < ApplicationController
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10) @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
else else
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10) @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
end end
else else
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10) @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
end end

@ -106,7 +106,7 @@
) if reply.course_destroyable_by?(User.current) %> ) if reply.course_destroyable_by?(User.current) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>--> <!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div> </div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= reply.content.html_safe %>"><%= reply.content.html_safe %></div> <div class="homepagePostReplyContent"><%= reply.content.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -83,7 +83,7 @@
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>--> <!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div> </div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= comment.comments.html_safe %>"><%= comment.comments.html_safe %></div> <div class="homepagePostReplyContent"><%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -119,7 +119,7 @@
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= string %></div> <div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= string %></div>
<% end %> <% end %>
<% else %> <% else %>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= reply.notes.html_safe %></div> <div class="homepagePostReplyContent"><%= reply.notes.html_safe %></div>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

@ -103,7 +103,7 @@
) if reply.course_destroyable_by?(User.current) %> ) if reply.course_destroyable_by?(User.current) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>--> <!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div> </div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= reply.content.html_safe %>"><%= reply.content.html_safe %></div> <div class="homepagePostReplyContent"><%= reply.content.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -3,16 +3,16 @@
<script> <script>
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}}); //$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug //解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){ /*$(function(){
function nh_show_btn(){ function nh_show_btn(){
if($("#activity_message_<%= user_activity.id%>").is(':hidden')){ if($("#activity_message_<%#= user_activity.id%>").is(':hidden')){
if($("#activity_description_<%= user_activity.id%>").height()>120){ if($("#activity_description_<%#= user_activity.id%>").height()>120){
$("#activity_description_<%= user_activity.id%>").toggleClass("activity_description_maxHeight"); $("#activity_description_<%#= user_activity.id%>").toggleClass("activity_description_maxHeight");
$("#activity_message_<%= user_activity.id%>").show(); $("#activity_message_<%#= user_activity.id%>").show();
} }
} }
} }
var div = $("#activity_description_<%= user_activity.id%>"); var div = $("#activity_description_<%#= user_activity.id%>");
var imgs = $('img',div); var imgs = $('img',div);
var lens = imgs.length; var lens = imgs.length;
function nh_load_img_end(){ function nh_load_img_end(){
@ -24,8 +24,8 @@
}); });
} }
nh_show_btn(); nh_show_btn();
}); });*/
function show_more_reply(contentid, id2, id3) { /*function show_more_reply(contentid, id2, id3) {
$(contentid).toggleClass("activity_description_maxHeight"); $(contentid).toggleClass("activity_description_maxHeight");
$(contentid).toggleClass("course_description_none"); $(contentid).toggleClass("course_description_none");
var information = $(id2); var information = $(id2);
@ -41,7 +41,7 @@
information.attr("value", "show_more"); information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg") arrow.attr("src", "/images/jiantou.jpg")
} }
} }*/
function expand_reply(container,btnid){ function expand_reply(container,btnid){
var target = $(container); var target = $(container);
var btn = $(btnid); var btn = $(btnid);

@ -1,10 +1,10 @@
<script type="text/javascript"> <script type="text/javascript">
var scrollHandler = function(){ var scrollHandler = function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) { if ($(window).scrollTop() == $(document).height() - $(window).height()) {
$.get( $.get(
'<%= user_activities_path(@user.id)%>', '<%= user_activities_path(@user.id)%>',
{ page : $("#show_more_activities").val(), { page: $("#show_more_activities").val(),
type: $("#user_activities_type").val()}, type: $("#user_activities_type").val()},
function (data) { function (data) {
} }

Loading…
Cancel
Save