diff options
Diffstat (limited to 'app/models/sidebars/projects/menus/repository')
8 files changed, 0 insertions, 269 deletions
diff --git a/app/models/sidebars/projects/menus/repository/menu.rb b/app/models/sidebars/projects/menus/repository/menu.rb deleted file mode 100644 index f49a0479521..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - class Menu < ::Sidebars::Menu - override :configure_menu_items - def configure_menu_items - add_item(MenuItems::Files.new(context)) - add_item(MenuItems::Commits.new(context)) - add_item(MenuItems::Branches.new(context)) - add_item(MenuItems::Tags.new(context)) - add_item(MenuItems::Contributors.new(context)) - add_item(MenuItems::Graphs.new(context)) - add_item(MenuItems::Compare.new(context)) - end - - override :link - def link - project_tree_path(context.project) - end - - override :extra_container_html_options - def extra_container_html_options - { - class: 'shortcuts-tree' - } - end - - override :title - def title - _('Repository') - end - - override :title_html_options - def title_html_options - { - id: 'js-onboarding-repo-link' - } - end - - override :sprite_icon - def sprite_icon - 'doc-text' - end - - override :render? - def render? - can?(context.current_user, :download_code, context.project) && - !context.project.empty_repo? - end - end - end - end - end -end - -Sidebars::Projects::Menus::Repository::Menu.prepend_if_ee('EE::Sidebars::Projects::Menus::Repository::Menu') diff --git a/app/models/sidebars/projects/menus/repository/menu_items/branches.rb b/app/models/sidebars/projects/menus/repository/menu_items/branches.rb deleted file mode 100644 index 4a62803dd2b..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/branches.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Branches < ::Sidebars::MenuItem - override :link - def link - project_branches_path(context.project) - end - - override :extra_container_html_options - def extra_container_html_options - { - id: 'js-onboarding-branches-link' - } - end - - override :active_routes - def active_routes - { controller: :branches } - end - - override :title - def title - _('Branches') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/commits.rb b/app/models/sidebars/projects/menus/repository/menu_items/commits.rb deleted file mode 100644 index 647cf89133e..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/commits.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Commits < ::Sidebars::MenuItem - override :link - def link - project_commits_path(context.project, context.current_ref) - end - - override :extra_container_html_options - def extra_container_html_options - { - id: 'js-onboarding-commits-link' - } - end - - override :active_routes - def active_routes - { controller: %w(commit commits) } - end - - override :title - def title - _('Commits') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/compare.rb b/app/models/sidebars/projects/menus/repository/menu_items/compare.rb deleted file mode 100644 index 4812636b63f..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/compare.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Compare < ::Sidebars::MenuItem - override :link - def link - project_compare_index_path(context.project, from: context.project.repository.root_ref, to: context.current_ref) - end - - override :active_routes - def active_routes - { controller: :compare } - end - - override :title - def title - _('Compare') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/contributors.rb b/app/models/sidebars/projects/menus/repository/menu_items/contributors.rb deleted file mode 100644 index d60fd05bb64..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/contributors.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Contributors < ::Sidebars::MenuItem - override :link - def link - project_graph_path(context.project, context.current_ref) - end - - override :active_routes - def active_routes - { path: 'graphs#show' } - end - - override :title - def title - _('Contributors') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/files.rb b/app/models/sidebars/projects/menus/repository/menu_items/files.rb deleted file mode 100644 index 4989efe9fa5..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/files.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Files < ::Sidebars::MenuItem - override :link - def link - project_tree_path(context.project, context.current_ref) - end - - override :active_routes - def active_routes - { controller: %w[tree blob blame edit_tree new_tree find_file] } - end - - override :title - def title - _('Files') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/graphs.rb b/app/models/sidebars/projects/menus/repository/menu_items/graphs.rb deleted file mode 100644 index a57021be4d0..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/graphs.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Graphs < ::Sidebars::MenuItem - override :link - def link - project_network_path(context.project, context.current_ref) - end - - override :active_routes - def active_routes - { controller: :network } - end - - override :title - def title - _('Graph') - end - end - end - end - end - end -end diff --git a/app/models/sidebars/projects/menus/repository/menu_items/tags.rb b/app/models/sidebars/projects/menus/repository/menu_items/tags.rb deleted file mode 100644 index d84bc89b93c..00000000000 --- a/app/models/sidebars/projects/menus/repository/menu_items/tags.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module Sidebars - module Projects - module Menus - module Repository - module MenuItems - class Tags < ::Sidebars::MenuItem - override :link - def link - project_tags_path(context.project) - end - - override :active_routes - def active_routes - { controller: :tags } - end - - override :title - def title - _('Tags') - end - end - end - end - end - end -end |