From 1f5c4a800f4c6a1ae57e8d0c5c4ae087c650a8e6 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 4 Aug 2016 11:35:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B2=A1=E6=9C=89=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E5=80=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_pull_request_commits.html.erb | 3 +- app/views/pull_requests/_show.html.erb | 44 ++++++++++++------- app/views/pull_requests/show.html.erb | 4 -- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/app/views/pull_requests/_pull_request_commits.html.erb b/app/views/pull_requests/_pull_request_commits.html.erb index ffccccd8d..a7f6b5aa7 100644 --- a/app/views/pull_requests/_pull_request_commits.html.erb +++ b/app/views/pull_requests/_pull_request_commits.html.erb @@ -3,10 +3,11 @@
<%= format_date(commit.created_at) %> +

<%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %>创建于<%= time_tag(commit.created_at) %>前

<%= commit.title %> -

<%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %>创建于24小时前

+
diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 3015a4d7a..7ebdc1dde 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -4,23 +4,33 @@
<%= @request.title %>

<%= @request.description %>

-
- 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> -
- <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn" %> -
-
- -
根据最近提交时间排列
-
- <%= render :partial => "pull_requests/pull_request_commits" %> -
-
- <%= render :partial => "pull_requests/pull_request_changes" %> -
+<% if @commits_count == 0 && @changes_count == 0 %> +
+ 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> +
+ <%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
+

请将新改动提交至源分支或者切换到其它目标分支

+
+
+<% else %> +
+ 请求将 <%= @request.source_branch %> 合并至 <%= @request.target_branch %> +
+ <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn" %> +
+
+ +
根据最近提交时间排列
+
+ <%= render :partial => "pull_requests/pull_request_commits" %> +
+
+ <%= render :partial => "pull_requests/pull_request_changes" %> +
+<% end %>