Commit 7cf32d1c authored by Oswaldo Ferreira's avatar Oswaldo Ferreira Committed by Eric Eastwood

Improve methods naming

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