From 55983093fdc4a5ed447b3dcad77fc227372fcf30 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 11 Mar 2016 09:40:10 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 708ac9a14..c8d5fbce2 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -888,10 +888,7 @@ class CoursesController < ApplicationController end def feedback - @course.journals_for_messages.each do |messages| - query = messages.course_messages.where("user_id = ?", User.current.id) - query.update_all(:viewed => true); - end + CourseMessage.where("user_id = ? and course_id = ?", User.current, @course.id).update_all(:viewed => true) if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) page = params[:page] From 1f5c90185a7fccefd3af4256f32c11f3bb0bd5b8 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 11 Mar 2016 13:14:32 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=8A=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E6=90=9C=E7=B4=A2=E2=80=9C=E5=88=86=E6=9E=90=E2=80=9D?= =?UTF-8?q?=E6=8A=A5404=E9=94=99=E8=AF=AF=E3=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../welcome/_search_all_results.html.erb | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb index 4ed9fba33..51835106b 100644 --- a/app/views/welcome/_search_all_results.html.erb +++ b/app/views/welcome/_search_all_results.html.erb @@ -38,10 +38,19 @@
  • <%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %>
  • - 教师:<%= User.find(item.tea_id).realname %> - 授课时间:<%= item.time.to_s + item.term%> - 更新时间:<%= format_date(item.updated_at)%> - <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
  • + <%= course_teacher = User.where("id = ?", item.tea_id).first if item.tea_id? %> + <% if course_teacher.nil? %> + 教师:无 + 授课时间:<%= item.time.to_s + item.term%> + 更新时间:<%= format_date(item.updated_at)%> + 单位:无 + <%= else %> + 教师:<%= User.find(item.tea_id).realname %> + 授课时间:<%= item.time.to_s + item.term%> + 更新时间:<%= format_date(item.updated_at)%> + <%= course_teacher.user_extensions.occupation.present? ? '单位:'+ course_teacher.user_extensions.occupation : ''%> + <% end %> +
    @@ -56,7 +65,8 @@
    <%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %>资源
    -
  • 发布者:<%= User.find(item.author_id).login%>(<%= User.find(item.author_id).realname%>) + <%= item_author = User.where("id = ?", item.author_id).first if item.author_id? %> +
  • 发布者:<%= item_author.nil? ? '无' : item_author.login%>(<%= item_author.realname unless item_author.nil? %>) 发布时间:<%= format_date(item.created_on)%> 下载次数:<%= item.downloads%>次 @@ -76,7 +86,8 @@
  • <%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description%>
  • -
  • 管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %>更新时间:<%= date_format_local( Project.find(item.id).updated_on) %>
  • + <%= project_admin = User.where("id = ?", item.user_id).first if item.user_id? %> +
  • 管理人员:<%= project_admin.nil? ? '无' : project_admin.login %>更新时间:<%= date_format_local( Project.find(item.id).updated_on) %>
  • @@ -92,7 +103,8 @@
  • <%= item.try(:highlight).try(:content) ? item.highlight.content[0].html_safe : item.content.html_safe%>
  • -
  • 发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %>更新时间:<%= format_date( item.updated_at) %>
  • + <%= memo_author = User.where("id = ?", item.author_id).first if item.author_id? %> +
  • 发帖人:<%= memo_author.nil? ? '无' : memo_author.login %>更新时间:<%= format_date( item.updated_at) %>
  • From ce6d63ccafb6b970abdb5079334150a31571bb11 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 14 Mar 2016 10:24:50 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E9=87=8D=E6=9E=84user.find?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 11 +++ .../welcome/_search_all_results.html.erb | 80 ++++++++----------- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index a74c20751..259b9d04e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1064,6 +1064,17 @@ class User < Principal anonymous_user end + # refactor User model find function, + # return anonymous user when can not find user id = user_id + def self.find user_id + user = User.new + begin + user = super + rescue + user = self.anonymous + end + user + end # Salts all existing unsalted passwords # It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password)) # This method is used in the SaltPasswords migration and is to be kept as is diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb index 51835106b..a714f53d2 100644 --- a/app/views/welcome/_search_all_results.html.erb +++ b/app/views/welcome/_search_all_results.html.erb @@ -1,31 +1,31 @@ <% unless all_results.nil? || all_results.empty?%> -<% all_results.each do |item|%> - <% case item.type %> - <% when 'user'%> - - <% when 'attachment'%> + <% when 'attachment'%> - <% when 'project'%> + <% when 'project'%>
    @@ -103,14 +92,13 @@
  • <%= item.try(:highlight).try(:content) ? item.highlight.content[0].html_safe : item.content.html_safe%>
  • - <%= memo_author = User.where("id = ?", item.author_id).first if item.author_id? %> -
  • 发帖人:<%= memo_author.nil? ? '无' : memo_author.login %>更新时间:<%= format_date( item.updated_at) %>
  • +
  • 发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %>更新时间:<%= format_date( item.updated_at) %>
  • - <%end %> -<% end %> + <%end %> + <% end %>
    <%= paginate all_results,:params => {:controller => 'welcome', :action => 'search',:search_type=>'all'}%>
    From 2f5ce553e20834a4b44ee57c4d592fc6813d4ff7 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 14 Mar 2016 10:46:02 +0800 Subject: [PATCH 04/10] refactor user find --- app/models/user.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 259b9d04e..779566ea8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1066,14 +1066,13 @@ class User < Principal # refactor User model find function, # return anonymous user when can not find user id = user_id - def self.find user_id - user = User.new + def self.find (*args, &block) begin - user = super + super rescue - user = self.anonymous + self.anonymous end - user + # super end # Salts all existing unsalted passwords # It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password)) From 3eaa4b08a37a504a8b3c0fbe7827c1b98849b6a2 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 14 Mar 2016 11:06:29 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8A=A5500=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index a74c20751..aca32650c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -116,7 +116,7 @@ class User < Principal has_one :preference, :dependent => :destroy, :class_name => 'UserPreference' has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'" has_one :blog, :class_name => 'Blog', :foreign_key => "author_id" - has_many :org_document_comments, :dependent =>:destroy + has_many :org_document_comments, :dependent =>:destroy, :foreign_key => "creator_id" has_one :api_token, :class_name => 'Token', :conditions => "action='api'" belongs_to :auth_source has_many :org_members From 3b63071deef7c235d1c72e394b015de4319c3f11 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 16 Mar 2016 15:12:50 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=8Aissue=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=92=8C=E6=94=B6=E8=B5=B7=E5=9C=A8=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=A1=A8=E6=A0=BC=E7=9A=84=E4=B8=8A=E9=9D=A2=E3=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 1ce03da17..7f3d5b177 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -51,6 +51,10 @@
    <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> + + + +
    <%# 局部刷新:修改xissue属性 %> <% if User.current.member_of?(activity.project) %> <% unless params[:action] == "index" %> @@ -59,10 +63,7 @@ <% end %> <% end %> -
    - - -
    +
    <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
    From 4d82f0c959e2f3c0f7793bc6389894a359a8dd9b Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 16 Mar 2016 16:03:53 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=9C=A8=E4=B8=AA=E4=BA=BA=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E3=80=81=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=A1=B9=E7=9B=AE=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E3=80=8Aissue=E5=8A=A8=E6=80=81=E8=A6=81?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E3=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 3 +++ app/views/issues/show.html.erb | 3 +++ app/views/users/_project_issue.html.erb | 17 +++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index eb78c4c5b..f0148fc71 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -118,6 +118,9 @@ class IssuesController < ApplicationController end def show + # 打开编辑内容 + @is_edit = true unless params[:edit].nil? + # 当前用户查看指派给他的缺陷消息,则设置消息为已读 query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first query.update_attribute(:viewed, true) unless query.nil? diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index b9d463855..4b82f8665 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -9,6 +9,9 @@ $(function(){ $("#RSide").removeAttr("id"); $("#Container").css("width","1000px"); + if(<%= @is_edit %>) { + issueEditShow(); + } });
    diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 7f3d5b177..090098722 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -13,6 +13,23 @@ <% end %> TO <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
    +
    + +
    <% case activity.tracker_id %> <% when 1%> From a4e2fd741e671fb4e5d0320f5b174e44a0f8e185 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 17 Mar 2016 14:13:29 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=88=A0=E9=99=A4issue=EF=BC=8C=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 1 + app/controllers/issues_controller.rb | 9 ++++++++- app/helpers/routes_helper.rb | 14 +++++++++++--- app/views/projects/_project_activities.html.erb | 2 +- app/views/users/_project_issue.html.erb | 8 +++++++- app/views/users/_user_activities.html.erb | 2 +- app/views/users/show.html.erb | 3 +-- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index c739e1085..645c7b849 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem 'chinese_pinyin' # gem 'progress_bar' gem 'ansi' +gem 'debugger' gem 'kaminari' gem 'elasticsearch-model' gem 'elasticsearch-rails' diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f0148fc71..44f0d15f4 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -390,6 +390,9 @@ class IssuesController < ApplicationController end def destroy + # 增加删除页面类型,如果是个人主页,则返回该主页,项目动态则返回项目动态页眉 + page_classify = params[:page_classify] unless params[:page_classify].nil? + page_id = params[:page_id] unless params[:page_id].nil? @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f if @hours > 0 case params[:todo] @@ -418,7 +421,11 @@ class IssuesController < ApplicationController end end respond_to do |format| - format.html { redirect_back_or_default _project_issues_path(@project) } + if page_classify + format.html { redirect_back_or_default _project_issues_path(@project, page_classify, page_id) } + else + format.html { redirect_back_or_default _project_issues_path(@project) } + end format.api { render_api_ok } end end diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb index 15c809964..8d08f22da 100644 --- a/app/helpers/routes_helper.rb +++ b/app/helpers/routes_helper.rb @@ -22,10 +22,18 @@ module RoutesHelper # Returns the path to project issues or to the cross-project # issue list if project is nil def _project_issues_path(project, *args) - if project - project_issues_path(project, *args) + if args[0].to_s.include? '_page' + if args[0].to_s == "user_page" + user_activities_path(args[1].to_i) + else + project_path(project) + end else - issues_path(*args) + if project + project_issues_path(project, *args) + else + issues_path(*args) + end end end diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index c036633a5..dd9935634 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -66,7 +66,7 @@ <%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %> <% when "Issue" %> - <%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %> <% when "Message" %> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 090098722..5d472497d 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -21,7 +21,13 @@ <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
  • - <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% if !defined?(project_id) && !defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(project_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% end %>
  • <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 0e55c246c..01711ace3 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -89,7 +89,7 @@ <% if act %> <% case user_activity.act_type.to_s %> <% when 'Issue' %> - <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %> <% when 'Message' %> <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <% when 'ProjectCreateInfo'%> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a56ca7b48..fa4eaacbe 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -45,5 +45,4 @@ <% homepage = BlogComment.find(@user.blog.homepage_id) %> <%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %> <% end %> - -<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %> +<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %> From 9265186307db170492b41d7f181a4d394673fd47 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 17 Mar 2016 14:36:05 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9user=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=ADissue=E8=A1=8C=E9=AB=98=EF=BC=8C=E4=BD=BF=E4=B9=8B?= =?UTF-8?q?=E4=B8=8Eproject=E4=B8=AD=E7=9A=84=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 4669d043e..8aa15d0f7 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -845,7 +845,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 23px !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;display: inline} From 8e41b19563c392533e62eb39a8bc128b3ba7cdbb Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 17 Mar 2016 15:09:08 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8F=96=E6=B6=88tip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_at_message.html.erb | 12 +- app/views/users/_user_message_course.html.erb | 147 ++++++++++-------- app/views/users/_user_message_forge.html.erb | 75 +++++---- app/views/users/_user_message_forum.html.erb | 14 +- app/views/users/_user_message_system.html.erb | 7 +- .../_user_message_userfeedaback.html.erb | 6 +- 6 files changed, 143 insertions(+), 118 deletions(-) diff --git a/app/views/users/_user_at_message.html.erb b/app/views/users/_user_at_message.html.erb index d8649cabe..089171c3d 100644 --- a/app/views/users/_user_at_message.html.erb +++ b/app/views/users/_user_at_message.html.erb @@ -8,15 +8,15 @@ <% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %> <%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course, :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), - :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", - :onmouseover =>"message_titile_show($(this),event)", - :onmouseout => "message_titile_hide($(this))" %> + :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %> + + <% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %> <%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project, :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), - :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", - :onmouseover =>"message_titile_show($(this),event)", - :onmouseout => "message_titile_hide($(this))" %> + :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %> + + <% else %> <%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> <% end %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 62568d505..458ba4551 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -5,9 +5,10 @@
  • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了通知:
  • <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id }, - :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", - :onmouseover =>"message_titile_show($(this),event)", - :onmouseout => "message_titile_hide($(this))" %>
  • + :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %> + + +