Improve methods naming
This commit is contained in:
parent
c445ef539e
commit
083003bf1e
|
@ -7,7 +7,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
|
|||
|
||||
presents :project
|
||||
|
||||
def project_stat_anchor_items(show_auto_devops_callout:)
|
||||
def statistics_anchors(show_auto_devops_callout:)
|
||||
[
|
||||
files_anchor_data,
|
||||
commits_anchor_data,
|
||||
|
@ -23,7 +23,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
|
|||
].compact.reject { |i| !i[:enabled] }
|
||||
end
|
||||
|
||||
def project_stat_button_items(show_auto_devops_callout:)
|
||||
def statistics_buttons(show_auto_devops_callout:)
|
||||
[
|
||||
changelog_anchor_data,
|
||||
license_anchor_data,
|
||||
|
@ -35,14 +35,14 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
|
|||
].compact.reject { |i| i[:enabled] }
|
||||
end
|
||||
|
||||
def empty_project_stat_anchor_items
|
||||
def empty_repo_statistics_anchors
|
||||
[
|
||||
autodevops_anchor_data,
|
||||
kubernetes_cluster_anchor_data
|
||||
].compact.reject { |i| !i[:enabled] }
|
||||
end
|
||||
|
||||
def empty_project_stat_button_items
|
||||
def empty_repo_statistics_buttons
|
||||
[
|
||||
new_file_anchor_data,
|
||||
readme_anchor_data,
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
.prepend-top-20
|
||||
|
||||
%nav.project-stats{ class: container_class }
|
||||
= render 'stat_anchor_list', anchors: @project.empty_project_stat_anchor_items
|
||||
= render 'stat_anchor_list', anchors: @project.empty_project_stat_button_items
|
||||
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors
|
||||
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons
|
||||
|
||||
- if can?(current_user, :push_code, @project)
|
||||
%div{ class: [container_class, ("limit-container-width-sm" unless fluid_layout)] }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
- project_stat_items_args = { show_auto_devops_callout: show_auto_devops_callout?(@project) }
|
||||
- @no_container = true
|
||||
- breadcrumb_title "Details"
|
||||
- @content_class = "limit-container-width" unless fluid_layout
|
||||
- @project = @project.present(current_user: current_user)
|
||||
- show_auto_devops_callout = show_auto_devops_callout?(@project)
|
||||
|
||||
= content_for :meta_tags do
|
||||
= auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity")
|
||||
|
@ -16,8 +16,8 @@
|
|||
|
||||
- if can?(current_user, :download_code, @project)
|
||||
%nav.project-stats{ class: container_class }
|
||||
= render 'stat_anchor_list', anchors: @project.project_stat_anchor_items(project_stat_items_args)
|
||||
= render 'stat_anchor_list', anchors: @project.project_stat_button_items(project_stat_items_args)
|
||||
= render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout)
|
||||
= render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout)
|
||||
|
||||
|
||||
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
|
||||
|
|
Loading…
Reference in New Issue