Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-02-15 17:19:23 +0300
committerRémy Coutable <remy@rymai.me>2016-02-15 17:40:24 +0300
commit54613b6af56008588a3cc8a9e9f2ee642ca59a36 (patch)
tree1e5c08d6ce26d4fb839302eac3911ba59f227cd9 /app/views
parentc29517aaf420b0d83f21d468b371260f4887cf00 (diff)
Fix the "x of y" displayed at the top of Issuables' sidebar
1. We now display the index of the current issuable among all its project's issuables, of the same type and with the same state. 2. Also, refactored a bit the Issuable helpers into a new IssuablesHelper module. 3. Added acceptance specs for the sidebar counter.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml17
1 files changed, 7 insertions, 10 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index ae96a45453f..cb5378964bc 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -2,23 +2,20 @@
.issuable-sidebar
.block
%span.issuable-count.pull-left
- = issuable.iid
+ = issuable_index(issuable)
of
- = issuable_count(:all, @project)
+ = issuables_count(issuable)
%span.pull-right
%a.gutter-toggle{href: '#'}
- - if sidebar_gutter_collapsed?
- = icon('angle-double-left')
- - else
- = icon('angle-double-right')
+ = sidebar_gutter_toggle_icon
.issuable-nav.pull-right.btn-group{role: 'group', "aria-label" => '...'}
- - if has_prev_issuable?(@project, issuable.id)
- = link_to 'Prev', issuable_link_prev(@project, issuable), class: 'btn btn-default prev-btn'
+ - if prev_issuable = prev_issuable_for(issuable)
+ = link_to 'Prev', [@project.namespace.becomes(Namespace), @project, prev_issuable], class: 'btn btn-default prev-btn'
- else
%a.btn.btn-default.disabled{href: '#'}
Prev
- - if has_next_issuable?(@project, issuable.id)
- = link_to 'Next', issuable_link_next(@project, issuable), class: 'btn btn-default next-btn'
+ - if next_issuable = next_issuable_for(issuable)
+ = link_to 'Next', [@project.namespace.becomes(Namespace), @project, next_issuable], class: 'btn btn-default next-btn'
- else
%a.btn.btn-default.disabled{href: '#'}
Next