summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-17 12:58:15 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-17 12:58:15 +0000
commitec337276c620929867635eb704d2a076bf02ae40 (patch)
tree7e7d4bee0720a9f45f5f030e98d13024ed67124c /app
parentfd39c80f8b4a7c98e0da62bf7e7f29ee192887ca (diff)
parent52739518bc8c01f0c9821b01ce5bc3bcd92f2159 (diff)
downloadgitlab-ce-ec337276c620929867635eb704d2a076bf02ae40.tar.gz
Merge branch 'issue_tracker' of /home/git/repositories/gitlab/gitlabhq
Diffstat (limited to 'app')
-rw-r--r--app/helpers/issues_helper.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 5977c9cbae2..2221583912d 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -16,7 +16,7 @@ module IssuesHelper
def url_for_project_issues
return "" if @project.nil?
- if @project.used_default_issues_tracker?
+ if @project.used_default_issues_tracker? || !external_issues_tracker_enabled?
project_issues_path(@project)
else
url = Gitlab.config.issues_tracker[@project.issues_tracker]["project_url"]
@@ -28,7 +28,7 @@ module IssuesHelper
def url_for_new_issue
return "" if @project.nil?
- if @project.used_default_issues_tracker?
+ if @project.used_default_issues_tracker? || !external_issues_tracker_enabled?
url = new_project_issue_path project_id: @project
else
url = Gitlab.config.issues_tracker[@project.issues_tracker]["new_issue_url"]
@@ -40,7 +40,7 @@ module IssuesHelper
def url_for_issue(issue_iid)
return "" if @project.nil?
- if @project.used_default_issues_tracker?
+ if @project.used_default_issues_tracker? || !external_issues_tracker_enabled?
url = project_issue_url project_id: @project, id: issue_iid
else
url = Gitlab.config.issues_tracker[@project.issues_tracker]["issues_url"]
@@ -59,4 +59,13 @@ module IssuesHelper
""
end
end
+
+ # Checks if issues_tracker setting exists in gitlab.yml
+ def external_issues_tracker_enabled?
+ if Gitlab.config.issues_tracker && Gitlab.config.issues_tracker.values.any?
+ true
+ else
+ false
+ end
+ end
end