diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-06-09 21:53:32 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-06-16 18:03:15 +0300 |
commit | 0520ee44985528d3076df1208bda7c6c7ff8ec79 (patch) | |
tree | c078ce331252d8c3ce6cd6e6f77f7646b5e143b1 /app/views | |
parent | 85cdde8d3340dc0be28749225bf00923c84e5924 (diff) |
Improve method names and add more specs
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/shared/milestones/_sidebar.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/milestones/_tabs.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/milestones/_top.html.haml | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index e75edd750ff..9bb87640319 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -68,10 +68,10 @@ .sidebar-collapsed-icon %strong = icon('hashtag', 'aria-hidden': 'true') - %span= milestone.issues_visible_to_user(current_user).length + %span= milestone.issues_visible_to_user(current_user).count .title.hide-collapsed Issues - %span.badge= milestone.issues_visible_to_user(current_user).length + %span.badge= milestone.issues_visible_to_user(current_user).count - if project && can?(current_user, :create_issue, project) = link_to new_namespace_project_issue_path(project.namespace, project, issue: { milestone_id: milestone.id }), class: "pull-right", title: "New Issue" do New issue @@ -79,11 +79,11 @@ %span.milestone-stat = link_to milestones_browse_issuables_path(milestone, type: :issues) do Open: - = milestone.issues_visible_to_user(current_user).opened.length + = milestone.issues_visible_to_user(current_user).opened.count %span.milestone-stat = link_to milestones_browse_issuables_path(milestone, type: :issues, state: 'closed') do Closed: - = milestone.issues_visible_to_user(current_user).closed.length + = milestone.issues_visible_to_user(current_user).closed.count .block.merge-requests .sidebar-collapsed-icon diff --git a/app/views/shared/milestones/_tabs.html.haml b/app/views/shared/milestones/_tabs.html.haml index b1d24578daf..4de8a6cb15f 100644 --- a/app/views/shared/milestones/_tabs.html.haml +++ b/app/views/shared/milestones/_tabs.html.haml @@ -31,7 +31,7 @@ .tab-content.milestone-content - if milestone.is_a?(GlobalMilestone) || can?(current_user, :read_issue, @project) .tab-pane.active#tab-issues{ data: { sort_endpoint: (sort_issues_namespace_project_milestone_path(@project.namespace, @project, @milestone) if @project && current_user) } } - = render 'shared/milestones/issues_tab', issues: milestone.issues_visible_to_user(current_user).preload_associations, show_project_name: show_project_name, show_full_project_name: show_full_project_name + = render 'shared/milestones/issues_tab', issues: milestone.sorted_issues(current_user), show_project_name: show_project_name, show_full_project_name: show_full_project_name .tab-pane#tab-merge-requests -# loaded async = render "shared/milestones/tab_loading" diff --git a/app/views/shared/milestones/_top.html.haml b/app/views/shared/milestones/_top.html.haml index 36c2969a555..2562f085338 100644 --- a/app/views/shared/milestones/_top.html.haml +++ b/app/views/shared/milestones/_top.html.haml @@ -50,7 +50,7 @@ - project_name = group ? ms.project.name : ms.project.name_with_namespace = link_to project_name, namespace_project_milestone_path(ms.project.namespace, ms.project, ms) %td - = ms.issues_visible_to_user(current_user).opened.length + = ms.issues_visible_to_user(current_user).opened.count %td - if ms.closed? Closed |