From dc521f5844b0c316de2eeff3cf77170520f76c4b Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 17 Jul 2012 22:40:48 +0600 Subject: [PATCH] [refs #90] link to refs --- app/assets/stylesheets/design/custom.scss | 4 ++++ app/helpers/pull_request_helper.rb | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 6f0d30434..502162325 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -1180,3 +1180,7 @@ table.tablesorter tr td.no_results { text-align: center; } /* end */ + +.label-bootstrap.label-info.font14 a { + color: #FFFFFF; +} \ No newline at end of file diff --git a/app/helpers/pull_request_helper.rb b/app/helpers/pull_request_helper.rb index 746bee5c9..32037d675 100644 --- a/app/helpers/pull_request_helper.rb +++ b/app/helpers/pull_request_helper.rb @@ -32,6 +32,15 @@ module PullRequestHelper #helper for helpers def show_ref pull, which, limit = 30 - "#{pull.send("#{which}_project").owner.uname.truncate limit}: #{pull.send("#{which}_ref").truncate limit}" + project, ref = pull.send("#{which}_project"), pull.send("#{which}_ref") + name = "#{project.owner.uname.truncate limit}: #{ref.truncate limit}" + link_to name, ref_path(project, ref) + end -end \ No newline at end of file + + def ref_path project, ref + return tree_path(project, ref) if project.branches_and_tags.include? ref + return commit_path(project, ref) if project.git_repository.commit ref + '#' + end +end