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 %> -
  • -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %> -
    -
    -
    - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - -
    -
    - <%= reply.content.html_safe %>
    -
    -
    -
  • - <% end %> - + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> <% end %> diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 662a965e9..a822b4a0d 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -70,48 +70,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 %>
    - + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% end %> diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 594063629..cfbbcb5e6 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -6,7 +6,7 @@
    - <%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> + <%= link_to document.creator.show_name, user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | <%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %> @@ -41,8 +41,14 @@
    • - <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %> - 设为首页 + <% if document.organization.home_id == document.id %> + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %> + 取消首页 + <% end %> + <% else %> + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %> + 设为首页 + <% end %> <% end %>
    • @@ -61,7 +67,7 @@ <% end %>
  • - <% comments_for_doc = document.children.reorder("created_at desc") %> + <% comments_for_doc = document.children.reorder("created_at desc").limit(3) %> <% count = document.children.count() %>
    @@ -74,41 +80,14 @@
    <% if count > 3 %>
    - + 展开更多
    <% end %>
    - + <%= render :partial => 'users/all_replies', :locals => {:comments => comments_for_doc}%>
    @@ -138,22 +117,6 @@
    - <% 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.comments.html_safe %>
    -
    -
    -
  • - <% end %> - + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% end %> diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index b2bf0bd59..6a89b51b1 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,14 +1,18 @@ - - + + +
    + <% 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 %> - - + - <% 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 %> <% if @homework.homework_type == 2%> <% end%> <% if @homework.anonymous_comment == 0%> <% end %> diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 688e31451..93c800879 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -12,11 +12,11 @@ <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
    序号  作品名称 - <%= 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 => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> <% if @show_all && @order == "lastname"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :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 => "lastname", :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 => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,: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" ,:remote => true%> <% if @show_all && @order == "student_id"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :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_id", :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 => "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%> - <%= 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%> - <%= 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%> - <%= 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%> 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 @@ +
      + <% comments.each do |comment| %> + +
    • +
      + <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> +
      +
      +
      + <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> + <%= format_activity_day(comment.created_time) %> <%= format_time(comment.created_time, false) %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
      + <% if !comment.content_detail.blank? || comment.class == Journal %> +
      + <% if comment.class == Journal %> + <% if comment.details.any? %> + <% details_to_strings(comment.details).each do |string| %> +

      <%= string %>

      + <% end %> + <% end %> +

      <%= comment.notes.html_safe %>

      + <% else %> + <%= comment.content_detail.html_safe %> + <% end %> +
      + <% end %> +
      +
      +
    • + <% end %> +
    \ No newline at end of file diff --git a/app/views/users/_comment_reply.html.erb b/app/views/users/_comment_reply.html.erb index 895eda8a9..77dcea1f2 100644 --- a/app/views/users/_comment_reply.html.erb +++ b/app/views/users/_comment_reply.html.erb @@ -4,24 +4,5 @@ <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> <% end %> - -
    - <%= 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) %> -
    <%= comment.notes.html_safe %>
    -
    -
    + <%=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 %>
    -
      - <% activity.journals_for_messages.reorder("created_on desc").each do |comment| %> - - <% replies_all_i = replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= time_from_now(comment.created_on) %> -
      - <% unless comment.m_parent_id.nil? %> - <% parents_rely = [] %> - <% parents_rely = get_reply_parents parents_rely, comment %> - <% length = parents_rely.length %> -
      - <% if length <= 3 %> - <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> - <% else %> -
      -
      -
      - <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %> -
      - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> -
      -
      <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %>
      - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> -
      - <% end %> -
      - <% end %> -
      - <%= comment.notes.html_safe %>
      -
      -
      - - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - - - <%= link_to( - l(:button_reply), - {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> - - - - <% if User.current.admin? ||is_teacher || comment.user == User.current%> - <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> - <% end %> - -
      -
      -
      -

      -
      -
      -
    • - <% end %> -
    + <%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
    <% 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 %>
    -
      - <% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %> - - <% replies_all_i = replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_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.notes.html_safe %> -
      -
      -
      -
    • - <% end %> - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 %>
    -
      - <% activity.children.includes(:author).reorder("created_on desc").each do |reply|%> - - <% replies_all_i=replies_all_i+1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - - -
      -
      - <%= reply.content.html_safe %> -
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 %>
    -
      - <% activity.comments.reorder("created_on desc").each do |comment| %> - - <% 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.comments.html_safe %>
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 @@ +
      + <% comments.reorder("created_on desc").each do |comment| %> + +
    • +
      + <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> +
      +
      +
      + <% if comment.try(:user).try(:realname) == ' ' %> + <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= time_from_now(comment.created_on) %> +
      + <% unless comment.m_parent_id.nil? %> + <% parents_rely = [] %> + <% parents_rely = get_reply_parents parents_rely, comment %> + <% length = parents_rely.length %> +
      + <% if length <= 3 %> + <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> + <% else %> +
      +
      +
      + <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> +
      +
      + + + <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %> +
      + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> +
      + <% end %> +
      + <% end %> +
      + <%= comment.notes.html_safe %>
      +
      +
      + + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + + + <%= link_to( + l(:button_reply), + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + + <% if User.current.admin? ||is_teacher || comment.user == User.current%> + <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :course_activity => course_activity}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> + <% end %> + +
      +
      +
      +

      +
      +
      +
    • + <% end %> +
    \ No newline at end of file diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 2b43d8acf..1f4c4b44b 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -10,54 +10,17 @@
    <%#= 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 %>
    -
      - <% activity.journals.includes(:user, :details).reorder("created_on desc").each do |reply| %> - - <% replies_all_i=replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:user).try(:realname) == ' ' %> - <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - -
      -
      - <% if reply.details.any? %> - <% details_to_strings(reply.details).each do |string| %> -

      <%= string %>

      - <% end %> - <% end %> -

      <%= reply.notes.html_safe %>

      -
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 %>
    -
      - <% activity.children.includes(:author).reorder("created_on desc").each do |reply| %> - - <% replies_all_i=replies_all_i+1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - -
      -
      - <%= reply.content.html_safe %>
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 %>
    -
      - <% activity.comments.reorder("created_on desc").each do |comment| %> - - <% 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.comments.html_safe %>
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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 %> - + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> <% end %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index a01418d2f..97eeec89f 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -312,95 +312,17 @@
    <%if count>3 %> <% end %> - <% replies_all_i = 0 %> + <% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    -
      - <% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %> - - <% replies_all_i = replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= time_from_now(comment.created_on) %> -
      - <% unless comment.m_parent_id.nil? %> - <% parents_rely = [] %> - <% parents_rely = get_reply_parents parents_rely, comment %> - <% length = parents_rely.length %> -
      - <% if length <= 3 %> - <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> - <% else %> -
      -
      -
      - <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %> -
      - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> -
      -
      - - - <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %> -
      - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> -
      - <% end %> -
      - <% end %> -
      - <%= comment.notes.html_safe %>
      -
      -
      - - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - - - <%= link_to( - l(:button_reply), - {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :course_activity => -1}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> - - - - <% if User.current.admin? ||is_teacher || comment.user == User.current%> - <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :course_activity => -1}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> - <% end %> - -
      -
      -
      -

      -
      -
      -
    • - <% end %> -
    + <%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => is_in_course, :course_activity=> -1, :is_teacher => is_teacher, :user_activity_id => -1} %>
    <% 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 %>
    -
      - <% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %> - - <% replies_all_i = replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_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.notes.html_safe %> -
      -
      -
      -
    • - <% end %> -
    + <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% 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)) %>