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
iv
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
Show 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
...
@@ -316,7 +316,8 @@ module ApplicationHelper
html
=
content_tag
:span
,
entity_title
html
=
content_tag
:span
,
entity_title
if
count
.
present?
if
count
.
present?
html
+=
content_tag
:span
,
" (
#{
number_with_delimiter
(
count
)
}
)"
html
+=
" "
html
+=
content_tag
:span
,
number_with_delimiter
(
count
),
class:
'badge'
end
end
html
.
html_safe
html
.
html_safe
...
...
app/views/dashboard/snippets/index.html.haml
View file @
8d19955c
...
@@ -13,26 +13,26 @@
...
@@ -13,26 +13,26 @@
%li
{
class:
(
"active"
unless
params
[
:scope
])
}
%li
{
class:
(
"active"
unless
params
[
:scope
])
}
=
link_to
dashboard_snippets_path
do
=
link_to
dashboard_snippets_path
do
All
All
%span
%span
.badge
(
#{
current_user
.
snippets
.
count
}
)
=
current_user
.
snippets
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_private"
)
}
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_private"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_private'
)
do
=
link_to
dashboard_snippets_path
(
scope:
'are_private'
)
do
Private
Private
%span
%span
.badge
(
#{
current_user
.
snippets
.
are_private
.
count
}
)
=
current_user
.
snippets
.
are_private
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_internal"
)
}
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_internal"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_internal'
)
do
=
link_to
dashboard_snippets_path
(
scope:
'are_internal'
)
do
Internal
Internal
%span
%span
.badge
(
#{
current_user
.
snippets
.
are_internal
.
count
}
)
=
current_user
.
snippets
.
are_internal
.
count
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_public"
)
}
%li
{
class:
(
"active"
if
params
[
:scope
]
==
"are_public"
)
}
=
link_to
dashboard_snippets_path
(
scope:
'are_public'
)
do
=
link_to
dashboard_snippets_path
(
scope:
'are_public'
)
do
Public
Public
%span
%span
.badge
(
#{
current_user
.
snippets
.
are_public
.
count
}
)
=
current_user
.
snippets
.
are_public
.
count
=
render
'snippets/snippets'
=
render
'snippets/snippets'
app/views/dashboard/todos/index.html.haml
View file @
8d19955c
...
@@ -8,15 +8,15 @@
...
@@ -8,15 +8,15 @@
=
link_to
todos_filter_path
(
state:
'pending'
)
do
=
link_to
todos_filter_path
(
state:
'pending'
)
do
%span
%span
To do
To do
%span
%span
.badge
(
#{
todos_pending_count
}
)
=
todos_pending_count
-
todo_done_active
=
(
'active'
if
params
[
:state
]
==
'done'
)
-
todo_done_active
=
(
'active'
if
params
[
:state
]
==
'done'
)
%li
{
class:
"todos-done #{todo_done_active}"
}
%li
{
class:
"todos-done #{todo_done_active}"
}
=
link_to
todos_filter_path
(
state:
'done'
)
do
=
link_to
todos_filter_path
(
state:
'done'
)
do
%span
%span
Done
Done
%span
%span
.badge
(
#{
todos_done_count
}
)
=
todos_done_count
.nav-controls
.nav-controls
-
if
@todos
.
any?
(
&
:pending?
)
-
if
@todos
.
any?
(
&
:pending?
)
...
...
app/views/projects/builds/index.html.haml
View file @
8d19955c
...
@@ -6,21 +6,21 @@
...
@@ -6,21 +6,21 @@
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
project_builds_path
(
@project
)
do
=
link_to
project_builds_path
(
@project
)
do
All
All
%span
.js-totalbuilds-count
%span
.
badge.
js-totalbuilds-count
(
#{
number_with_delimiter
(
@all_builds
.
count
(
:id
))
}
)
=
number_with_delimiter
(
@all_builds
.
count
(
:id
)
)
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
=
link_to
project_builds_path
(
@project
,
scope: :running
)
do
=
link_to
project_builds_path
(
@project
,
scope: :running
)
do
Running
Running
%span
.js-running-count
%span
.
badge.
js-running-count
(
#{
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
}
)
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
)
)
%li
{
class:
(
'active'
if
@scope
==
'finished'
)}
%li
{
class:
(
'active'
if
@scope
==
'finished'
)}
=
link_to
project_builds_path
(
@project
,
scope: :finished
)
do
=
link_to
project_builds_path
(
@project
,
scope: :finished
)
do
Finished
Finished
%span
.js-running-count
%span
.
badge.
js-running-count
(
#{
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
}
)
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
)
)
.nav-controls
.nav-controls
-
if
can?
(
current_user
,
:update_build
,
@project
)
-
if
can?
(
current_user
,
:update_build
,
@project
)
...
...
app/views/projects/commit/_ci_menu.html.haml
View file @
8d19955c
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
=
nav_link
(
path:
'commit#show'
)
do
=
nav_link
(
path:
'commit#show'
)
do
=
link_to
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
=
link_to
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Changes
Changes
%span
(
#{
@diffs
.
count
}
)
%span
.badge
=
@diffs
.
count
=
nav_link
(
path:
'commit#builds'
)
do
=
nav_link
(
path:
'commit#builds'
)
do
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Builds
Builds
%span
(
#{
@statuses
.
count
}
)
%span
.badge
=
@statuses
.
count
app/views/projects/commits/_head.html.haml
View file @
8d19955c
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
=
nav_link
(
controller:
[
:commit
,
:commits
])
do
=
nav_link
(
controller:
[
:commit
,
:commits
])
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
Commits
Commits
%span
%span
.badge
(
#{
number_with_delimiter
(
@repository
.
commit_count
)
}
)
=
number_with_delimiter
(
@repository
.
commit_count
)
=
nav_link
(
controller:
%w(network)
)
do
=
nav_link
(
controller:
%w(network)
)
do
=
link_to
namespace_project_network_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
=
link_to
namespace_project_network_path
(
@project
.
namespace
,
@project
,
current_ref
)
do
...
@@ -16,11 +16,9 @@
...
@@ -16,11 +16,9 @@
=
nav_link
(
html_options:
{
class:
branches_tab_class
})
do
=
nav_link
(
html_options:
{
class:
branches_tab_class
})
do
=
link_to
namespace_project_branches_path
(
@project
.
namespace
,
@project
)
do
=
link_to
namespace_project_branches_path
(
@project
.
namespace
,
@project
)
do
Branches
Branches
%span
.js-totalbranch-count
%span
.badge.js-totalbranch-count
=
@repository
.
branch_count
(
#{
@repository
.
branch_count
}
)
=
nav_link
(
controller:
[
:tags
,
:releases
])
do
=
nav_link
(
controller:
[
:tags
,
:releases
])
do
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
Tags
Tags
%span
.js-totaltags-count
%span
.badge.js-totaltags-count
=
@repository
.
tag_count
(
#{
@repository
.
tag_count
}
)
app/views/projects/merge_requests/_show.html.haml
View file @
8d19955c
...
@@ -50,24 +50,20 @@
...
@@ -50,24 +50,20 @@
%li
.notes-tab
%li
.notes-tab
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
Discussion
Discussion
%span
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
nonawards
.
count
(
#{
@merge_request
.
mr_and_commit_notes
.
user
.
nonawards
.
count
}
)
%li
.commits-tab
%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
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
Commits
%span
%span
.badge
=
@commits
.
size
(
#{
@commits
.
size
}
)
-
if
@ci_commit
-
if
@ci_commit
%li
.builds-tab
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
Builds
%span
%span
.badge
=
@statuses
.
size
(
#{
@statuses
.
size
}
)
%li
.diffs-tab
%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
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
Changes
%span
%span
.badge
=
@merge_request
.
diff_size
(
#{
@merge_request
.
diff_size
}
)
.tab-content
.tab-content
#notes
.notes.tab-pane.voting_notes
#notes
.notes.tab-pane.voting_notes
...
...
app/views/shared/milestones/_top.html.haml
View file @
8d19955c
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
-
else
-
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"
=
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
%h2
.title
=
markdown
escape_once
(
milestone
.
title
),
pipeline: :single_line
=
markdown
escape_once
(
milestone
.
title
),
pipeline: :single_line
...
...
features/project/merge_requests.feature
View file @
8d19955c
...
@@ -135,7 +135,7 @@ Feature: Project Merge Requests
...
@@ -135,7 +135,7 @@ Feature: Project Merge Requests
And
I leave a comment like
"Line is wrong"
on diff
And
I leave a comment like
"Line is wrong"
on diff
And
I switch to the merge request's comments tab
And
I switch to the merge request's comments tab
Then
I should see a discussion has started on diff
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
@javascript
Scenario
:
I
see a new comment on merge request diff from another user in the discussion tab
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
...
@@ -143,7 +143,7 @@ Feature: Project Merge Requests
And
I visit merge request page
"Bug NS-05"
And
I visit merge request page
"Bug NS-05"
And
user
"John Doe"
leaves a comment like
"Line is wrong"
on diff
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
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
@javascript
Scenario
:
I
edit a comment on a merge request diff
Scenario
:
I
edit a comment on a merge request diff
...
@@ -161,11 +161,11 @@ Feature: Project Merge Requests
...
@@ -161,11 +161,11 @@ Feature: Project Merge Requests
And
I visit merge request page
"Bug NS-05"
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab
And
I click on the Changes tab
And
I leave a comment like
"Line is wrong"
on diff
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 delete the comment
"Line is wrong"
on diff
And
I click on the Discussion tab
And
I click on the Discussion tab
Then
I should not see any discussion
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
@javascript
Scenario
:
I
comment on a line of a commit in merge request
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
...
@@ -27,8 +27,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step
'I should see todos assigned to me'
do
step
'I should see todos assigned to me'
do
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 4'
}
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 4'
}
expect
(
page
).
to
have_content
'To do
(4)
'
expect
(
page
).
to
have_content
'To do
4
'
expect
(
page
).
to
have_content
'Done
(0)
'
expect
(
page
).
to
have_content
'Done
0
'
expect
(
page
).
to
have_link
project
.
name_with_namespace
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
)
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
...
@@ -43,8 +43,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
end
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 3'
}
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 3'
}
expect
(
page
).
to
have_content
'To do
(3)
'
expect
(
page
).
to
have_content
'To do
3
'
expect
(
page
).
to
have_content
'Done
(1)
'
expect
(
page
).
to
have_content
'Done
1
'
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
end
end
...
...
features/steps/project/merge_requests.rb
View file @
8d19955c
...
@@ -344,12 +344,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -344,12 +344,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
end
end
step
'I should see a badge of "
(1)
" next to the discussion link'
do
step
'I should see a badge of "
1
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
(1)
"
)
expect_discussion_badge_to_have_counter
(
"
1
"
)
end
end
step
'I should see a badge of "
(0)
" next to the discussion link'
do
step
'I should see a badge of "
0
" next to the discussion link'
do
expect_discussion_badge_to_have_counter
(
"
(0)
"
)
expect_discussion_badge_to_have_counter
(
"
0
"
)
end
end
step
'I should see a discussion has started on commit diff'
do
step
'I should see a discussion has started on commit diff'
do
...
@@ -572,7 +572,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -572,7 +572,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
def
expect_discussion_badge_to_have_counter
(
value
)
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
page
.
should
have_content
value
end
end
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
8d19955c
...
@@ -151,7 +151,7 @@ describe 'Comments', feature: true do
...
@@ -151,7 +151,7 @@ describe 'Comments', feature: true do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
expect
(
merge_request
.
mr_and_commit_notes
.
count
).
to
eq
2
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
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