Merge branch 'dai_ao' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

Conflicts:
	app/controllers/pull_requests_controller.rb
This commit is contained in:
daiao 2016-11-29 12:27:40 +08:00
commit 43cd4f55ac
14 changed files with 172 additions and 65 deletions

View File

@ -50,10 +50,10 @@ gem 'elasticsearch-model'
gem 'elasticsearch-rails' gem 'elasticsearch-rails'
#rails 3.2.22.2 bug #rails 3.2.22.2 bug
gem "test-unit", "~>3.0" # gem "test-unit", "~>3.0"
### profile ### profile
gem 'oneapm_rpm' # gem 'oneapm_rpm'
group :development do group :development do
gem 'grape-swagger' gem 'grape-swagger'

View File

@ -101,8 +101,16 @@ class PullRequestsController < ApplicationController
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
@fork_project_name = Project.find(params[:target_project_id]).try(:name) @fork_project_name = Project.find(params[:target_project_id]).try(:name)
@fork_pr_message = true if @fork_project_name @fork_pr_message = true if @fork_project_name
# 发送消息
send_message(User.current.id, target_project_id, title)
# 创建Trustie数据
PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => target_project_id)
else else
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch) request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch)
# 发送消息
send_message(User.current.id, @project.id, title)
# 创建Trustie数据
PullRequest.create(:pull_request_id => request.id, :user_id => User.current.id, :status => 1, :project_id => @project.id)
respond_to do |format| respond_to do |format|
format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)} format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)}
end end
@ -331,6 +339,10 @@ class PullRequestsController < ApplicationController
end end
end end
def send_message user_id, project_id, title
self.forge_acts << ForgeMessage.new(:user_id => user_id, :project_id => project_id, :title => title)
end
def authorize_logged def authorize_logged
if !User.current.logged? if !User.current.logged?
redirect_to signin_path redirect_to signin_path

View File

@ -90,51 +90,60 @@ class UsersController < ApplicationController
# order 排序条件 # order 排序条件
# subject 主题搜索用注意搜索和列表调用同一方法通过参数或者remote区分 # subject 主题搜索用注意搜索和列表调用同一方法通过参数或者remote区分
def user_issues def user_issues
@subject = params[:subject] @subject = params[:subject]
# author_id = params[:author_id] # author_id = params[:author_id]
params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id] params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
if @project_id.nil? if @project_id.nil?
if @assigned_to.nil? if @assigned_to.nil?
if author_id.nil? if author_id.nil?
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?", @issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?",
@user.id , @user.id, "%#{@subject}%").order('updated_on desc') @user.id , @user.id, "%#{@subject}%").order('updated_on desc')
else
@issues = Issue.where("author_id =? and subject like ?",
author_id , "%#{@subject}%").order('updated_on desc')
end
else else
@issues = Issue.where("author_id =? and subject like ?", @issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc')
author_id , "%#{@subject}%").order('updated_on desc')
end end
else
@issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc')
end
else
if @assigned_to.nil?
if author_id.nil?
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?",
(author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
else
@issues = Issue.where("author_id =? and project_id=? and subject like ?",
author_id , @project_id, "%#{@subject}%").order('updated_on desc')
end
else else
@issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?", if @assigned_to.nil?
@assigned_to, @project_id, "%#{@subject}%").order('updated_on desc') if author_id.nil?
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?",
(author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
else
@issues = Issue.where("author_id =? and project_id=? and subject like ?",
author_id , @project_id, "%#{@subject}%").order('updated_on desc')
end
else
@issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?",
@assigned_to, @project_id, "%#{@subject}%").order('updated_on desc')
end
end end
end @issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc')
@issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc') @issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count
@issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count @issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count @issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count @issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
@issue_count = @issues.count # 导出excel的issues
@limit = 10 @excel_issues = @issues
@is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @issue_count = @issues.count
@offset ||= @issue_pages.offset @limit = 10
@issues = paginateHelper @issues, @limit @is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset
@issues = paginateHelper @issues, @limit
respond_to do |format| respond_to do |format|
format.html{render :layout => 'static_base'} format.html{render :layout => 'static_base'}
format.xls{
filename = "我的_#{l(:label_issue_list_xls)}.xls"
send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
format.api format.api
format.js format.js
end end

View File

@ -6,7 +6,7 @@ class ForgeMessage < ActiveRecord::Base
belongs_to :forge_message ,:polymorphic => true belongs_to :forge_message ,:polymorphic => true
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy has_many :message_alls, :class_name => 'MessageAll', :as => :message, :dependent => :destroy
validates :user_id,presence: true validates :user_id,presence: true
validates :project_id,presence: true validates :project_id,presence: true

View File

@ -1,4 +1,7 @@
class PullRequest < ActiveRecord::Base class PullRequest < ActiveRecord::Base
attr_accessible :gpid, :pull_request_id, :user_id # status 1创建 2接受 3重新打开 4关闭
attr_accessible :gpid, :pull_request_id, :user_id, :status
validates_uniqueness_of :pull_request_id validates_uniqueness_of :pull_request_id
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
end end

View File

@ -112,4 +112,4 @@
var defaultBranch = $("#targetBranch option:first-child").val(); var defaultBranch = $("#targetBranch option:first-child").val();
$("#targetBranch").val(defaultBranch); $("#targetBranch").val(defaultBranch);
}); });
</script> </script>

View File

@ -12,7 +12,7 @@
<%= link_to "", project_pull_request_path(request.id, :project_id => @project.id), :class => "issues_icons_mes fr mr5 ml5" %> <%= link_to "", project_pull_request_path(request.id, :project_id => @project.id), :class => "issues_icons_mes fr mr5 ml5" %>
</div> </div>
<div class="c_grey clear mt5"> <div class="c_grey clear mt5">
<p class="fl">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p> <p class="fl">由 <%= link_to User.find(request.author.id).try(:show_name), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p>
<span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span> <span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span>
<p class="fr"><%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p> <p class="fr"><%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p>
</div> </div>

View File

@ -10,7 +10,9 @@
<div style="text-align:left;"> <div style="text-align:left;">
<div style="width:auto; display:inline-block;"> <div style="width:auto; display:inline-block;">
<ul> <ul>
<a href="javascript:void(0)" class="hw_btn_blue ml10 mt10 mb10" style="visibility:hidden;" alt="导出EXCEL">导出EXCEL</a> <!-- <a href="javascript:void(0)" class="hw_btn_blue ml10 mt10 mb10" style="visibility:hidden;" alt="导出EXCEL">导出EXCEL</a>-->
<%= link_to "导出EXCEL", user_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id=>"sendexcel",
:onclick => "remote_function_export('#{User.current}')"%>
</ul> </ul>
</div> </div>

View File

@ -28,8 +28,15 @@
<% end %> <% end %>
<% if ma.course_message_type == "Comment" && ma.course_message %> <% if ma.course_message_type == "Comment" && ma.course_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl">
<li class="homepageNewsPubType fl"><%=link_to User.find(ma.course_message.author_id).show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li> <a href="javascript:void(0);">
<%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message.author_id).show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span>
</li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to ma.course_message.commented.title, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id }, <%= link_to ma.course_message.commented.title, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" , :target => '_blank'%> :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" , :target => '_blank'%>
@ -48,8 +55,13 @@
<% end %> <% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && ma.course_message %> <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && ma.course_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl">
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <a href="javascript:void(0);">
<%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级作业:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级作业:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -255,7 +267,13 @@
<% end %> <% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 && ma.course_message %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 && ma.course_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag(url_to_avatar(User.find(ma.apply_user_id)), width: "30px", height: "30px", class: "mt3") %></div></a></li> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);">
<div class="navHomepageLogo fl">
<%= image_tag(url_to_avatar(User.find(ma.apply_user_id)), width: "30px", height: "30px", class: "mt3") %>
</div>
</a>
</li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.show_name, <%= link_to ma.course_message.user.show_name,
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
@ -280,8 +298,15 @@
<% end %> <% end %>
<% if ma.course_message_type == "Poll" && ma.course_message %> <% if ma.course_message_type == "Poll" && ma.course_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl">
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span></li> <a href="javascript:void(0);">
<%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message.user).show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id), <%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :target => '_blank' %> :class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :target => '_blank' %>
@ -296,9 +321,14 @@
<% end %> <% end %>
<% if ma.course_message_type == "Message" && !ma.nil? && !ma.course_message.nil? %> <% if ma.course_message_type == "Message" && !ma.nil? && !ma.course_message.nil? %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);">
<%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"> <%=link_to User.find(ma.course_message.author).show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li> <%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li>
<% if ma.course_message.parent_id.nil? %> <% if ma.course_message.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -388,9 +418,12 @@
<% if params[:type] != 'homework' %> <% if params[:type] != 'homework' %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a> <a href="javascript:void(0);">
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
</a>
</li> </li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <li class="homepageNewsPubType fl">
<%= link_to User.find(ma.course_message.user).show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -409,9 +442,12 @@
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %> <% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a> <a href="javascript:void(0);">
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
</a>
</li> </li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <li class="homepageNewsPubType fl">
<%= link_to User.find(ma.course_message.user).show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
<% if ma.course_message.m_parent_id.nil? %> <% if ma.course_message.m_parent_id.nil? %>
回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span> 回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>
@ -435,7 +471,9 @@
<% else %> <% else %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a> <a href="javascript:void(0);">
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
</a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + <%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
@ -452,7 +490,8 @@
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p> <p>
<%= User.current.show_name %>老师您好! <%= User.current.show_name %>老师您好!
<%= ma.course_message.user.show_name%><%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"%>回复了您的作品评论。详情如下: <%= User.find(ma.course_message.user).show_name %>
<%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"%>回复了您的作品评论。详情如下:
</p> </p>
<ul class="ul_normal_color"> <ul class="ul_normal_color">
<li>回复内容:<span style="color:red;"><%= ma.course_message.notes %></span></li> <li>回复内容:<span style="color:red;"><%= ma.course_message.notes %></span></li>

View File

@ -162,7 +162,7 @@
<% if ma.forge_message_type == "Message" %> <% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl"><%=link_to User.find(ma.forge_message.user_id).show_name, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <li class="homepageNewsPubType fl"><%=link_to User.find(ma.forge_message.author).show_name, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> <%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -181,7 +181,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to User.find(ma.forge_message.user_id).show_name, user_path(ma.forge_message.author), <%=link_to User.find(ma.forge_message.author).show_name, user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %> :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span>
</li> </li>
@ -194,4 +194,24 @@
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<!--
<% if ma.forge_message_type == "PullRequest" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);">
<%#=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%#=link_to User.find(ma.forge_message.author).show_name, user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%#= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">创建了PullRequest</span>
</li>
<li class="homepageNewsContent fl">
<%#= link_to "#{ma.forge_message.commented.title}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
<li class="homepageNewsTime fl"><%#= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>-->
<% end %> <% end %>

View File

@ -81,7 +81,8 @@
$("#issue_query_form").submit(); $("#issue_query_form").submit();
} }
function remote_function_export(project_id) { function remote_function_export(user) {
var project_id = $("#project_id").attr("value");
var tracker_id = $("#tracker_id").attr("value"); var tracker_id = $("#tracker_id").attr("value");
var subject = $("#v_subject").attr("value"); var subject = $("#v_subject").attr("value");
var assigned_to_id = $("#assigned_to_id").attr("value"); var assigned_to_id = $("#assigned_to_id").attr("value");
@ -93,7 +94,7 @@
var priority_id = $("#priority_id").attr("value"); var priority_id = $("#priority_id").attr("value");
var issue_create_date_start = $("#issue_date_start_issue_export").attr("value"); var issue_create_date_start = $("#issue_date_start_issue_export").attr("value");
var issue_create_date_end = $("#issue_date_end_issue_export").attr("value"); var issue_create_date_end = $("#issue_date_end_issue_export").attr("value");
$("#sendexcel").attr("href","/projects/"+project_id+"/issues.xls?export=true&set_filter=1&tracker_id="+tracker_id+"&assigned_to_id="+assigned_to_id+"&fixed_version_id="+fixed_version_id+"&status_id="+status_id+"&done_ratio="+done_ratio+"&test="+test+"&author_id="+author_id+"&subject="+subject+"&issue_create_date_start="+issue_create_date_start+"&issue_create_date_end="+issue_create_date_end+"&priority_id="+priority_id); $("#sendexcel").attr("href","/users/"+user+"/user_issues.xls?project_id="+project_id+"&tracker_id="+tracker_id+"&assigned_to_id="+assigned_to_id+"&fixed_version_id="+fixed_version_id+"&status_id="+status_id+"&done_ratio="+done_ratio+"&test="+test+"&author_id="+author_id+"&subject="+subject+"&issue_create_date_start="+issue_create_date_start+"&issue_create_date_end="+issue_create_date_end+"&priority_id="+priority_id);
///projects/1811/issues.xls?export=true&set_filter=1 ///projects/1811/issues.xls?export=true&set_filter=1
} }
function EnterPress(e){ function EnterPress(e){
@ -112,6 +113,7 @@
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected"); $("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
$("select[id='author_id']").val(''); $("select[id='author_id']").val('');
$("select[id='priority_id']").val(''); $("select[id='priority_id']").val('');
$("select[id='project_id']").val('');
$("select[id='tracker_id']").val(''); $("select[id='tracker_id']").val('');
$("select[id='fixed_version_id']").val(''); $("select[id='fixed_version_id']").val('');
$("select[id='status_id']").val(''); $("select[id='status_id']").val('');
@ -137,6 +139,7 @@
$("select[id='author_id']").find(user).attr("selected", "selected"); $("select[id='author_id']").find(user).attr("selected", "selected");
$("select[id='assigned_to_id']").val(''); $("select[id='assigned_to_id']").val('');
$("select[id='priority_id']").val(''); $("select[id='priority_id']").val('');
$("select[id='project_id']").val('');
$("select[id='tracker_id']").val(''); $("select[id='tracker_id']").val('');
$("select[id='fixed_version_id']").val(''); $("select[id='fixed_version_id']").val('');
$("select[id='status_id']").val(''); $("select[id='status_id']").val('');
@ -225,7 +228,7 @@
</select>--> </select>-->
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter), <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
{ :include_blank => false,:selected => @project_id ? @project_id : 0 }, { :include_blank => false,:selected => @project_id ? @project_id : 0 },
{ :onchange => "remote_function();add_style();",:id => "proeject_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"} { :onchange => "remote_function();add_style();",:id => "project_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"}
)%> )%>
<select placeholder=" 发布人" class="fl my_issues_filter" disabled="disabled" style="padding:0px;width: 50px;margin-right: 15px;"> <select placeholder=" 发布人" class="fl my_issues_filter" disabled="disabled" style="padding:0px;width: 50px;margin-right: 15px;">
<option value="0" selected="selected">发布人</option> <option value="0" selected="selected">发布人</option>

View File

@ -0,0 +1,9 @@
class DeleteErrorMessageAllAndOrgMessage < ActiveRecord::Migration
def up
MessageAll.where("message_type = 'OrgMessage' and message_id in(15, 17, 18, 19, 170, 172, 173)").destroy_all
OrgMessage.where("organization_id in (30, 82)").destroy_all
end
def down
end
end

View File

@ -0,0 +1,5 @@
class AddStatusToPullRequests < ActiveRecord::Migration
def change
add_column :pull_requests, :status, :integer, :default => false
end
end

View File

@ -0,0 +1,5 @@
class AddProjectIdToPullRequests < ActiveRecord::Migration
def change
add_column :pull_requests, :project_id, :integer
end
end