summaryrefslogtreecommitdiff
path: root/app/helpers/import_helper.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-12-16 10:47:26 +0100
committerRémy Coutable <remy@rymai.me>2016-12-19 17:35:51 +0100
commit20aff5cd2b782fa47fe6c15aad07a547179ee147 (patch)
tree82a69bdbe3f2ec8d3e64d97e553f3d630ce52080 /app/helpers/import_helper.rb
parent8fc63d1f648fa38eac9e5422dd42667d8e7f1b49 (diff)
downloadgitlab-ce-20aff5cd2b782fa47fe6c15aad07a547179ee147.tar.gz
Reduce duplication for GitHubish import status view
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/helpers/import_helper.rb')
-rw-r--r--app/helpers/import_helper.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/helpers/import_helper.rb b/app/helpers/import_helper.rb
index f52a0f176e9..a0642a1894b 100644
--- a/app/helpers/import_helper.rb
+++ b/app/helpers/import_helper.rb
@@ -4,12 +4,10 @@ module ImportHelper
"#{namespace}/#{name}"
end
- def github_project_link(path_with_namespace)
- link_to path_with_namespace, github_project_url(path_with_namespace), target: '_blank'
- end
+ def provider_project_link(provider, path_with_namespace)
+ url = __send__("#{provider}_project_url", path_with_namespace)
- def gitea_project_link(path_with_namespace)
- link_to path_with_namespace, gitea_project_url(path_with_namespace), target: '_blank'
+ link_to path_with_namespace, url, target: '_blank'
end
private