Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 13:15:03 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 18:28:38 +0300
commita957eca6f364b7587175a6ffa647fc9df80abed9 (patch)
treed3d3eb934a9f2eba028aa611aba421759171d38f /app/helpers/runners_helper.rb
parent2d0fcb4de23ab368e2e030b3cf7f6b1705ef676f (diff)
Added builds view
Diffstat (limited to 'app/helpers/runners_helper.rb')
-rw-r--r--app/helpers/runners_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb
index 5d7d06c8490..c13db93ae9c 100644
--- a/app/helpers/runners_helper.rb
+++ b/app/helpers/runners_helper.rb
@@ -17,4 +17,17 @@ module RunnersHelper
class: "fa fa-circle runner-status-#{status}",
title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago"
end
+
+ def runner_link(runner)
+ display_name = truncate(runner.display_name, length: 20)
+ id = "\##{runner.id}"
+
+ if current_user && current_user.admin
+ link_to ci_admin_runner_path(runner) do
+ display_name + id
+ end
+ else
+ display_name + id
+ end
+ end
end