summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/helpers/projects_helper.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb29
1 files changed, 24 insertions, 5 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 507e05b9967..04190bc442b 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -123,6 +123,25 @@ module ProjectsHelper
end
end
+ def vue_fork_divergence_data(project, ref)
+ source_project = visible_fork_source(project)
+
+ return {} unless source_project
+
+ source_default_branch = source_project.default_branch
+
+ {
+ source_name: source_project.full_name,
+ source_path: project_path(source_project),
+ ahead_compare_path: project_compare_path(
+ project, from: source_default_branch, to: ref, from_project_id: source_project.id
+ ),
+ behind_compare_path: project_compare_path(
+ source_project, from: ref, to: source_default_branch, from_project_id: project.id
+ )
+ }
+ end
+
def remove_fork_project_warning_message(project)
_("You are going to remove the fork relationship from %{project_full_name}. Are you ABSOLUTELY sure?") %
{ project_full_name: project.full_name }
@@ -285,11 +304,7 @@ module ProjectsHelper
current_page?(starred_explore_projects_path)
end
- def show_merge_request_count?(disabled: false, compact_mode: false)
- !disabled && !compact_mode
- end
-
- def show_issue_count?(disabled: false, compact_mode: false)
+ def show_count?(disabled: false, compact_mode: false)
!disabled && !compact_mode
end
@@ -420,6 +435,10 @@ module ProjectsHelper
project.merge_requests_enabled? && can?(user, :read_merge_request, project)
end
+ def able_to_see_forks_count?(project, user)
+ project.forking_enabled? && can?(user, :read_code, project)
+ end
+
def fork_button_disabled_tooltip(project)
return unless current_user