Commit 8c7bee0e authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflict in BranchesHelper by adding EE::BranchesHelper

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 83556acf
module BranchesHelper module BranchesHelper
prepend EE::BranchesHelper
def filter_branches_path(options = {}) def filter_branches_path(options = {})
exist_opts = { exist_opts = {
search: params[:search], search: params[:search],
...@@ -24,38 +26,11 @@ module BranchesHelper ...@@ -24,38 +26,11 @@ module BranchesHelper
ProtectedBranch.protected?(project, branch.name) ProtectedBranch.protected?(project, branch.name)
end end
<<<<<<< HEAD
# Returns a hash were keys are types of access levels (user, role), and
# values are the number of access levels of the particular type.
def access_level_frequencies(access_levels)
access_levels.each_with_object(Hash.new(0)) do |access_level, frequencies|
frequencies[access_level.type] += 1
end
end
def access_levels_data(access_levels)
access_levels.map do |level|
if level.type == :user
{
id: level.id,
type: level.type,
user_id: level.user_id,
username: level.user.username,
name: level.user.name,
avatar_url: level.user.avatar_url
}
elsif level.type == :group
{ id: level.id, type: level.type, group_id: level.group_id }
else
{ id: level.id, type: level.type, access_level: level.access_level }
end
=======
def diverging_count_label(count) def diverging_count_label(count)
if count >= Repository::MAX_DIVERGING_COUNT if count >= Repository::MAX_DIVERGING_COUNT
"#{Repository::MAX_DIVERGING_COUNT - 1}+" "#{Repository::MAX_DIVERGING_COUNT - 1}+"
else else
count.to_s count.to_s
>>>>>>> upstream/master
end end
end end
end end
module EE
module BranchesHelper
# Returns a hash were keys are types of access levels (user, role), and
# values are the number of access levels of the particular type.
def access_level_frequencies(access_levels)
access_levels.each_with_object(Hash.new(0)) do |access_level, frequencies|
frequencies[access_level.type] += 1
end
end
def access_levels_data(access_levels)
access_levels.map do |level|
if level.type == :user
{
id: level.id,
type: level.type,
user_id: level.user_id,
username: level.user.username,
name: level.user.name,
avatar_url: level.user.avatar_url
}
elsif level.type == :group
{ id: level.id, type: level.type, group_id: level.group_id }
else
{ id: level.id, type: level.type, access_level: level.access_level }
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment