111
This commit is contained in:
parent
3e9bb8a596
commit
b3919256fa
|
@ -627,9 +627,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
|
||||
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','poll')"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="resources mt10">
|
||||
<div class="resources mt10" id="course_news_<%= activity.id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
|
@ -42,25 +42,7 @@
|
|||
<%if count>2 %>
|
||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity.id%>" onclick="expand_reply('#reply_div_<%= user_activity.id %> li','#reply_btn_<%=user_activity.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >点击展开更多回复(<%= count.to_s%>)</a></div>
|
||||
<% end %>
|
||||
<!--
|
||||
<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a>
|
||||
</div>-->
|
||||
</div>
|
||||
<%#= render :partial => 'course_news_reply',:locals => { :contest => @contest, :journals => @jour, :state => false}%>
|
||||
|
||||
<!--<div class="homepagePostReplyInputContainer">
|
||||
<%= form_tag({:controller => 'comments', :action => 'create', :id => activity}, :id => "add_reply_form") do %>
|
||||
<textarea id="new_reply" class="homepagePostReplyInput" placeholder="请输入回复"></textarea>
|
||||
|
||||
<div class="homepagePostReplyCancel">
|
||||
<a href="javascript:void(0);" class="postReplyCancel" onclick="$('#new_reply').value('');">取消</a>
|
||||
</div>
|
||||
<div class="homepagePostReplySubmit">
|
||||
<a href="javascript:void(0);" class="postReplySubmit" onclick="$('#add_reply_form').submit();">发送</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>-->
|
||||
<% replies_all_i = 0 %>
|
||||
<% unless activity.comments.empty? %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity.id %>">
|
||||
|
@ -79,9 +61,6 @@
|
|||
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_date(comment.created_on) %>
|
||||
<%#= link_to_if_authorized_course l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => activity, :comment_id => comment},
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
|
||||
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word"><%= comment.comments.html_safe %></div>
|
||||
</div>
|
||||
|
|
|
@ -1,51 +1,9 @@
|
|||
<% user_activities.each do |user_activity|
|
||||
unless user_activities.nil? %>
|
||||
<script>
|
||||
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
|
||||
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
|
||||
/*$(function(){
|
||||
function nh_show_btn(){
|
||||
if($("#activity_message_<%#= user_activity.id%>").is(':hidden')){
|
||||
if($("#activity_description_<%#= user_activity.id%>").height()>120){
|
||||
$("#activity_description_<%#= user_activity.id%>").toggleClass("activity_description_maxHeight");
|
||||
$("#activity_message_<%#= user_activity.id%>").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
var div = $("#activity_description_<%#= user_activity.id%>");
|
||||
var imgs = $('img',div);
|
||||
var lens = imgs.length;
|
||||
function nh_load_img_end(){
|
||||
nh_show_btn();
|
||||
}
|
||||
if(lens > 0){
|
||||
$('img',div).load(function(){
|
||||
nh_load_img_end();
|
||||
});
|
||||
}
|
||||
nh_show_btn();
|
||||
});*/
|
||||
/*function show_more_reply(contentid, id2, id3) {
|
||||
$(contentid).toggleClass("activity_description_maxHeight");
|
||||
$(contentid).toggleClass("course_description_none");
|
||||
var information = $(id2);
|
||||
var arrow = $(id3);
|
||||
var val = information.attr("value");
|
||||
if (val == "show_more") {
|
||||
$(id2).text("[收起]");
|
||||
information.attr("value", "hide_more");
|
||||
arrow.attr("src", "/images/jiantouup.jpg")
|
||||
}
|
||||
else {
|
||||
$(id2).text("[展开]");
|
||||
information.attr("value", "show_more");
|
||||
arrow.attr("src", "/images/jiantou.jpg")
|
||||
}
|
||||
}*/
|
||||
function expand_reply(container,btnid){
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
//var jumpobj = $("#reply_div_<%#= activity.id %>");
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.html('收起回复('+btn.data('count')+')');
|
||||
|
@ -70,12 +28,6 @@
|
|||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Course'%>
|
||||
<%#= render :partial => 'course_create', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Attachment' %>
|
||||
<%#= render :partial => 'course_attachment', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<%# when 'JournalsForMessage' %>
|
||||
<%#= render :partial => 'course_journalsformessage', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<% end %>
|
||||
|
@ -87,16 +39,6 @@
|
|||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Journal' %>
|
||||
<%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'News' %>
|
||||
<%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Document' %>
|
||||
<%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Attachment' %>
|
||||
<%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'ProjectCreateInfo' %>
|
||||
<%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue