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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
8d19955c
Commit
8d19955c
authored
May 04, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert counter parentheses back to badges
parent
3a3f0bf4
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
50 deletions
+45
-50
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-1
app/views/dashboard/snippets/index.html.haml
app/views/dashboard/snippets/index.html.haml
+8
-8
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+4
-4
app/views/projects/builds/index.html.haml
app/views/projects/builds/index.html.haml
+6
-6
app/views/projects/commit/_ci_menu.html.haml
app/views/projects/commit/_ci_menu.html.haml
+2
-2
app/views/projects/commits/_head.html.haml
app/views/projects/commits/_head.html.haml
+4
-6
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+4
-8
app/views/shared/milestones/_top.html.haml
app/views/shared/milestones/_top.html.haml
+1
-1
features/project/merge_requests.feature
features/project/merge_requests.feature
+4
-4
features/steps/dashboard/todos.rb
features/steps/dashboard/todos.rb
+4
-4
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+5
-5
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
8d19955c
...
...
@@ -316,7 +316,8 @@ module ApplicationHelper
html
=
content_tag
:span
,
entity_title
if
count
.
present?
html
+=
content_tag
:span
,
" (
#{
number_with_delimiter
(
count
)
}
)"
html
+=
" "
html
+=
content_tag
:span
,
number_with_delimiter
(
count
),
class:
'badge'
end
html
.
html_safe
...
...
app/views/dashboard/snippets/index.html.haml
View file @
8d19955c
...
...
@@ -13,26 +13,26 @@
%li
{
class:
(
"active"
unless
params
[
:scope
])
}
=
link_to
dashboard_snippets_path
do
All
%span
(
#{
current_user
.
snippets
.
count
}
)
%span
.badge
=
current_user
.
snippets
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_private"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_private'
)
do
Private
%span
(
#{
current_user
.
snippets
.
are_private
.
count
}
)
%span
.badge
=
current_user
.
snippets
.
are_private
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_internal"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_internal'
)
do
Internal
%span
(
#{
current_user
.
snippets
.
are_internal
.
count
}
)
%span
.badge
=
current_user
.
snippets
.
are_internal
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_public"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_public'
)
do
Public
%span
(
#{
current_user
.
snippets
.
are_public
.
count
}
)
%span
.badge
=
current_user
.
snippets
.
are_public
.
count
=
render
'snippets/snippets'
app/views/dashboard/todos/index.html.haml
View file @
8d19955c
...
...
@@ -8,15 +8,15 @@
=
link_to
todos_filter_path
(
state:
'pending'
)
do
%span
To do
%span
(
#{
todos_pending_count
}
)
%span
.badge
=
todos_pending_count
-
todo_done_active
=
(
'active'
if
params
[
:state
]
==
'done'
)
%li
{
class:
"todos-done #{todo_done_active}"
}
=
link_to
todos_filter_path
(
state:
'done'
)
do
%span
Done
%span
(
#{
todos_done_count
}
)
%span
.badge
=
todos_done_count
.nav-controls
-
if
@todos
.
any?
(
&
:pending?
)
...
...
app/views/projects/builds/index.html.haml
View file @
8d19955c
...
...
@@ -6,21 +6,21 @@
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
project_builds_path
(
@project
)
do
All
%span
.js-totalbuilds-count
(
#{
number_with_delimiter
(
@all_builds
.
count
(
:id
))
}
)
%span
.
badge.
js-totalbuilds-count
=
number_with_delimiter
(
@all_builds
.
count
(
:id
)
)
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
=
link_to
project_builds_path
(
@project
,
scope: :running
)
do
Running
%span
.js-running-count
(
#{
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
}
)
%span
.
badge.
js-running-count
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
)
)
%li
{
class:
(
'active'
if
@scope
==
'finished'
)}
=
link_to
project_builds_path
(
@project
,
scope: :finished
)
do
Finished
%span
.js-running-count
(
#{
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
}
)
%span
.
badge.
js-running-count
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
)
)
.nav-controls
-
if
can?
(
current_user
,
:update_build
,
@project
)
...
...
app/views/projects/commit/_ci_menu.html.haml
View file @
8d19955c
...
...
@@ -2,8 +2,8 @@
=
nav_link
(
path:
'commit#show'
)
do
=
link_to
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Changes
%span
(
#{
@diffs
.
count
}
)
%span
.badge
=
@diffs
.
count
=
nav_link
(
path:
'commit#builds'
)
do
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Builds
%span
(
#{
@statuses
.
count
}
)
%span
.badge
=
@statuses
.
count
app/views/projects/commits/_head.html.haml
View file @
8d19955c
...
...
@@ -2,8 +2,8 @@
=
nav_link
(
controller:
[
:commit
,
:commits
])
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
Commits
%span
(
#{
number_with_delimiter
(
@repository
.
commit_count
)
}
)
%span
.badge
=
number_with_delimiter
(
@repository
.
commit_count
)
=
nav_link
(
controller:
%w(network)
)
do
=
link_to
namespace_project_network_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
...
...
@@ -16,11 +16,9 @@
=
nav_link
(
html_options:
{
class:
branches_tab_class
})
do
=
link_to
namespace_project_branches_path
(
@project
.
namespace
,
@project
)
do
Branches
%span
.js-totalbranch-count
(
#{
@repository
.
branch_count
}
)
%span
.badge.js-totalbranch-count
=
@repository
.
branch_count
=
nav_link
(
controller:
[
:tags
,
:releases
])
do
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
Tags
%span
.js-totaltags-count
(
#{
@repository
.
tag_count
}
)
%span
.badge.js-totaltags-count
=
@repository
.
tag_count
app/views/projects/merge_requests/_show.html.haml
View file @
8d19955c
...
...
@@ -50,24 +50,20 @@
%li
.notes-tab
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
Discussion
%span
(
#{
@merge_request
.
mr_and_commit_notes
.
user
.
nonawards
.
count
}
)
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
nonawards
.
count
%li
.commits-tab
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
%span
(
#{
@commits
.
size
}
)
%span
.badge
=
@commits
.
size
-
if
@ci_commit
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
%span
(
#{
@statuses
.
size
}
)
%span
.badge
=
@statuses
.
size
%li
.diffs-tab
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
%span
(
#{
@merge_request
.
diff_size
}
)
%span
.badge
=
@merge_request
.
diff_size
.tab-content
#notes
.notes.tab-pane.voting_notes
...
...
app/views/shared/milestones/_top.html.haml
View file @
8d19955c
...
...
@@ -24,7 +24,7 @@
-
else
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-grouped btn-reopen"
.detail-page-description.milestone-detail
row-content-block.second-block
.detail-page-description.milestone-detail
%h2
.title
=
markdown
escape_once
(
milestone
.
title
),
pipeline: :single_line
...
...
features/project/merge_requests.feature
View file @
8d19955c
...
...
@@ -135,7 +135,7 @@ Feature: Project Merge Requests
And
I leave a comment like
"Line is wrong"
on diff
And
I switch to the merge request's comments tab
Then
I should see a discussion has started on diff
And
I should see a badge of
"
(1)
"
next to the discussion link
And
I should see a badge of
"
1
"
next to the discussion link
@javascript
Scenario
:
I
see a new comment on merge request diff from another user in the discussion tab
...
...
@@ -143,7 +143,7 @@ Feature: Project Merge Requests
And
I visit merge request page
"Bug NS-05"
And
user
"John Doe"
leaves a comment like
"Line is wrong"
on diff
Then
I should see a discussion by user
"John Doe"
has started on diff
And
I should see a badge of
"
(1)
"
next to the discussion link
And
I should see a badge of
"
1
"
next to the discussion link
@javascript
Scenario
:
I
edit a comment on a merge request diff
...
...
@@ -161,11 +161,11 @@ Feature: Project Merge Requests
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab
And
I leave a comment like
"Line is wrong"
on diff
And
I should see a badge of
"
(1)
"
next to the discussion link
And
I should see a badge of
"
1
"
next to the discussion link
And
I delete the comment
"Line is wrong"
on diff
And
I click on the Discussion tab
Then
I should not see any discussion
And
I should see a badge of
"
(0)
"
next to the discussion link
And
I should see a badge of
"
0
"
next to the discussion link
@javascript
Scenario
:
I
comment on a line of a commit in merge request
...
...
features/steps/dashboard/todos.rb
View file @
8d19955c
...
...
@@ -27,8 +27,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step
'I should see todos assigned to me'
do
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 4'
}
expect
(
page
).
to
have_content
'To do
(4)
'
expect
(
page
).
to
have_content
'Done
(0)
'
expect
(
page
).
to
have_content
'To do
4
'
expect
(
page
).
to
have_content
'Done
0
'
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
,
merge_request
.
title
)
...
...
@@ -43,8 +43,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 3'
}
expect
(
page
).
to
have_content
'To do
(3)
'
expect
(
page
).
to
have_content
'Done
(1)
'
expect
(
page
).
to
have_content
'To do
3
'
expect
(
page
).
to
have_content
'Done
1
'
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
end
...
...
features/steps/project/merge_requests.rb
View file @
8d19955c
...
...
@@ -344,12 +344,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see a badge of "
(1)
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
(1)
"
)
step
'I should see a badge of "
1
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
1
"
)
end
step
'I should see a badge of "
(0)
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
(0)
"
)
step
'I should see a badge of "
0
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
0
"
)
end
step
'I should see a discussion has started on commit diff'
do
...
...
@@ -572,7 +572,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
def
expect_discussion_badge_to_have_counter
(
value
)
page
.
within
(
".notes-tab
span
"
)
do
page
.
within
(
".notes-tab
.badge
"
)
do
page
.
should
have_content
value
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
8d19955c
...
...
@@ -151,7 +151,7 @@ describe 'Comments', feature: true do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
expect
(
merge_request
.
mr_and_commit_notes
.
count
).
to
eq
2
expect
(
find
(
'.notes-tab span
'
).
text
).
to
eq
"(1)
"
expect
(
find
(
'.notes-tab span
.badge'
).
text
).
to
eq
"1
"
end
end
end
...
...
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