Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d28fa2ce
Commit
d28fa2ce
authored
Feb 16, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display "iid of max_iid" in Issuables' sidebar
parent
54613b6a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
19 deletions
+5
-19
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+4
-8
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+0
-10
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/helpers/issuables_helper.rb
View file @
d28fa2ce
...
...
@@ -8,20 +8,16 @@ module IssuablesHelper
"right-sidebar-
#{
sidebar_gutter_collapsed?
?
'collapsed'
:
'expanded'
}
"
end
def
issuable_index
(
issuable
)
base_issuable_scope
(
issuable
).
where
(
'id < ?'
,
issuable
.
id
).
size
+
1
end
def
issuables_count
(
issuable
)
base_issuable_scope
(
issuable
).
size
base_issuable_scope
(
issuable
).
maximum
(
:iid
)
end
def
next_issuable_for
(
issuable
)
base_issuable_scope
(
issuable
).
where
(
'i
d > ?'
,
issuable
.
id
).
last
base_issuable_scope
(
issuable
).
where
(
'i
id > ?'
,
issuable
.
i
id
).
last
end
def
prev_issuable_for
(
issuable
)
base_issuable_scope
(
issuable
).
where
(
'i
d < ?'
,
issuable
.
id
).
first
base_issuable_scope
(
issuable
).
where
(
'i
id < ?'
,
issuable
.
i
id
).
first
end
private
...
...
@@ -31,7 +27,7 @@ module IssuablesHelper
end
def
base_issuable_scope
(
issuable
)
issuable
.
project
.
send
(
issuable
.
to_scop
e_name
).
send
(
issuable_state_scope
(
issuable
))
issuable
.
project
.
send
(
issuable
.
class
.
tabl
e_name
).
send
(
issuable_state_scope
(
issuable
))
end
def
issuable_state_scope
(
issuable
)
...
...
app/models/concerns/issuable.rb
View file @
d28fa2ce
...
...
@@ -168,16 +168,6 @@ module Issuable
self
.
class
.
to_s
.
underscore
end
# Convert this Issuable class name to a format usable for scoping
#
# Examples:
#
# issuable.class # => MergeRequest
# issuable.to_scope_name # => "merge_requests"
def
to_scope_name
self
.
class
.
to_s
.
tableize
end
# Returns a Hash of attributes to be used for Twitter card metadata
def
card_attributes
{
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
d28fa2ce
...
...
@@ -2,7 +2,7 @@
.issuable-sidebar
.block
%span
.issuable-count.pull-left
=
issuable
_index
(
issuable
)
=
issuable
.
iid
of
=
issuables_count
(
issuable
)
%span
.pull-right
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment