diff --git a/.gitignore b/.gitignore index 0727a920a..e9f6c8b13 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb +/config/menu.yml +/config/wechat.yml /files/* /log/* diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 43e95a0e9..264c1fc9f 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -41,7 +41,7 @@ class OrgDocumentCommentsController < ApplicationController @org_subfield = OrgSubfield.where(:id => @document.org_subfield_id).first @subfield_content = @organization.org_subfields.order("priority") respond_to do |format| - format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'} + format.html {render :layout => (@organization.switch_type && @document && !@document.org_subfield_id.blank?) ? 'base_org_custom' : 'base_org'} end end @@ -96,7 +96,12 @@ class OrgDocumentCommentsController < ApplicationController def add_reply_in_doc @document = OrgDocumentComment.find(params[:id]).root @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) - @comment.content = params[:org_content] + if params[:org_comment].blank? + @comment.content = params[:org_content] + else + @comment.content = params[:org_comment][:org_content] + end + @document.children << @comment @document.save respond_to do |format| diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 97fd65aa7..b36ef592d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -107,7 +107,7 @@ class OrganizationsController < ApplicationController if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0 @acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) - order by updated_at desc limit 6;") + order by created_at desc limit 6;") end render :layout => 'base_org_custom' else @@ -273,7 +273,7 @@ class OrganizationsController < ApplicationController course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0 @org_acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) - order by updated_at desc limit 6;") + order by created_at desc limit 6;") respond_to do |format| format.html{render :layout => 'base_org_custom'} format.js diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 88a524d1e..cad57b49f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -100,7 +100,7 @@ class UsersController < ApplicationController else @user_activity_id = -1 end - @is_in_course = params[:is_in_course] + @is_in_course = params[:is_in_course].to_i @course_activity = params[:course_activity].to_i end respond_to do |format| @@ -3236,6 +3236,38 @@ class UsersController < ApplicationController end end + def all_journals + if params[:type].present? + case params[:type] + when 'OrgDocumentComment' + obj = OrgDocumentComment.where('id = ?', params[:id].to_i).first + @journals = obj.children.reorder("created_at desc") + when 'Message' + obj = Message.where('id = ?', params[:id].to_i).first + @journals = obj.children.reorder("created_on desc") + when 'News' + obj = News.where('id = ?', params[:id].to_i).first + @journals = obj.comments.reorder("created_on desc") + when 'JournalsForMessage' + obj = JournalsForMessage.where('id = ?', params[:id].to_i).first + @journals = obj.children.reorder("created_on desc") + when 'Issue' + obj = Issue.where('id = ?', params[:id].to_i).first + @journals = obj.journals.reorder("created_on desc") + when 'BlogComment' + obj = BlogComment.where('id = ?', params[:id].to_i).first + @journals = obj.children.reorder("created_on desc") + when 'HomeworkCommon' + obj = HomeworkCommon.where('id = ?', params[:id].to_i).first + @journals = obj.journals_for_messages.reorder("created_on desc") + @is_in_course = params[:is_in_course].to_i if params[:is_in_course] + @course_activity = params[:course_activity].to_i if params[:course_activity] + @is_teacher = User.current.allowed_to?(:as_teacher,obj.course) + @user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id] + end + end + end + private def find_user diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 3ccdc3257..169a33fce 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -6,7 +6,7 @@ class WechatsController < ActionController::Base # default text responder when no other match on :text do |request, content| - request.reply.text "您的意见已收到" # Just echo + request.reply.text "您的意见已收到,感谢您的反馈!" # Just echo end # When receive 'help', will trigger this responder @@ -179,7 +179,7 @@ class WechatsController < ActionController::Base raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) user, last_login_on = User.try_to_login(params[:username], params[:password]) - raise "用户名或密码错误,请重新登录" unless user + raise "用户名或密码错误,请重新输入" unless user #补全用户信息 raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4099ea451..cb06bd688 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -105,13 +105,13 @@ module OrganizationsHelper def org_time_by_type obj case obj.act_type when "Message" - obj.act.updated_on + obj.act.created_on when "News" obj.act.created_on when "HomeworkCommon" - obj.act.updated_at + obj.act.created_at when "Issue" - obj.act.updated_on + obj.act.created_on end end diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 05ae02fe2..8959e9c29 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -76,6 +76,18 @@ class BlogComment < ActiveRecord::Base def project end + def creator_user + self.author + end + + def created_time + self.created_at + end + + def content_detail + self.content + end + #博客回复微信模板消息 # def blog_wechat_message # ws = WechatService.new diff --git a/app/models/comment.rb b/app/models/comment.rb index edb5e472f..80b52a8f4 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -104,4 +104,16 @@ class Comment < ActiveRecord::Base end end + def creator_user + self.author + end + + def created_time + self.created_on + end + + def content_detail + self.comments + end + end diff --git a/app/models/journal.rb b/app/models/journal.rb index bea273a41..0f88fcb7f 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -137,6 +137,18 @@ class Journal < ActiveRecord::Base end ## + def creator_user + self.user + end + + def created_time + self.created_on + end + + def content_detail + self.notes + end + private def split_private_notes diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index d8819515c..68cb9da15 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -329,4 +329,16 @@ class JournalsForMessage < ActiveRecord::Base down_course_score_num(self.jour.course_id, self.user_id, "HomeworkCommon") end end + + def creator_user + self.user + end + + def created_time + self.created_on + end + + def content_detail + self.notes + end end diff --git a/app/models/message.rb b/app/models/message.rb index 393fd3a60..14add0d02 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -221,6 +221,18 @@ class Message < ActiveRecord::Base update_org_activity(self.class, self.id) end + def creator_user + self.author + end + + def created_time + self.created_on + end + + def content_detail + self.content + end + private def add_author_as_watcher diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb index dd070c825..dd7734a54 100644 --- a/app/models/org_document_comment.rb +++ b/app/models/org_document_comment.rb @@ -35,4 +35,15 @@ class OrgDocumentComment < ActiveRecord::Base end + def creator_user + self.creator + end + + def created_time + self.created_at + end + + def content_detail + self.content + end end diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 763748ad7..16d151d83 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -52,23 +52,6 @@ <% course_activities.includes(:course_act).each do |activity| if course_activities %> - <% replies_all_i=replies_all_i+1 %> -
序号 | <% if @homework.homework_type != 3 %> - | 作品名称 | -- 姓名 + | + -- 学号 + | <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>作品名称 | diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 1a3220df6..c4a6a3e9b 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,67 +1,71 @@ -
---|
序号 | <% if @homework.homework_type != 3 %> - | 作品名称 | -- <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%> + | + -- <%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%> + | <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> -作品名称 | -+ | 作品名称 | +关联项目 | <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> -作品名称 | +作品名称 | <% end %>- <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%> + <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> <% if @show_all && @order == "created_at"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | - <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%> + <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | - <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | <% if @homework.homework_type == 2%>- <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> <% if @show_all && @order == "system_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | <% end%> <% if @homework.anonymous_comment == 0%>- <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> <% if @show_all && @order == "student_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | <% end %>- <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> <% end%> | + | <%= student_work.user.show_name%> | " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> - <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> | <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index d0aa0d329..5d9df57c1 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -1,5 +1,6 @@
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
+<%= javascript_include_tag "resizeable_table" %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %>
diff --git a/app/views/student_work/index.js.erb b/app/views/student_work/index.js.erb
index 73b94260d..da2428316 100644
--- a/app/views/student_work/index.js.erb
+++ b/app/views/student_work/index.js.erb
@@ -1,2 +1,4 @@
-$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
-$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
\ No newline at end of file
+$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
+$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
+/*
+$("th").each(function(){$(this).css("width",$(this).width()-1);});*/
diff --git a/app/views/users/_all_replies.html.erb b/app/views/users/_all_replies.html.erb
new file mode 100644
index 000000000..20a3289ff
--- /dev/null
+++ b/app/views/users/_all_replies.html.erb
@@ -0,0 +1,39 @@
+
- <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
-
-
- <% if comment.try(:user).try(:realname) == ' ' %>
- <%= link_to comment.try(:user), user_path(comment.user_id), :class => "content-username" %>
- <% else %>
- <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "content-username" %>
- <% end %>
- <%= time_from_now(comment.created_on) %>
-
-
+ <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment} %>
\ No newline at end of file
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index e694f471e..701f81da1 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -302,91 +302,17 @@
<%if count>3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<%= comment.notes.html_safe %>
-
-
<% end %>
diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb
index a76081859..e04dd3006 100644
--- a/app/views/users/_course_journalsformessage.html.erb
+++ b/app/views/users/_course_journalsformessage.html.erb
@@ -43,50 +43,17 @@
<%if count>3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index c0e667396..76971e240 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -97,7 +97,7 @@
<%#=format_date(activity.updated_on)%>
<%if count > 3 %>
@@ -105,43 +105,10 @@
<% activity= activity.parent ? activity.parent : activity%>
- <% replies_all_i = 0 %>
+ <% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index b89873b43..5ffa78158 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -75,48 +75,17 @@
<%#= format_date(activity.updated_on) %>
<%if count>3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_homework_replies.html.erb b/app/views/users/_homework_replies.html.erb
new file mode 100644
index 000000000..de6e96ae3
--- /dev/null
+++ b/app/views/users/_homework_replies.html.erb
@@ -0,0 +1,78 @@
+
<%#= format_date(activity.updated_on) %>
<% if count > 3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index b3c2fea59..f82dc35e7 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -95,46 +95,15 @@
<%#=format_date(activity.updated_on)%>
<%if count>3 %>
-
+
<% end %>
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
- <% replies_all_i = 0 %>
+ <% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb
index b354bc668..43b22b193 100644
--- a/app/views/users/_project_news.html.erb
+++ b/app/views/users/_project_news.html.erb
@@ -72,48 +72,17 @@
<%#= format_date(activity.updated_on) %>
<%if count>3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index 432074191..3b327c080 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -29,23 +29,6 @@
<% user_activities.each do |user_activity|
if user_activities %>
- <% replies_all_i = replies_all_i + 1 %>
-
- <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
-
-
-
-
-
- <% if comment.try(:author).try(:realname) == ' ' %>
- <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
- <% else %>
- <%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
- <% end %>
- <%= format_time(comment.created_on) %>
-
- <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
-
-
-
- <%= comment.content.html_safe %>
-
-
<% end %>
diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb
index 6967bb398..e7f42c661 100644
--- a/app/views/users/_user_journalsformessage.html.erb
+++ b/app/views/users/_user_journalsformessage.html.erb
@@ -70,57 +70,17 @@
<%if count>3 %>
<% end %>
- <% replies_all_i = 0 %>
+ <% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
-
<% end %>
diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb
index 94d2998ae..afd498d06 100644
--- a/app/views/users/_user_jours_list.html.erb
+++ b/app/views/users/_user_jours_list.html.erb
@@ -7,22 +7,6 @@
<% jours.each do |jour|%>
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %>
|
---|