Merge remote-tracking branch 'origin/develop' into develop

dev_bj
杨树明 5 years ago
commit 26cde4774e

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

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

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

@ -11,31 +11,7 @@
TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "color-orange05 ml15"%>
</div>
<% if User.current.logged? %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= 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) %>
</li>
<li>
<% 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 %>
</li>
<li>
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
</li>
</ul>
</li>
</ul>
</div>
<% end %>
<div class="homepagePostTitle break_word">
<span class="fl">【<%= get_issue_type_new(activity.tracker_id) %>】</span>
@ -61,9 +37,6 @@
</div>
<div class="cl"></div>
</div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %>
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<%# 局部刷新修改xissue属性 %>
<% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
@ -74,15 +47,10 @@
<% end %>
<% end %>
<div class="cl"></div>
<div class="mb10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
<div id="div_user_issue_reply_<%=user_activity_id%>">
<%= render :partial => 'projects/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
</div>
</div>
<script type="text/javascript">
$(function(){

@ -48,48 +48,10 @@
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<% if User.current.logged? %>
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: block">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<% if activity.author.id == User.current.id%>
<li>
<%= link_to(
l(:button_edit),
edit_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
:class => 'postOptionLink'
) if activity.editable_by?(User.current) %>
</li>
<li>
<%= link_to(
l(:button_delete),
delete_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if activity.destroyable_by?(User.current) %>
</li>
<% end %>
<% if hidden_unproject_infos %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% else %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% end %>
</ul>
</li>
</ul>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>
<div class="bor-grey-e edu-back-white">
<div id="activity_post_reply_<%=user_activity_id %>">
<%=render :partial => 'projects/project_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){

@ -40,13 +40,7 @@
<!--缺陷动态-->
<% when "Issue" %>
<%= render :partial => 'projects/act_issues', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
<% when "TrainingTask" %>
<% if User.current.admin? || is_project_manager?(User.current.id, @project.id) || is_project_manager?(User.current, @project.try(:forked_from_project_id)) %>
<div id="project_show_training_task_<%= @project.id %>">
<%= render :partial => 'projects/act_training_tasks', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
</div>
<% end %>
<!--message-->
<% when "Message" %>
<%= render :partial => 'projects/act_messages', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %>
<!--Attachment -->

Loading…
Cancel
Save