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:
authorDouwe Maan <douwe@gitlab.com>2015-03-24 19:20:05 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-27 12:39:05 +0300
commitc5de2ce742f7f2a472eadcd9a2e0d93992930180 (patch)
treedcb7ac46064672d20d3ff3f70e87545218a52882 /app/models/project_services
parent28592ae46767443dc0f3723bd4f05f360bab8f41 (diff)
Return full URLs from GitLabIssueTrackerService.
Diffstat (limited to 'app/models/project_services')
-rw-r--r--app/models/project_services/gitlab_issue_tracker_service.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/app/models/project_services/gitlab_issue_tracker_service.rb b/app/models/project_services/gitlab_issue_tracker_service.rb
index 84346350a6c..4ff9f75fcc9 100644
--- a/app/models/project_services/gitlab_issue_tracker_service.rb
+++ b/app/models/project_services/gitlab_issue_tracker_service.rb
@@ -20,8 +20,13 @@
class GitlabIssueTrackerService < IssueTrackerService
include Rails.application.routes.url_helpers
- prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
+ default_url_options[:host] = Gitlab.config.gitlab.host
+ default_url_options[:protocol] = Gitlab.config.gitlab.protocol
+ default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port?
+ default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
+
+ prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
def default?
true
@@ -32,20 +37,14 @@ class GitlabIssueTrackerService < IssueTrackerService
end
def project_url
- "#{gitlab_url}#{namespace_project_issues_path(project.namespace, project)}"
+ namespace_project_issues_url(project.namespace, project)
end
def new_issue_url
- "#{gitlab_url}#{new_namespace_project_issue_path(namespace_id: project.namespace, project_id: project)}"
+ new_namespace_project_issue_url(namespace_id: project.namespace, project_id: project)
end
def issue_url(iid)
- "#{gitlab_url}#{namespace_project_issue_path(namespace_id: project.namespace, project_id: project, id: iid)}"
- end
-
- private
-
- def gitlab_url
- Gitlab.config.gitlab.relative_url_root.chomp("/") if Gitlab.config.gitlab.relative_url_root
+ namespace_project_issue_url(namespace_id: project.namespace, project_id: project, id: iid)
end
end