From 8ba747e1952be803154a9af3f06f1827ee5db18b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Dec 2016 09:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93diff=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=88Issue=E5=92=8Ccommit=E5=85=B3=E8=81=94?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/changes.html.erb | 12 +++++++++++- app/views/repositories/commit_diff.html.erb | 18 ++++++++++++------ public/stylesheets/css/moduel.css | 1 + public/stylesheets/css/project.css | 4 ++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb index a305b9ec5..d4758d55a 100644 --- a/app/views/repositories/changes.html.erb +++ b/app/views/repositories/changes.html.erb @@ -14,9 +14,19 @@ <% commits.each do |commit| %>
  • <%= time_tag(commit.created_at) %>前 - <%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %> + <%= link_to_user_mail(commit.author_email, "pullreques_pull_name fl ml10") %>

    <%= commit.title %>

    <%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %> + <% get_commit_issues(commit.short_id, @project.id, 0).each do |issue_id| %> +
    + <% if issue_id == "more" %> + <%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "commit_id_value mr5" %> + <% else %> + <%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %> + <% end %> +
    + <% end %> +
  • <% end %> diff --git a/app/views/repositories/commit_diff.html.erb b/app/views/repositories/commit_diff.html.erb index 913561bc2..2d0442a74 100644 --- a/app/views/repositories/commit_diff.html.erb +++ b/app/views/repositories/commit_diff.html.erb @@ -8,12 +8,18 @@

    <%= @commit_details.message %>

    - - - - - - +
    +

    关联Issue:

    + <% get_commit_issues(@commit_details.short_id, @project.id, 1).each do |issue_id| %> +
    + <% if issue_id == "more" %> + <%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => @commit_details.id}, :target => "_blank", :class => "commit_id_value mr5" %> + <% else %> + <%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %> + <% end %> +
    + <% end %> +
  • <%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
  • diff --git a/public/stylesheets/css/moduel.css b/public/stylesheets/css/moduel.css index ea2beb1b8..16a08deb3 100644 --- a/public/stylesheets/css/moduel.css +++ b/public/stylesheets/css/moduel.css @@ -20,6 +20,7 @@ input.radio-width90{ width: 90px; } .muban_icons_blue{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #3b94d6;border: 1px solid #3b94d6;} /*模板buttons 20161013byLB*/ .btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +.btn-commit-issue{display: inline-block;border:none; padding:0 5px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;line-height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; margin-top: 6px;} .btn-commit{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } .btn:hover{background: #c3c3c3; color: #333;} .btn-grey{background: #d9d9d9; color: #656565;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 9f12f8188..a2506fe3f 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -1002,8 +1002,8 @@ a.pullreques_reply_name{ font-weight: bold; color: #333;} .pullreques_reply_txt{ width: 900px;color: #666;} .pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;} a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} -.pullreques_pull_list li{ height: 30px; line-height: 30px; } -.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} +.pullreques_pull_list li{ height: 35px; line-height: 35px; } +.pullreques_pull_txt{display: block; margin-left: 10px;max-width:640px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} .pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; } .pullreques_change_list li:last-child{ border-bottom: none;} .pullreques_icons_add{background: url(/images/new_project/icons_issue.png) 0 -374px no-repeat; display: inline-block; width: 19px; height: 16px;}