summaryrefslogtreecommitdiff
path: root/app/presenters/project_presenter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters/project_presenter.rb')
-rw-r--r--app/presenters/project_presenter.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index 86fd405812e..ef75c160b2d 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -7,6 +7,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
include StorageHelper
include TreeHelper
include IconsHelper
+ include BlobHelper
include ChecksCollaboration
include Gitlab::Utils::StrongMemoize
@@ -114,7 +115,11 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end
def add_ci_yml_path
- add_special_file_path(file_name: '.gitlab-ci.yml')
+ add_special_file_path(file_name: ci_config_path_or_default)
+ end
+
+ def add_ci_yml_ide_path
+ ide_edit_path(project, default_branch_or_master, ci_config_path_or_default)
end
def add_readme_path
@@ -219,7 +224,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
if current_user && can_current_user_push_to_default_branch?
AnchorData.new(false,
statistic_icon + _('New file'),
- project_new_blob_path(project, default_branch || 'master'),
+ project_new_blob_path(project, default_branch_or_master),
'missing')
end
end
@@ -325,7 +330,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
if cicd_missing?
AnchorData.new(false,
statistic_icon + _('Set up CI/CD'),
- add_ci_yml_path)
+ add_ci_yml_ide_path)
elsif repository.gitlab_ci_yml.present?
AnchorData.new(false,
statistic_icon('doc-text') + _('CI/CD configuration'),
@@ -397,7 +402,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
commit_message ||= s_("CommitMessage|Add %{file_name}") % { file_name: file_name }
project_new_blob_path(
project,
- project.default_branch || 'master',
+ default_branch_or_master,
file_name: file_name,
commit_message: commit_message,
branch_name: branch_name