BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
244bec91
Commit
244bec91
authored
Nov 01, 2017
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add UI/UX improvements
- Leave 'too many tags to search' always visible - Add different message to the branch/tags so it states its unavailable
parent
2bdad796
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
commits_helper.rb
app/helpers/commits_helper.rb
+14
-2
branches.html.haml
app/views/projects/commit/branches.html.haml
+6
-12
No files found.
app/helpers/commits_helper.rb
View file @
244bec91
...
@@ -60,7 +60,7 @@ module CommitsHelper
...
@@ -60,7 +60,7 @@ module CommitsHelper
branches
.
include?
(
project
.
default_branch
)
?
branches
.
delete
(
project
.
default_branch
)
:
branches
.
pop
branches
.
include?
(
project
.
default_branch
)
?
branches
.
delete
(
project
.
default_branch
)
:
branches
.
pop
end
end
#
r
eturns a link formatted as a commit branch link
#
R
eturns a link formatted as a commit branch link
def
commit_branch_link
(
url
,
text
)
def
commit_branch_link
(
url
,
text
)
link_to
(
url
,
class:
'label label-gray ref-name'
)
do
link_to
(
url
,
class:
'label label-gray ref-name'
)
do
icon
(
'code-fork'
)
+
"
#{
text
}
"
icon
(
'code-fork'
)
+
"
#{
text
}
"
...
@@ -74,13 +74,25 @@ module CommitsHelper
...
@@ -74,13 +74,25 @@ module CommitsHelper
end
.
join
(
' '
).
html_safe
end
.
join
(
' '
).
html_safe
end
end
#
r
eturns a link formatted as a commit tag link
#
R
eturns a link formatted as a commit tag link
def
commit_tag_link
(
url
,
text
)
def
commit_tag_link
(
url
,
text
)
link_to
(
url
,
class:
'label label-gray ref-name'
)
do
link_to
(
url
,
class:
'label label-gray ref-name'
)
do
icon
(
'tag'
)
+
"
#{
text
}
"
icon
(
'tag'
)
+
"
#{
text
}
"
end
end
end
end
def
branches_unavailable_message
link_to
(
'#'
,
class:
'label label-gray ref-name'
,
title:
'Project has too many branches to search'
)
do
icon
(
'tag'
)
+
' Branches unavailable'
end
end
def
tags_unavailable_message
link_to
(
'#'
,
class:
'label label-gray ref-name'
,
title:
'Project has too many tags to search'
)
do
icon
(
'tag'
)
+
' Tags unavailable'
end
end
# Returns the sorted links to tags, separated by a comma
# Returns the sorted links to tags, separated by a comma
def
commit_tags_links
(
project
,
tags
)
def
commit_tags_links
(
project
,
tags
)
sorted
=
VersionSorter
.
rsort
(
tags
)
sorted
=
VersionSorter
.
rsort
(
tags
)
...
...
app/views/projects/commit/branches.html.haml
View file @
244bec91
-
if
@branches_limit_exceeded
-
if
@branches_limit_exceeded
=
commit_branch_link
(
'#'
,
_
(
'Too many branches to search'
))
=
branches_unavailable_message
-
elsif
@branches
.
any?
-
elsif
@branches
.
any?
-
branch
=
commit_default_branch
(
@project
,
@branches
)
-
branch
=
commit_default_branch
(
@project
,
@branches
)
=
commit_branch_link
(
project_ref_path
(
@project
,
branch
),
branch
)
=
commit_branch_link
(
project_ref_path
(
@project
,
branch
),
branch
)
-# `commit_default_branch` deletes the default branch from `@branches`,
-# `commit_default_branch` deletes the default branch from `@branches`,
-# so only render this if we have more branches or tags left
-# so only render this if we have more branches or tags left
-
if
@branches
.
any?
||
@tags
.
any?
||
@tags_limit_exceeded
-
if
@tags_limit_exceeded
%span
=
tags_unavailable_message
=
link_to
"…"
,
"#"
,
class:
"js-details-expand label label-gray"
-
elsif
@tags
.
any?
=
commit_tags_links
(
@project
,
@tags
)
%span
.js-details-content.hide
=
commit_branches_links
(
@project
,
@branches
)
if
@branches
.
any?
-
if
@tags_limit_exceeded
=
commit_tag_link
(
'#'
,
_
(
'Too many tags to search'
))
-
elsif
@tags
.
any?
=
commit_tags_links
(
@project
,
@tags
)
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