diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f8bae6cb..3bcff9e7 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -229,12 +229,6 @@ class IssuesController < ApplicationController User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!} end - # 缺陷状态消息更新 - query_journals_ids = @issue.journals.map{|journal| journal.id} - if query_journals_ids.length > 0 - query_journals = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id in (#{query_journals_ids.join(",")})", User.current.id, "Journal") - query_journals.update_all(:viewed => true) - end @jour_reply = Journal.new @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id desc").all diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8078da87..5e01aa62 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -332,9 +332,7 @@ class ProjectsController < ApplicationController def show # 顶部导航 @project_menu_type = 1 - # 更新消息为已读 - update_message_status(User.current, @project) - # over + if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) return end diff --git a/app/models/issue.rb b/app/models/issue.rb index 1f94889a..e4ac2a17 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -91,10 +91,10 @@ class Issue < ActiveRecord::Base attr_reader :current_journal # fq - after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :add_issues_count, :send_tiding + after_create :act_as_forge_activity, :add_issues_count, :send_tiding + + after_update :be_user_score, :update_activity - after_update :be_user_score,:update_activity - after_destroy :down_user_score, :decrease_issues_count # after_create :be_user_score # end diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index f46000d3..7b57b543 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -1,21 +1,19 @@ <% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %> <% project_issue_count = @project.issues.count %> -<% training_tasks_count = @project.training_tasks.count %> <% project_acts = ForgeActivity.where("project_id = ?", @project.id).count %> -<% raodmaps = Version.where("project_id = ?", @project.id).count %> <% project_score = @project.project_score %> <%# 更新访问数,刷新的时候更新访问次数 %> -<% update_visiti_count(@project) if @project.try(:id) %> +<% update_visiti_count(@project) if @project.try(:id) %>
<% unless @project.is_public %><% end %> <% if @project.is_training_project? %> - <%=link_to "#{@project.owner.try(:show_name)}导师/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> + <%= link_to "#{@project.owner.try(:show_name)}导师/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> <% else %> - <%=link_to "#{@project.owner.try(:show_name)}/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> + <%= link_to "#{@project.owner.try(:show_name)}/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> <% end %> - <%=link_to @project.name, project_path(@project), :class => "pro_new_username break_word" %> + <%= link_to @project.name, project_path(@project), :class => "pro_new_username break_word" %>
@@ -52,14 +50,6 @@ <%= link_to project_issue_count > 0 ? "#{l(:label_issue_tracking)}#{switch_integer_into_k project_issue_count}".html_safe : "#{l(:label_issue_tracking)}", project_issues_path(@project, :remote => true), :class => "pro_new_proname" %> <% end %> - - <% if !@project.enabled_modules.where("name = 'training_tasks'").empty? %> - <% if User.current.admin? || is_project_manager?(User.current.id, @project.id) || is_project_manager?(User.current, @project.try(:forked_from_project_id)) %> -
  • - <%= link_to training_tasks_count > 0 ? "#{l(:project_module_training_tasks)}#{switch_integer_into_k training_tasks_count}".html_safe : "#{l(:project_module_training_tasks)}", project_training_tasks_url(@project), :class => "pro_new_proname" %> -
  • - <% end %> - <% end %> <% unless @project.enabled_modules.where("name = 'files'").empty? %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index e57a9505..7baa3d3b 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -18,7 +18,6 @@ <%= yield :header_tags -%> -
    diff --git a/app/views/projects/_act_issues.html.erb b/app/views/projects/_act_issues.html.erb index a2b2380a..0bb4d872 100644 --- a/app/views/projects/_act_issues.html.erb +++ b/app/views/projects/_act_issues.html.erb @@ -11,31 +11,7 @@ TO <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "color-orange05 ml15"%>
    - <% if User.current.logged? %> -
    -
      -
    • -
        -
      • - <%= link_to l(:button_edit), edit_issue_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_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) %> -
      • -
      -
    • -
    -
    - <% end %> +
    【<%= get_issue_type_new(activity.tracker_id) %>】 @@ -61,9 +37,6 @@
    - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - -
    <%# 局部刷新:修改xissue属性 %> <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> @@ -74,15 +47,10 @@ <% end %> <% end %>
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> -
    -
    - <%= render :partial => 'projects/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> -
    +