项目issue的一些优化

dev_bj
jingquan huang 6 years ago
parent 836dd9b1dc
commit 2c174fad62

@ -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

@ -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

@ -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) %>
<div class="pro_new">
<div class="pro_new_top clear">
<div class="fl pro_new_name clear">
<% unless @project.is_public %><i class="fa fa-lock color-grey-c mr5 font-24 fl "></i><% end %>
<% if @project.is_training_project? %>
<%=link_to "#{@project.owner.try(:show_name)}导师<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
<%= link_to "#{@project.owner.try(:show_name)}导师<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
<% else %>
<%=link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
<%= link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".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" %>
</div>
<!--加入、退出、关注项目-->
@ -52,14 +50,6 @@
<%= link_to project_issue_count > 0 ? "#{l(:label_issue_tracking)}<span class='issues_nav_tag ml5'>#{switch_integer_into_k project_issue_count}</span>".html_safe : "#{l(:label_issue_tracking)}", project_issues_path(@project, :remote => true), :class => "pro_new_proname" %>
</li>
<% 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)) %>
<li id="project_menu_011">
<%= link_to training_tasks_count > 0 ? "#{l(:project_module_training_tasks)}<span class='issues_nav_tag ml5'>#{switch_integer_into_k training_tasks_count}</span>".html_safe : "#{l(:project_module_training_tasks)}", project_training_tasks_url(@project), :class => "pro_new_proname" %>
</li>
<% end %>
<% end %>
<!--资源库-->
<% unless @project.enabled_modules.where("name = 'files'").empty? %>

@ -18,7 +18,6 @@
<%= yield :header_tags -%>
</head>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="newContainer">
<div class="newHeader" id="nHeader">

Loading…
Cancel
Save