summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-02-20 15:51:52 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-02-20 15:51:52 -0300
commit083003bf1eeef8347c8cd8ac40bdf8a0d7f5672e (patch)
tree1913795b9c5d4e2fa7333e0f9af652a5537272d8
parentc445ef539ef62b0eb425b8cf60e240597b697ec1 (diff)
downloadgitlab-ce-083003bf1eeef8347c8cd8ac40bdf8a0d7f5672e.tar.gz
Improve methods naming
-rw-r--r--app/presenters/project_presenter.rb8
-rw-r--r--app/views/projects/empty.html.haml4
-rw-r--r--app/views/projects/show.html.haml6
3 files changed, 9 insertions, 9 deletions
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index 1f37830e181..6a8227982cb 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -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,
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml
index b4f91f447f9..34f3482d7c6 100644
--- a/app/views/projects/empty.html.haml
+++ b/app/views/projects/empty.html.haml
@@ -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)] }
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index e6e6502c70f..9b2045f396b 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -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)] }