diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b4891f12b..d28837858 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -875,7 +875,7 @@ class UsersController < ApplicationController #显示更多用户课程 def user_courses4show @page = params[:page].to_i + 1 - @courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5) + @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5) end #显示更多用户项目 diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index f73cc87e6..8324951f9 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -180,7 +180,7 @@ module ApiHelper if timePassed < 0 updateAtValue = "时间有问题" elsif timePassed < ONE_MINUTE - updateAtValue = "一分钟前" + updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR timeIntoFormat = timePassed / ONE_MINUTE updateAtValue = timeIntoFormat.to_s + "分钟前" diff --git a/app/models/message.rb b/app/models/message.rb index 6d108e607..3bb08f481 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -199,8 +199,7 @@ class Message < ActiveRecord::Base def act_as_forge_activity # 如果project为空,那么就是课程相关的消息 if self.board.project_id != -1 && self.parent_id.nil? - self.forge_acts << ForgeActivity.new(:user_id => self.author_id, - :project_id => self.board.project.id) + self.forge_acts << ForgeActivity.new(:user_id => self.author_id, :project_id => self.board.project.id) end end diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 06adca74d..fe46d870c 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -1,7 +1,24 @@ <% if @in_user_center%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); +// init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); <% else%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); +//init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); +<% end %> init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); -<% end %> \ No newline at end of file +showNormalImage('activity_description_<%= @user_activity_id %>'); +if($("#intro_content_<%= @user_activity_id %>").height() > 810) { + $("#intro_content_show_<%= @user_activity_id %>").show(); +} +$("#intro_content_show_<%= @user_activity_id %>").click(function(){ + $("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360"); + $("#activity_description_<%= @user_activity_id%>").toggleClass("lh18"); + $("#intro_content_show_<%= @user_activity_id %>").hide(); + $("#intro_content_hide_<%= @user_activity_id %>").show(); +}); +$("#intro_content_hide_<%= @user_activity_id %>").click(function(){ + $("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360"); + $("#activity_description_<%= @user_activity_id%>").toggleClass("lh18"); + $("#intro_content_hide_<%= @user_activity_id %>").hide(); + $("#intro_content_show_<%= @user_activity_id %>").show(); +}); \ No newline at end of file diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 33a3201c0..99c743a96 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -57,13 +57,14 @@
发帖时间:<%= format_time(activity.created_on) %>
- -
- <% if activity.parent_id.nil? %> - <%= activity.content.to_s.html_safe%> - <% else %> - <%= activity.parent.content.to_s.html_safe%> - <% end %> +
+
+ <% if activity.parent_id.nil? %> + <%= activity.content.to_s.html_safe%> + <% else %> + <%= activity.parent.content.to_s.html_safe%> + <% end %> +
@@ -72,6 +73,11 @@ <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %> <% end %>
+
+ + +
+